diff --git a/.gitignore b/.gitignore index 8f252ae..916fc28 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ compile_commands.json .cache /test /linux +/buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/etc/version/release_version +.clangd diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index faec06f..647482d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -313,6 +313,10 @@ before_script: - echo "${DST_DIR}/${SUB_DIR}/" - ls "${DST_DIR}/${SUB_DIR}/" - echo "add latest link for current build" + - echo "generate three random numers to sleep and schedule more pipeline job" + - sleep $((RANDOM % 9 + 1)) + - sleep $((RANDOM % 9 + 1)) + - sleep $((RANDOM % 9 + 1)) - test -h ${DST_DIR}/latest && sudo rm ${DST_DIR}/latest - sudo ln -s ${DST_DIR}/${SUB_BASE} ${DST_DIR}/latest || exit 1 - ls ${DST_DIR}/latest @@ -391,6 +395,10 @@ before_script: fi - echo "MR ID ${CI_MERGE_REQUEST_IID}" - echo "Pipeline ID ${CI_PIPELINE_ID}" + - echo "generate three random numers to sleep and schedule more pipeline job" + - sleep $((RANDOM % 9 + 1)) + - sleep $((RANDOM % 9 + 1)) + - sleep $((RANDOM % 9 + 1)) - test -d bin || mkdir ./bin - test -f ./bin/ailab && rm -rf ./bin/ailab - wget -qc https://ai.b-bug.org/k230/test_resources/ci/tools/ailab -O ./bin/ailab diff --git a/buildroot-overlay/board/canaan/k230-soc/post-image.sh b/buildroot-overlay/board/canaan/k230-soc/post-image.sh index 4238127..11cb2fd 100755 --- a/buildroot-overlay/board/canaan/k230-soc/post-image.sh +++ b/buildroot-overlay/board/canaan/k230-soc/post-image.sh @@ -212,8 +212,10 @@ gen_env_bin() default_env_file=${env_dir}/01studio.env; fi - if [ ${CONF} == "k230d_canmv_ilp32_defconfig" ]; then - sed -i 's/^bootcmd=.*$/bootcmd=run blinuxilp32;/g' ${default_env_file} + if [ ${CONF} == "k230d_canmv_ilp32_defconfig" ] || [ ${CONF} == "BPI-CanMV-K230D-Zero_ilp32_defconfig" ]; then + sed -i 's/^bootcmd=.*$/bootcmd=run bnuttx;run blinuxilp32;/g' ${default_env_file} + elif [ ${CONF} == "k230d_canmv_defconfig" ] || [ ${CONF} == "BPI-CanMV-K230D-Zero_defconfig" ]; then + sed -i 's/^bootcmd=.*$/bootcmd=run bnuttx;run blinux;/g' ${default_env_file} else sed -i 's/^bootcmd=.*$/bootcmd=run blinux;/g' ${default_env_file} fi diff --git a/buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/etc/init.d/rcS b/buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/etc/init.d/rcS index dfef953..5f15775 100755 --- a/buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/etc/init.d/rcS +++ b/buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/etc/init.d/rcS @@ -26,3 +26,9 @@ for i in /etc/init.d/S??* ;do done mount /dev/mmcblk0p1 /boot cat /etc/version/release_version +modprobe vvcam_isp +modprobe vvcam_mipi +modprobe vvcam_vb +modprobe vvcam_isp_subdev +modprobe vvcam_video +ISP_MEDIA_SENSOR_DRIVER=/usr/lib/libvvcam.so /usr/bin/isp_media_server > /dev/null 2> /tmp/isp.err.log & diff --git a/buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/etc/version/release_version b/buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/etc/version/release_version deleted file mode 100644 index df4a9b0..0000000 --- a/buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/etc/version/release_version +++ /dev/null @@ -1,3 +0,0 @@ -#############SDK VERSION###################################### -sdk:v0.2-20240722-041214-wangjianxin-k230-a402e06 -############################################################## diff --git a/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_defconfig b/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_defconfig index d8e5424..5f5f131 100755 --- a/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_defconfig +++ b/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_defconfig @@ -20,14 +20,13 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="bananapi-canmv-k230d-zero $(LINUX_DIR)" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/ruyisdk/linux-xuantie-kernel.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="29ca31b84050c86353b9e7207491e4c1201b10ea" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="5bbfb4fbf6326dbcba9d16c9ca9013e908a8074f" BR2_LINUX_KERNEL_DEFCONFIG="k230" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/bananapi-canmv-k230d-zero" BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_PACKAGE_LINUX_TOOLS_GPIO=y BR2_PACKAGE_ALSA_UTILS=y -BR2_PACKAGE_FFMPEG=y BR2_PACKAGE_VVCAM=y BR2_PACKAGE_COREMARK=y BR2_PACKAGE_COREMARK_PRO=y diff --git a/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_ilp32_defconfig b/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_ilp32_defconfig index bc5d652..abfb2d2 100755 --- a/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_ilp32_defconfig +++ b/buildroot-overlay/configs/BPI-CanMV-K230D-Zero_ilp32_defconfig @@ -23,7 +23,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="k230d-canmv $(LINUX_DIR)" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/ruyisdk/linux-xuantie-kernel.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="29ca31b84050c86353b9e7207491e4c1201b10ea" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="5bbfb4fbf6326dbcba9d16c9ca9013e908a8074f" BR2_LINUX_KERNEL_DEFCONFIG="k230" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/bananapi-canmv-k230d-zero.dts" diff --git a/buildroot-overlay/configs/k230_canmv_01studio_defconfig b/buildroot-overlay/configs/k230_canmv_01studio_defconfig index 3830d97..a308ad4 100755 --- a/buildroot-overlay/configs/k230_canmv_01studio_defconfig +++ b/buildroot-overlay/configs/k230_canmv_01studio_defconfig @@ -20,24 +20,42 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="k230-canmv-01studio $(LINUX_DIR)" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/ruyisdk/linux-xuantie-kernel.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="29ca31b84050c86353b9e7207491e4c1201b10ea" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="5bbfb4fbf6326dbcba9d16c9ca9013e908a8074f" BR2_LINUX_KERNEL_DEFCONFIG="k230" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/k230-canmv-01studio" BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_PACKAGE_LINUX_TOOLS_GPIO=y BR2_PACKAGE_ALSA_UTILS=y -BR2_PACKAGE_FFMPEG=y BR2_PACKAGE_VVCAM=y BR2_PACKAGE_COREMARK=y BR2_PACKAGE_COREMARK_PRO=y BR2_PACKAGE_VG_LITE_DEMOS=y +BR2_PACKAGE_PYTHON3=y +BR2_PACKAGE_PYTHON3_BZIP2=y +BR2_PACKAGE_PYTHON3_DECIMAL=y +BR2_PACKAGE_PYTHON3_READLINE=y +BR2_PACKAGE_PYTHON3_SSL=y +BR2_PACKAGE_PYTHON3_SQLITE=y +BR2_PACKAGE_PYTHON3_PYEXPAT=y +BR2_PACKAGE_PYTHON3_XZ=y +BR2_PACKAGE_PYTHON3_ZLIB=y +BR2_PACKAGE_OPENCV4=y +BR2_PACKAGE_OPENCV4_LIB_PYTHON=y +BR2_PACKAGE_OPENCV4_LIB_VIDEOIO=y +BR2_PACKAGE_OPENCV4_LIB_VIDEO=y +BR2_PACKAGE_OPENCV4_WITH_FFMPEG=y +BR2_PACKAGE_OPENCV4_WITH_JPEG=y +BR2_PACKAGE_OPENCV4_WITH_PNG=y +BR2_PACKAGE_OPENCV4_WITH_V4L=y +BR2_PACKAGE_OPENCV4_WITH_WEBP=y +BR2_PACKAGE_OPENCV4_CONTRIB=y BR2_PACKAGE_LIBGPIOD=y BR2_PACKAGE_LIBGPIOD_TOOLS=y BR2_PACKAGE_LRZSZ=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y -BR2_TARGET_ROOTFS_EXT2_SIZE="128M" +BR2_TARGET_ROOTFS_EXT2_SIZE="256M" BR2_TARGET_OPENSBI=y BR2_TARGET_OPENSBI_CUSTOM_VERSION=y BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.4" diff --git a/buildroot-overlay/configs/k230_canmv_defconfig b/buildroot-overlay/configs/k230_canmv_defconfig index 00e12c4..c18b962 100755 --- a/buildroot-overlay/configs/k230_canmv_defconfig +++ b/buildroot-overlay/configs/k230_canmv_defconfig @@ -20,18 +20,36 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="k230-canmv $(LINUX_DIR)" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/ruyisdk/linux-xuantie-kernel.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="29ca31b84050c86353b9e7207491e4c1201b10ea" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="5bbfb4fbf6326dbcba9d16c9ca9013e908a8074f" BR2_LINUX_KERNEL_DEFCONFIG="k230" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/k230-canmv" BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_PACKAGE_LINUX_TOOLS_GPIO=y BR2_PACKAGE_ALSA_UTILS=y -BR2_PACKAGE_FFMPEG=y BR2_PACKAGE_VVCAM=y BR2_PACKAGE_COREMARK=y BR2_PACKAGE_COREMARK_PRO=y BR2_PACKAGE_VG_LITE_DEMOS=y +BR2_PACKAGE_PYTHON3=y +BR2_PACKAGE_PYTHON3_BZIP2=y +BR2_PACKAGE_PYTHON3_DECIMAL=y +BR2_PACKAGE_PYTHON3_READLINE=y +BR2_PACKAGE_PYTHON3_SSL=y +BR2_PACKAGE_PYTHON3_SQLITE=y +BR2_PACKAGE_PYTHON3_PYEXPAT=y +BR2_PACKAGE_PYTHON3_XZ=y +BR2_PACKAGE_PYTHON3_ZLIB=y +BR2_PACKAGE_OPENCV4=y +BR2_PACKAGE_OPENCV4_LIB_PYTHON=y +BR2_PACKAGE_OPENCV4_LIB_VIDEOIO=y +BR2_PACKAGE_OPENCV4_LIB_VIDEO=y +BR2_PACKAGE_OPENCV4_WITH_FFMPEG=y +BR2_PACKAGE_OPENCV4_WITH_JPEG=y +BR2_PACKAGE_OPENCV4_WITH_PNG=y +BR2_PACKAGE_OPENCV4_WITH_V4L=y +BR2_PACKAGE_OPENCV4_WITH_WEBP=y +BR2_PACKAGE_OPENCV4_CONTRIB=y BR2_PACKAGE_LIBGPIOD=y BR2_PACKAGE_LIBGPIOD_TOOLS=y BR2_PACKAGE_LRZSZ=y diff --git a/buildroot-overlay/configs/k230_evb_defconfig b/buildroot-overlay/configs/k230_evb_defconfig index 8272f79..739c1dd 100755 --- a/buildroot-overlay/configs/k230_evb_defconfig +++ b/buildroot-overlay/configs/k230_evb_defconfig @@ -20,24 +20,42 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="k230-evb $(LINUX_DIR)" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/ruyisdk/linux-xuantie-kernel.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="29ca31b84050c86353b9e7207491e4c1201b10ea" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="5bbfb4fbf6326dbcba9d16c9ca9013e908a8074f" BR2_LINUX_KERNEL_DEFCONFIG="k230" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/k230-evb" BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_PACKAGE_LINUX_TOOLS_GPIO=y BR2_PACKAGE_ALSA_UTILS=y -BR2_PACKAGE_FFMPEG=y BR2_PACKAGE_VVCAM=y BR2_PACKAGE_COREMARK=y BR2_PACKAGE_COREMARK_PRO=y BR2_PACKAGE_VG_LITE_DEMOS=y +BR2_PACKAGE_PYTHON3=y +BR2_PACKAGE_PYTHON3_BZIP2=y +BR2_PACKAGE_PYTHON3_DECIMAL=y +BR2_PACKAGE_PYTHON3_READLINE=y +BR2_PACKAGE_PYTHON3_SSL=y +BR2_PACKAGE_PYTHON3_SQLITE=y +BR2_PACKAGE_PYTHON3_PYEXPAT=y +BR2_PACKAGE_PYTHON3_XZ=y +BR2_PACKAGE_PYTHON3_ZLIB=y +BR2_PACKAGE_OPENCV4=y +BR2_PACKAGE_OPENCV4_LIB_PYTHON=y +BR2_PACKAGE_OPENCV4_LIB_VIDEOIO=y +BR2_PACKAGE_OPENCV4_LIB_VIDEO=y +BR2_PACKAGE_OPENCV4_WITH_FFMPEG=y +BR2_PACKAGE_OPENCV4_WITH_JPEG=y +BR2_PACKAGE_OPENCV4_WITH_PNG=y +BR2_PACKAGE_OPENCV4_WITH_V4L=y +BR2_PACKAGE_OPENCV4_WITH_WEBP=y +BR2_PACKAGE_OPENCV4_CONTRIB=y BR2_PACKAGE_LIBGPIOD=y BR2_PACKAGE_LIBGPIOD_TOOLS=y BR2_PACKAGE_LRZSZ=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y -BR2_TARGET_ROOTFS_EXT2_SIZE="128M" +BR2_TARGET_ROOTFS_EXT2_SIZE="256M" BR2_TARGET_OPENSBI=y BR2_TARGET_OPENSBI_CUSTOM_VERSION=y BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.4" diff --git a/buildroot-overlay/configs/k230d_canmv_defconfig b/buildroot-overlay/configs/k230d_canmv_defconfig index 69ad2a4..0ad70a7 100755 --- a/buildroot-overlay/configs/k230d_canmv_defconfig +++ b/buildroot-overlay/configs/k230d_canmv_defconfig @@ -20,14 +20,13 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="k230d-canmv $(LINUX_DIR)" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/ruyisdk/linux-xuantie-kernel.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="29ca31b84050c86353b9e7207491e4c1201b10ea" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="5bbfb4fbf6326dbcba9d16c9ca9013e908a8074f" BR2_LINUX_KERNEL_DEFCONFIG="k230" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/k230d-canmv" BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_PACKAGE_LINUX_TOOLS_GPIO=y BR2_PACKAGE_ALSA_UTILS=y -BR2_PACKAGE_FFMPEG=y BR2_PACKAGE_VVCAM=y BR2_PACKAGE_COREMARK=y BR2_PACKAGE_COREMARK_PRO=y diff --git a/buildroot-overlay/configs/k230d_canmv_ilp32_defconfig b/buildroot-overlay/configs/k230d_canmv_ilp32_defconfig index 17cb183..16069e4 100755 --- a/buildroot-overlay/configs/k230d_canmv_ilp32_defconfig +++ b/buildroot-overlay/configs/k230d_canmv_ilp32_defconfig @@ -23,7 +23,7 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="k230d-canmv $(LINUX_DIR)" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/ruyisdk/linux-xuantie-kernel.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="29ca31b84050c86353b9e7207491e4c1201b10ea" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="5bbfb4fbf6326dbcba9d16c9ca9013e908a8074f" BR2_LINUX_KERNEL_DEFCONFIG="k230" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="canaan/k230d-canmv" diff --git a/buildroot-overlay/package/Config.in b/buildroot-overlay/package/Config.in index 382b22c..a458ff5 100644 --- a/buildroot-overlay/package/Config.in +++ b/buildroot-overlay/package/Config.in @@ -1666,6 +1666,7 @@ menu "Graphics" source "package/libdmtx/Config.in" source "package/libdri2/Config.in" source "package/libdrm/Config.in" + source "package/display/Config.in" source "package/libepoxy/Config.in" source "package/libexif/Config.in" source "package/libfm/Config.in" diff --git a/buildroot-overlay/package/display/CMakeLists.txt b/buildroot-overlay/package/display/CMakeLists.txt new file mode 100644 index 0000000..889de61 --- /dev/null +++ b/buildroot-overlay/package/display/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.5) + +set(CMAKE_CXX_STANDARD 17) + +project(display + VERSION 1.0 + DESCRIPTION "abstruct to libdrm" +) + +include(FindPkgConfig) +find_package(PkgConfig REQUIRED) +pkg_check_modules(LIBDRM REQUIRED libdrm) + +file(GLOB SOURCES "src/*.c") + +add_library(${PROJECT_NAME} src/display.c) +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ + #$ +) +target_link_libraries(${PROJECT_NAME} ${LIBDRM_LIBRARIES}) + +if(${BUILD_TEST}) + add_executable(test-${PROJECT_NAME} src/test.cpp) + target_link_libraries(test-${PROJECT_NAME} display) +endif(${BUILD_TEST}) + + +install(DIRECTORY include/ DESTINATION include) +install(TARGETS ${PROJECT_NAME} DESTINATION lib) + +set(DRM_INCLUDES "") +foreach(DRM_INCLUDE ${LIBDRM_INCLUDE_DIRS}) + set(DRM_INCLUDES "${DRM_INCLUDES} -I${DRM_INCLUDE}") +endforeach(DRM_INCLUDE ${LIBDRM_INCLUDE_DIRS}) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc + @ONLY +) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig) diff --git a/buildroot-overlay/package/display/Config.in b/buildroot-overlay/package/display/Config.in new file mode 100644 index 0000000..0b1187b --- /dev/null +++ b/buildroot-overlay/package/display/Config.in @@ -0,0 +1,3 @@ +config BR2_PACKAGE_DISPLAY + bool "libdrm abstruct library for display" + select BR2_PACKAGE_LIBDRM diff --git a/buildroot-overlay/package/display/display.mk b/buildroot-overlay/package/display/display.mk new file mode 100644 index 0000000..6b09681 --- /dev/null +++ b/buildroot-overlay/package/display/display.mk @@ -0,0 +1,15 @@ +################################################################################ +# +# display +# +################################################################################ + +DISPLAY_DIR_NAME := display +DISPLAY_APP_NAME := display +DISPLAY_SITE = $(realpath $(TOPDIR))"/package/display" +DISPLAY_SITE_METHOD = local +DISPLAY_INSTALL_STAGING = YES +DISPLAY_INSTALL_TARGET = YES +DISPLAY_DEPENDENCIES = libdrm + +$(eval $(cmake-package)) diff --git a/buildroot-overlay/package/display/display.pc.in b/buildroot-overlay/package/display/display.pc.in new file mode 100644 index 0000000..ee5f354 --- /dev/null +++ b/buildroot-overlay/package/display/display.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +includedir=${prefix}/include +libdir=${prefix}/lib + +Name: @PROJECT_NAME@ +Description: @PROJECT_DESCRIPTION@ +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -l@PROJECT_NAME@ +Libs.private: -ldrm +Cflags: -I${includedir} -I${includedir}/libdrm \ No newline at end of file diff --git a/buildroot-overlay/package/display/include/display.h b/buildroot-overlay/package/display/include/display.h new file mode 100644 index 0000000..d30cdb1 --- /dev/null +++ b/buildroot-overlay/package/display/include/display.h @@ -0,0 +1,76 @@ +#pragma once +#ifndef __DISPLAY_H__ +#define __DISPLAY_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_PROPS 128 +#define DISPLAY_QUEUE_DEPTH 3 + +struct display { + int fd; + uint32_t conn_id, enc_id, crtc_id, blob_id; + int crtc_idx; + uint32_t width, height; + uint32_t mmWidth, mmHeight; + drmModeModeInfo mode; + drmModeCrtcPtr crtc; + drmModePropertyPtr crtc_props[MAX_PROPS]; + uint32_t crtc_props_count; + drmModeConnectorPtr conn; + drmModePropertyPtr conn_props[MAX_PROPS]; + uint32_t conn_props_count; + drmModeAtomicReqPtr req; + uint32_t commitFlags; + drmEventContext drm_event_ctx; + struct display_plane* planes; +}; + +struct display_buffer { + struct display_buffer* next; + struct display_plane* plane; + uint32_t handle; + uint32_t stride, width, height; + uint32_t size; + int dmabuf_fd; + uint32_t id; + void* map; +}; + +struct display_plane { + struct display_plane* next; + struct display* display; + drmModePlanePtr plane; + drmModePropertyPtr props[MAX_PROPS]; + uint8_t props_count; + uint32_t plane_id; + unsigned int fourcc; + bool first; + struct display_buffer* buffers; +}; + +void display_exit(struct display* display); +struct display* display_init(unsigned device); +struct display_plane* display_get_plane(struct display* display, unsigned int fourcc); +void display_free_plane(struct display_plane* plane); +struct display_buffer* display_allocate_buffer(struct display_plane* plane, uint32_t width, uint32_t height); +void display_free_plane(struct display_plane* plane); +void display_free_buffer(struct display_buffer* buffer); +int display_commit_buffer(const struct display_buffer* buffer, uint32_t x, uint32_t y); +int display_update_buffer(struct display_buffer* buffer, uint32_t x, uint32_t y); +int display_commit(struct display* display); +void display_wait_vsync(struct display* display); +void display_handle_vsync(struct display* display); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/buildroot-overlay/package/display/include/pipeline.hpp b/buildroot-overlay/package/display/include/pipeline.hpp new file mode 100644 index 0000000..b06a62c --- /dev/null +++ b/buildroot-overlay/package/display/include/pipeline.hpp @@ -0,0 +1,436 @@ +#pragma once +#include +#ifndef __DISPLAY_HPP__ +#define __DISPLAY_HPP__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "display.h" +#include +#include +#include + +// base on DMA-BUF +namespace pipeline { + class Pipeline; + + // FIXME: seperate source | sink + class Endpoint { + public: + virtual bool set_buffer_num(unsigned channel, unsigned num) = 0; + // return false if not support + virtual bool import_buffer(unsigned channel, int fd, unsigned index, unsigned size) { return false; }; + // return -1 if not support export + virtual int export_buffer(unsigned channel, unsigned index, unsigned& size) { return -1; }; + // buffer input callback + virtual bool buffer_in(unsigned channel, unsigned index) = 0; + // return -1 if no buffer to output + virtual int buffer_out(unsigned channel) = 0; + virtual bool start() { /* do nothing */ return true; } + virtual void stop() {} + virtual int fd_to_select() = 0; + }; + + class Pipeline { + class SourceInfo { + public: + std::vector> sinks; + std::vector bufferHold; + }; + public: + std::map forward; + std::map> backword; + std::map fdMap; + int maxFds; + fd_set fds; + std::atomic running; + + Pipeline(): maxFds(0), running(false) { + FD_ZERO(&fds); + } + ~Pipeline() {} + + void stop() { + for (auto [_, ep]: fdMap) { + ep->stop(); + } + running.store(false); + } + + int run() { + running.store(true); + for (auto [_, ep]: fdMap) { + ep->start(); + } + while (running.load()) { + fd_set rfds = fds; + struct timeval tv = { + .tv_sec = 0, + .tv_usec = 100 + }; + int ret = select(maxFds + 1, &rfds, NULL, NULL, &tv); + if (ret > 0) { + // handle + for (auto [fd, ep]: fdMap) { + if (FD_ISSET(fd, &rfds)) { + // check source or sink + auto iter = backword.find(ep); + if (iter == backword.end()) { + // ep is source + auto info = forward[ep]; + // dequeue buffer, source only support 1 channel + auto index = ep->buffer_out(0); + if (index < 0) { + continue; + } + info.bufferHold[index] = 0; + for (auto [sink, channel]: info.sinks) { + if (sink->buffer_in(index, channel)) { + // drop + info.bufferHold[index] += 1; + } + } + if (info.bufferHold[index] == 0) { + // no sink use, queue buffer back + ep->buffer_in(index, 0); + } + } else { + // ep is sink + auto sources = iter->second; + auto channels = sources.size(); + for (unsigned channel = 0; channel < channels; channel++) { + auto index = ep->buffer_out(channel); + if (index < 0) { + continue; + } + auto source = sources[channel]; + auto info = forward[source]; + info.bufferHold[index] -= 1; + if (info.bufferHold[index] == 0) { + source->buffer_in(index, 0); + } + } + } + } + } + } else if (ret == 0) { + // timeout + continue; + } else { + if (errno == EINTR) { + continue; + } + // error + return errno; + } + } + return 0; + } + + bool link(Endpoint& source, Endpoint& sink, unsigned bufferNum=5) { + auto sinkInfo = backword[&sink]; + auto channel = sinkInfo.size(); + sinkInfo.push_back(&source); + auto info = forward[&source]; + info.sinks.push_back({&sink, channel}); + maxFds = std::max(source.fd_to_select(), std::max(sink.fd_to_select(), maxFds)); + FD_SET(source.fd_to_select(), &fds); + FD_SET(sink.fd_to_select(), &fds); + fdMap[source.fd_to_select()] = &source; + fdMap[sink.fd_to_select()] = &sink; + // setup buffer + if (!source.set_buffer_num(0, bufferNum)) { + return false; + } + if (!sink.set_buffer_num(channel, bufferNum)) { + return false; + } + // export buffer from sink + unsigned size; + bool exportFromSink = true; + for (unsigned i = 0; i < bufferNum; i++) { + int fd = sink.export_buffer(channel, i, size); + if (fd < 0) { + exportFromSink = false; + break; + } + if (!source.import_buffer(0, fd, i, size)) { + // error + return false; + } + } + if (!exportFromSink) { + // export from source + for (unsigned i = 0; i < bufferNum; i++) { + if (!source.export_buffer(channel, i, size)) { + // no buffer, error + return false; + } + } + } + return true; + } + }; + + class Vicap: public Endpoint { + public: + int fd; + unsigned size; + Vicap(int fd): fd(fd), size(0) {} + ~Vicap() { + if (fd >= 0) + close(fd); + } + + static std::optional create(unsigned device, unsigned width, unsigned height, uint32_t fourcc) { + char filepath[128]; + snprintf(filepath, sizeof(filepath), "/dev/video%u", device); + struct v4l2_capability capbility; + int fd = open(filepath, O_RDWR); + if (fd < 0) { + return {}; + }; + if (ioctl(fd, VIDIOC_QUERYCAP, &capbility)) { + close(fd); + return {}; + } + struct v4l2_fmtdesc fmtdesc; + memset(&fmtdesc, 0, sizeof(fmtdesc)); + fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + while (ioctl(fd, VIDIOC_ENUM_FMT, &fmtdesc) == 0) { + printf( + "/dev/video%u support format %c%c%c%c", + device, + (fmtdesc.pixelformat >> 0) & 0xff, + (fmtdesc.pixelformat >> 8) & 0xff, + (fmtdesc.pixelformat >> 16) & 0xff, + (fmtdesc.pixelformat >> 24) & 0xff + ); + fmtdesc.index += 1; + } + struct v4l2_format format; + format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + if (ioctl(fd, VIDIOC_G_FMT, &format)) { + close(fd); + return {}; + } + format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + format.fmt.pix.pixelformat = fourcc; + format.fmt.pix.width = width; + format.fmt.pix.height = height; + if (ioctl(fd, VIDIOC_S_FMT, &format)) { + close(fd); + return {}; + } + return Vicap(fd); + } + + bool start() { + int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + if (ioctl(fd, VIDIOC_STREAMON, &type)) { + return false; + } + return true; + } + + void stop() { + int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + ioctl(fd, VIDIOC_STREAMOFF, &type); + } + + bool import_buffer(unsigned channel, int fd, unsigned index, unsigned size) { + // QBUF + struct v4l2_buffer buffer; + memset(&buffer, 0, sizeof(buffer)); + buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + buffer.memory = V4L2_MEMORY_DMABUF; + buffer.index = index; + buffer.m.fd = fd; + buffer.length = size; + if (ioctl(fd, VIDIOC_QBUF, &buffer)) { + return false; + } + return true; + } + + bool set_buffer_num(unsigned channel, unsigned num) { + struct v4l2_requestbuffers request_buffer; + memset(&request_buffer, 0, sizeof(request_buffer)); + request_buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + request_buffer.memory = V4L2_MEMORY_DMABUF; + request_buffer.count = num; + if (ioctl(fd, VIDIOC_REQBUFS, &request_buffer)) { + return false; + } + return true; + } + + int buffer_out(unsigned channel) { + // DQBUF + struct v4l2_buffer buffer; + memset(&buffer, 0, sizeof(buffer)); + buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + buffer.memory = V4L2_MEMORY_DMABUF; + if (ioctl(fd, VIDIOC_DQBUF, &buffer)) { + // TODO: warning + return -1; + } + return buffer.index; + } + + bool buffer_in(unsigned channel, unsigned index) { + // QBUF + struct v4l2_buffer buffer; + memset(&buffer, 0, sizeof(buffer)); + buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + buffer.memory = V4L2_MEMORY_DMABUF; + buffer.index = index; + if (ioctl(fd, VIDIOC_QBUF, &buffer)) { + // warning + return false; + } + return true; + } + + int fd_to_select() { + return fd; + } + }; + + class Display: public Endpoint { + class Plane { + public: + struct display_plane* plane; + std::vector buffers; + unsigned width; + unsigned height; + unsigned x; + unsigned y; + int queue[3]; + unsigned wp; + bool updated; + + Plane(struct display_plane* plane, unsigned width, unsigned height, unsigned x, unsigned y): + wp(0), plane(plane), width(width), height(height), updated(false), x(x), y(y) + { + for (unsigned i = 0; i < 3; i++) { + queue[i] = -1; + } + } + + bool input(unsigned index) { + if (updated) { + return false; + } + queue[wp] = index; + return true; + } + + int output() { + if (updated) { + updated = false; + auto b = buffers[queue[wp]]; + display_update_buffer(b, x, y); + wp = (wp + 1) % sizeof(queue); + return queue[wp]; + } else { + // no new frame, no output + return -1; + } + } + }; + public: + struct display* d; + std::vector planes; + + Display(struct display* d): d(d) { + printf("construct display fd: %d\n", this->d->fd); + } + ~Display() { + display_exit(d); + } + + bool createChannel(unsigned width, unsigned height, uint32_t fourcc) { + printf("fd: %d\n", d->fd); + auto p = display_get_plane(d, fourcc); + if (p == nullptr) { + return false; + } + planes.emplace_back(p, width, height, 0, 0); + return true; + } + + static std::optional create(unsigned device=0) { + auto d = display_init(device); + if (d == nullptr) { + return {}; + } + printf("fd: %d\n", d->fd); + return Display(d); + } + + bool start() { + // commit buffer trig event + return display_commit_buffer(planes[0].buffers[0], planes[0].x, planes[0].y) == 0; + } + + bool set_buffer_num(unsigned channel, unsigned num) { + auto plane = planes[channel]; + for (unsigned i = 0; i < num; i++) { + auto buffer = display_allocate_buffer(plane.plane, plane.width, plane.height); + if (buffer) { + plane.buffers.push_back(buffer); + } else { + for (auto b: plane.buffers) { + display_free_buffer(b); + } + plane.buffers.clear(); + return false; + } + } + return true; + } + + int export_buffer(unsigned channel, unsigned index, unsigned& size) { + auto plane = planes[channel]; + auto b = plane.buffers[index]; + size = b->size; + return b->dmabuf_fd; + } + + bool buffer_in(unsigned channel, unsigned index) { + auto plane = planes[channel]; + return plane.input(index); + } + + int buffer_out(unsigned channel) { + if (channel == 0) { + display_handle_vsync(d); + } + auto plane = planes[channel]; + int ret = plane.output(); + if (channel == planes.size() - 1) { + // the last channel + display_commit(d); + } + return ret; + } + + int fd_to_select() { + return this->d->fd; + } + }; +} + +#endif \ No newline at end of file diff --git a/buildroot-overlay/package/display/include/thead.h b/buildroot-overlay/package/display/include/thead.h new file mode 100644 index 0000000..5e65306 --- /dev/null +++ b/buildroot-overlay/package/display/include/thead.h @@ -0,0 +1,32 @@ +#ifndef _THEAD_H_ +#define _THEAD_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static inline void thead_csi_dcache_clean_invalid_range(void* addr, uint64_t size) { + uint64_t op_addr = (uint64_t)addr; + int64_t op_size = size + op_addr % 64; + const int64_t linesize = 64; + + __asm volatile("fence iorw, iorw"); + + while (op_size > 0) { + __asm volatile("dcache.civa %0" : : "r"(op_addr)); + op_addr += linesize; + op_size -= linesize; + } + + __asm volatile("fence iorw, iorw"); + __asm volatile("fence.i"); + __asm volatile("fence r, r"); +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/buildroot-overlay/package/display/src/display.c b/buildroot-overlay/package/display/src/display.c new file mode 100644 index 0000000..87a6a84 --- /dev/null +++ b/buildroot-overlay/package/display/src/display.c @@ -0,0 +1,634 @@ +#include "display.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define pr(fmt,...) fprintf(stderr,"[display] "fmt"\n", ##__VA_ARGS__) +#define CKE(x,go) do{int e=(x);if(e){pr("[display] "#x" error %d(%s) at line %d",e,strerror(-e),__LINE__);goto go;}}while(0) + +static void page_flip_handler(int fd, unsigned int sequence, unsigned int tv_sec, + unsigned int tv_usec, void *user_data) { + // do nothing +} + +void display_exit(struct display* display) { + struct display_plane* p = display->planes; + while (p != NULL) { + display_free_plane(p); + p = display->planes; + } + close(display->fd); + free(display); +} + +struct display* display_init(unsigned device) { + struct display* display; + int flags; + uint64_t has_dumb; + char filename[64]; + unsigned i; + drmModeRes *res; + drmModeConnector *conn = NULL; + drmModeEncoder *enc = NULL; + + display = malloc(sizeof(*display)); + display->planes = NULL; + display->commitFlags = 0; + display->req = NULL; + + snprintf(filename, sizeof(filename), "/dev/dri/card%u", device); + display->fd = open(filename, O_RDWR | O_CLOEXEC); + if (display->fd < 0) { + perror("open /dev/dri/card error"); + free(display); + return NULL; + } + if ((flags = fcntl(display->fd, F_GETFD)) < 0 || fcntl(display->fd, F_SETFD, flags | FD_CLOEXEC) < 0) { + perror("fcntl FD_CLOEXEC error"); + goto close; + } + CKE(drmGetCap(display->fd, DRM_CAP_DUMB_BUFFER, &has_dumb), close); + CKE(has_dumb == 0, close); + CKE(drmSetClientCap(display->fd, DRM_CLIENT_CAP_ATOMIC, 1), close); + + // find connector + CKE((res = drmModeGetResources(display->fd)) == NULL, close); + CKE(res->count_crtcs <= 0, free_res); + for (i = 0; i < res->count_connectors; i++) { + conn = drmModeGetConnector(display->fd, res->connectors[i]); + if (!conn) { + continue; + } + + if (conn->connection == DRM_MODE_CONNECTED) { + // pr("connector %d: connected", conn->connector_id); + } else if (conn->connection == DRM_MODE_DISCONNECTED) { + // pr("connector %d: disconnected", conn->connector_id); + } else if (conn->connection == DRM_MODE_UNKNOWNCONNECTION) { + // pr("connector %d: unknownconnection", conn->connector_id); + } else { + // pr("connector %d: unknown", conn->connector_id); + } + + if (conn->connection == DRM_MODE_CONNECTED && conn->count_modes > 0) { + display->conn = conn; + break; + } + + drmModeFreeConnector(conn); + conn = NULL; + } + CKE(conn == NULL, free_res); + display->conn_id = conn->connector_id; + display->mmWidth = conn->mmWidth; + display->mmHeight = conn->mmHeight; + memcpy(&display->mode, conn->modes, sizeof(display->mode)); + + CKE(drmModeCreatePropertyBlob(display->fd, &display->mode, sizeof(display->mode), &display->blob_id), free_con); + + // find encoder + for (i = 0 ; i < res->count_encoders; i++) { + enc = drmModeGetEncoder(display->fd, res->encoders[i]); + if (!enc) + continue; + + // pr("enc %u enc_id %d conn enc_id %d", i, enc->encoder_id, conn->encoder_id); + + if (enc->encoder_id == conn->encoder_id) + break; + + drmModeFreeEncoder(enc); + enc = NULL; + } + if (enc) { + display->enc_id = enc->encoder_id; + display->crtc_id = enc->crtc_id; + drmModeFreeEncoder(enc); + } else { + /* Encoder hasn't been associated yet, look it up */ + for (i = 0; i < conn->count_encoders; i++) { + int crtc, crtc_id = -1; + + enc = drmModeGetEncoder(display->fd, conn->encoders[i]); + if (!enc) + continue; + + for (crtc = 0 ; crtc < res->count_crtcs; crtc++) { + uint32_t crtc_mask = 1 << crtc; + + crtc_id = res->crtcs[crtc]; + + pr("enc_id %d crtc%d id %d mask %x possible %x", enc->encoder_id, crtc, crtc_id, crtc_mask, enc->possible_crtcs); + + if (enc->possible_crtcs & crtc_mask) + break; + } + + if (crtc_id > 0) { + display->enc_id = enc->encoder_id; + pr("enc_id: %d", display->enc_id); + display->crtc_id = crtc_id; + pr("crtc_id: %d", display->crtc_id); + break; + } + + drmModeFreeEncoder(enc); + enc = NULL; + } + + if (!enc) { + pr("no suitable encoder"); + goto free_con; + } + + drmModeFreeEncoder(enc); + } + + // pr("crtc: %u, conn: %u", display->crtc_id, display->conn_id); + + display->crtc_idx = -1; + for (i = 0; i < res->count_crtcs; ++i) { + if (display->crtc_id == res->crtcs[i]) { + display->crtc_idx = i; + break; + } + } + + if (display->crtc_idx == -1) { + pr("CRTC not found"); + goto free_con; + } + + display->width = display->mode.hdisplay; + display->height = display->mode.vdisplay; + + display->crtc = drmModeGetCrtc(display->fd, display->crtc_id); + if (!display->crtc) { + pr("drmModeGetCrtc %u failed", display->crtc_id); + goto free_con; + } + + // get props + drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(display->fd, display->crtc_id, DRM_MODE_OBJECT_CRTC); + CKE(props == NULL, free_con); + for (i = 0; (i < props->count_props) && (i < MAX_PROPS); i++) { + display->crtc_props[i] = drmModeGetProperty(display->fd, props->props[i]); + // pr("Added crtc prop %u:%s", display->crtc_props[i]->prop_id, display->crtc_props[i]->name); + } + display->crtc_props_count = props->count_props; + drmModeFreeObjectProperties(props); + props = drmModeObjectGetProperties(display->fd, display->conn_id, DRM_MODE_OBJECT_CONNECTOR); + CKE(props == NULL, free_con); + for (i = 0; (i < props->count_props) && (i < MAX_PROPS); i++) { + display->conn_props[i] = drmModeGetProperty(display->fd, props->props[i]); + // pr("Added conn prop %u:%s", display->conn_props[i]->prop_id, display->conn_props[i]->name); + } + display->conn_props_count = props->count_props; + drmModeFreeObjectProperties(props); + + display->drm_event_ctx.version = DRM_EVENT_CONTEXT_VERSION; + display->drm_event_ctx.page_flip_handler = page_flip_handler; + + return display; + +free_con: + drmModeFreeConnector(conn); +free_res: + drmModeFreeResources(res); +close: + close(display->fd); + free(display); + return NULL; +} + +static bool check_plane_in_use(const struct display* display, uint32_t plane_id) { + struct display_plane* plane = display->planes; + while (plane != NULL) { + if (plane->plane_id == plane_id) { + return true; + } + plane = plane->next; + } + return false; +} + +void display_free_plane(struct display_plane* plane) { + struct display* d = plane->display; + struct display_plane* p = d->planes; + if (p == plane) { + d->planes = plane->next; + } else { + while (p != NULL) { + if (p->next == plane) { + p->next = plane->next; + } + } + } + // also free buffer + struct display_buffer* b = plane->buffers; + while (b != NULL) { + display_free_buffer(b); + b = plane->buffers; + } + free(plane); +} + +struct display_plane* display_get_plane(struct display* display, unsigned int fourcc) { + drmModePlaneResPtr planes; + drmModePlanePtr plane; + unsigned i, j; + + planes = drmModeGetPlaneResources(display->fd); + if (!planes) { + pr("drmModeGetPlaneResources error"); + return NULL; + } + // pr("find %u planes", planes->count_planes); + for (i = 0; i < planes->count_planes; i++) { + plane = drmModeGetPlane(display->fd, planes->planes[i]); + if (!plane) { + pr("drmModeGetPlane error"); + break; + } + if (check_plane_in_use(display, plane->plane_id)) { + continue; + } + if (!(plane->possible_crtcs & (1 << display->crtc_idx))) { + drmModeFreePlane(plane); + continue; + } + for (j = 0; j < plane->count_formats; j++) { + // pr("plane %u format %c%c%c%c", plane->plane_id, + // (plane->formats[j] >> 0) & 0xff, + // (plane->formats[j] >> 8) & 0xff, + // (plane->formats[j] >> 16) & 0xff, + // (plane->formats[j] >> 24) & 0xff + // ); + if (plane->formats[j] == fourcc) { + goto found_plane; + } + } + drmModeFreePlane(plane); + plane = NULL; + } + drmModeFreePlaneResources(planes); + pr("No suitable plane for %c%c%c%c", (fourcc >> 0) & 0xff, (fourcc >> 8) & 0xff, (fourcc >> 16) & 0xff, (fourcc >> 24) & 0xff); + return NULL; + +found_plane: + drmModeFreePlaneResources(planes); + + // get props + drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(display->fd, plane->plane_id, DRM_MODE_OBJECT_PLANE); + if (props == NULL) { + pr("get plane props failed"); + drmModeFreePlane(plane); + return NULL; + } + struct display_plane* display_plane = malloc(sizeof(struct display_plane)); + display_plane->next = NULL; + for (i = 0; i < props->count_props; i++) { + display_plane->props[i] = drmModeGetProperty(display->fd, props->props[i]); + // pr("Added plane prop %u:%s", display_plane->props[i]->prop_id, display_plane->props[i]->name); + } + display_plane->props_count = props->count_props; + drmModeFreeObjectProperties(props); + + display_plane->display = display; + display_plane->fourcc = fourcc; + display_plane->plane_id = plane->plane_id; + display_plane->plane = plane; + display_plane->buffers = NULL; + display_plane->next = display->planes; + display->planes = display_plane; + display_plane->first = true; + + return display_plane; +} + +#define ALIGN_UP(x,a) ((x+a-1)/a*a) + +struct display_buffer* display_allocate_buffer(struct display_plane* plane, uint32_t width, uint32_t height) { + struct drm_mode_create_dumb creq; + struct drm_mode_map_dumb mreq; + struct drm_prime_handle prime; + struct drm_mode_destroy_dumb destroy; + uint32_t handles[4] = {0, 0, 0, 0}, pitches[4] = {0, 0, 0, 0}, offsets[4] = {0, 0, 0, 0}; + void* map; + const struct display* display = plane->display; + memset(&creq, 0, sizeof(creq)); + creq.width = width; + creq.height = height; + switch (plane->fourcc) { + case DRM_FORMAT_NV12: + case DRM_FORMAT_NV21: + creq.bpp = 8; + creq.height = creq.height * 3 / 2; + break; + case DRM_FORMAT_BGR888: + case DRM_FORMAT_RGB888: + creq.bpp = 24; + break; + case DRM_FORMAT_ARGB8888: + case DRM_FORMAT_ABGR8888: + case DRM_FORMAT_RGBA8888: + case DRM_FORMAT_BGRA8888: + creq.bpp = 32; + break; + default: + pr("Unknown plane format fourcc %08x", plane->fourcc); + return NULL; + } + CKE(drmIoctl(display->fd, DRM_IOCTL_MODE_CREATE_DUMB, &creq), error); + // pr("create dumb handle(%u) pitch(%u) size(%llu)", creq.handle, creq.pitch, creq.size); + + // get dmabuf fd + memset(&prime, 0, sizeof prime); + prime.handle = creq.handle; + CKE(ioctl(display->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &prime), free_dumb); + + // mmap buffer + memset(&mreq, 0, sizeof(mreq)); + mreq.handle = creq.handle; + CKE(drmIoctl(display->fd, DRM_IOCTL_MODE_MAP_DUMB, &mreq), free_dumb); + map = mmap(NULL, creq.size, PROT_READ | PROT_WRITE, MAP_SHARED, display->fd, mreq.offset); + if (map == MAP_FAILED) { + pr("mmap dumb buffer failed: %s", strerror(errno)); + goto free_dumb; + } + + // add dumb + memset(map, 0, creq.size); + handles[0] = creq.handle; + pitches[0] = creq.pitch; + offsets[0] = 0; + if ((plane->fourcc == DRM_FORMAT_NV12) || (plane->fourcc == DRM_FORMAT_NV21)) { + handles[1] = creq.handle; + pitches[1] = pitches[0]; + offsets[1] = pitches[0] * height; + } + struct display_buffer* buffer = malloc(sizeof(struct display_buffer)); + CKE(drmModeAddFB2(display->fd, width, height, plane->fourcc, handles, pitches, offsets, &buffer->id, 0), munmap); + buffer->handle = creq.handle; + buffer->stride = creq.pitch; + buffer->width = creq.width; + buffer->height = height; + buffer->size = creq.size; + buffer->dmabuf_fd = prime.fd; + buffer->map = map; + buffer->plane = plane; + buffer->next = plane->buffers; + plane->buffers = buffer; + + return buffer; + +munmap: + free(buffer); + munmap(map, creq.size); +free_dumb: + memset(&destroy, 0, sizeof(destroy)); + destroy.handle = creq.handle; + drmIoctl(display->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy); +error: + return NULL; +} + +void display_free_buffer(struct display_buffer* buffer) { + if (buffer == NULL) + return; + + struct display_plane* p = buffer->plane; + struct display* d = p->display; + struct drm_mode_destroy_dumb destroy; + + munmap(buffer->map, buffer->size); + memset(&destroy, 0, sizeof(destroy)); + destroy.handle = buffer->handle; + drmIoctl(d->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy); + + // remove from list + struct display_buffer* b = p->buffers; + if (b == buffer) { + p->buffers = b->next; + } else { + while (b != NULL) { + if (b->next == buffer) { + b->next = buffer->next; + break; + } + b = b->next; + } + } + + free(buffer); +} + +static uint32_t get_plane_property_id(const struct display_plane* plane, const char* name) { + for (unsigned i = 0; i < plane->props_count; i++) { + if (strcmp(name, plane->props[i]->name) == 0) { + return plane->props[i]->prop_id; + } + } + pr("plane prop %s not found", name); + return 0xDEADDEAD; +} + +static uint32_t get_crtc_property_id(const struct display* display, const char* name) { + for (unsigned i = 0; i < display->crtc_props_count; i++) { + if (strcmp(name, display->crtc_props[i]->name) == 0) { + return display->crtc_props[i]->prop_id; + } + } + pr("crtc prop %s not found", name); + return 0xDEADDEAD; +} + +static uint32_t get_conn_property_id(const struct display* display, const char* name) { + for (unsigned i = 0; i < display->conn_props_count; i++) { + if (strcmp(name, display->conn_props[i]->name) == 0) { + return display->conn_props[i]->prop_id; + } + } + pr("conn prop %s not found", name); + return 0xDEADDEAD; +} + +static int drm_add_plane_property(const struct display_plane* plane, drmModeAtomicReqPtr req, const char *name, uint64_t value) +{ + int ret; + uint32_t prop_id = get_plane_property_id(plane, name); + + if (prop_id == 0xDEADDEAD) { + return -1; + } + + ret = drmModeAtomicAddProperty(req, plane->plane_id, prop_id, value); + if (ret < 0) { + pr("drmModeAtomicAddProperty (%s,%lu) failed: %d(%s)", name, value, ret, strerror(errno)); + return ret; + } + + return 0; +} + +static int drm_add_crtc_property(const struct display* display, drmModeAtomicReqPtr req, const char *name, uint64_t value) +{ + int ret; + uint32_t prop_id = get_crtc_property_id(display, name); + + if (prop_id == 0xDEADDEAD) { + return -1; + } + + ret = drmModeAtomicAddProperty(req, display->crtc_id, prop_id, value); + if (ret < 0) { + pr("drmModeAtomicAddProperty (%s,%lu) failed: %d(%s)", name, value, ret, strerror(errno)); + return ret; + } + + return 0; +} + +static int drm_add_conn_property(const struct display* display, drmModeAtomicReqPtr req, const char *name, uint64_t value) +{ + int ret; + uint32_t prop_id = get_conn_property_id(display, name); + + if (prop_id == 0xDEADDEAD) { + return -1; + } + + ret = drmModeAtomicAddProperty(req, display->conn_id, prop_id, value); + if (ret < 0) { + pr("drmModeAtomicAddProperty (%s,%lu) failed: %d(%s)", name, value, ret, strerror(errno)); + return ret; + } + + return 0; +} + +int display_update_buffer(struct display_buffer* buffer, uint32_t x, uint32_t y) { + struct display_plane* plane = buffer->plane; + struct display* display = plane->display; + display->commitFlags |= DRM_MODE_PAGE_FLIP_EVENT; + + if (display->req == NULL) { + display->req = drmModeAtomicAlloc(); + } + if (plane->first) { + drm_add_conn_property(display, display->req, "CRTC_ID", display->crtc_id); + + drm_add_crtc_property(display, display->req, "MODE_ID", display->blob_id); + drm_add_crtc_property(display, display->req, "ACTIVE", 1); + + display->commitFlags |= DRM_MODE_ATOMIC_ALLOW_MODESET; + plane->first = false; + } + drm_add_plane_property(plane, display->req, "FB_ID", buffer->id); + drm_add_plane_property(plane, display->req, "CRTC_ID", display->crtc_id); + drm_add_plane_property(plane, display->req, "SRC_X", 0); + drm_add_plane_property(plane, display->req, "SRC_Y", 0); + drm_add_plane_property(plane, display->req, "SRC_W", buffer->width << 16); + drm_add_plane_property(plane, display->req, "SRC_H", buffer->height << 16); + drm_add_plane_property(plane, display->req, "CRTC_X", x); + drm_add_plane_property(plane, display->req, "CRTC_Y", y); + drm_add_plane_property(plane, display->req, "CRTC_W", buffer->width); + drm_add_plane_property(plane, display->req, "CRTC_H", buffer->height); + + return 0; +} + +int display_commit(struct display* display) { + int ret; + if (display->req == NULL) { + display->req = drmModeAtomicAlloc(); + } + ret = drmModeAtomicCommit(display->fd, display->req, display->commitFlags, NULL); + display->commitFlags = DRM_MODE_PAGE_FLIP_EVENT; + if (ret) { + drmModeAtomicFree(display->req); + display->req = NULL; + return -1; + } + return 0; +} + +int display_commit_buffer(const struct display_buffer* buffer, uint32_t x, uint32_t y) { + uint32_t flags = DRM_MODE_PAGE_FLIP_EVENT; + struct display_plane* plane = buffer->plane; + struct display* display = plane->display; + drmModeAtomicReqPtr req = drmModeAtomicAlloc(); + display->req = req; + + if (plane->first) { + drm_add_conn_property(display, req, "CRTC_ID", display->crtc_id); + + drm_add_crtc_property(display, req, "MODE_ID", display->blob_id); + drm_add_crtc_property(display, req, "ACTIVE", 1); + + flags |= DRM_MODE_ATOMIC_ALLOW_MODESET; + plane->first = false; + } + drm_add_plane_property(plane, req, "FB_ID", buffer->id); + drm_add_plane_property(plane, req, "CRTC_ID", display->crtc_id); + drm_add_plane_property(plane, req, "SRC_X", 0); + drm_add_plane_property(plane, req, "SRC_Y", 0); + drm_add_plane_property(plane, req, "SRC_W", buffer->width << 16); + drm_add_plane_property(plane, req, "SRC_H", buffer->height << 16); + drm_add_plane_property(plane, req, "CRTC_X", x); + drm_add_plane_property(plane, req, "CRTC_Y", y); + drm_add_plane_property(plane, req, "CRTC_W", buffer->width); + drm_add_plane_property(plane, req, "CRTC_H", buffer->height); + + CKE(drmModeAtomicCommit(display->fd, req, flags, NULL), error); + + return 0; + +error: + drmModeAtomicFree(req); + return -1; +} + +// not recomand, select display fd instead +void display_wait_vsync(struct display* display) { + int ret; + fd_set fds; + + if (display->req) { + FD_ZERO(&fds); + FD_SET(display->fd, &fds); + + do { + ret = select(display->fd + 1, &fds, NULL, NULL, NULL); + } while (ret == -1 && errno == EINTR); + + if (ret < 0) { + pr("%s:select failed: %s",__func__,strerror(errno)); + drmModeAtomicFree(display->req); + display->req = NULL; + return; + } + + if (FD_ISSET(display->fd, &fds)) { + drmHandleEvent(display->fd, &display->drm_event_ctx); + } + + drmModeAtomicFree(display->req); + display->req = NULL; + } +} + +void display_handle_vsync(struct display* display) { + drmHandleEvent(display->fd, &display->drm_event_ctx); + drmModeAtomicFree(display->req); + display->req = NULL; +} diff --git a/buildroot-overlay/package/display/src/pipeline.cpp b/buildroot-overlay/package/display/src/pipeline.cpp new file mode 100644 index 0000000..2069174 --- /dev/null +++ b/buildroot-overlay/package/display/src/pipeline.cpp @@ -0,0 +1,2 @@ +#include "pipeline.hpp" + diff --git a/buildroot-overlay/package/display/src/test.cpp b/buildroot-overlay/package/display/src/test.cpp new file mode 100644 index 0000000..c55b9f1 --- /dev/null +++ b/buildroot-overlay/package/display/src/test.cpp @@ -0,0 +1,32 @@ +#include +#include +#include +#include + +using namespace pipeline; + +int main(void) { + unsigned width = 480; + unsigned height = 320; + auto display = Display::create(); + if (display) { + printf("fd: %d\n", display->fd_to_select()); + return 0; + } + /* + if (auto display = Display::create()) { + printf("fd: %d\n", display->fd_to_select()); + if (!display->createChannel(width, height, DRM_FORMAT_NV12)) { + std::cerr << "create display channel error" << std::endl; + return -1; + } + if (auto vicap = Vicap::create(1, width, height, V4L2_PIX_FMT_NV12)) { + auto pipe = Pipeline(); + if (!pipe.link(vicap.value(), display.value())) { + std::cerr << "link error" << std::endl; + return -1; + } + pipe.run(); + } + }*/ +} diff --git a/buildroot-overlay/package/face_detect/CMakeLists.txt b/buildroot-overlay/package/face_detect/CMakeLists.txt new file mode 100644 index 0000000..b4f8ca8 --- /dev/null +++ b/buildroot-overlay/package/face_detect/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.5) + +set(CMAKE_CXX_STANDARD 17) + +project(face_detect) + +add_definitions(-mcpu=c908) +#add_definitions(-fsanitize=address) +#add_link_options(-fsanitize=address -static-libasan) + +find_package(nncaseruntime REQUIRED) +#find_package(nncase_rt_modules_k230 REQUIRED) +#find_package(gsl-lite REQUIRED) +find_package(OpenCV) + +#message(nncaseruntime_LIBS=${nncaseruntime_LIBS} ${nncaseruntime_INCLUDE_DIRS}) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +if(${OpenCV_FOUND}) + +include(FindPkgConfig) +find_package(PkgConfig REQUIRED) +pkg_check_modules(DISPLAY REQUIRED display) +pkg_check_modules(V4L2DRM REQUIRED v4l2-drm) + +include_directories(${OpenCV_INCLUDE_DIRS} ${DISPLAY_INCLUDE_DIRS} ${V4L2DRM_INCLUDE_DIRS}) +add_executable(${PROJECT_NAME}.elf main_cv.cpp model.cc mobile_retinaface.cc anchors_320.cc util.cc) +target_link_libraries(${PROJECT_NAME}.elf ${OpenCV_LIBS} ${DISPLAY_LIBRARIES} ${V4L2DRM_LIBRARIES}) +install(PROGRAMS run_cv.sh DESTINATION /app/face_detect) + +else(${OpenCV_FOUND}) + +add_executable(${PROJECT_NAME}.elf main.cc model.cc mobile_retinaface.cc anchors_320.cc util.cc) +install(PROGRAMS run.sh DESTINATION /app/face_detect) + +endif(${OpenCV_FOUND}) + +target_link_libraries(${PROJECT_NAME}.elf nncase.rt_modules.k230 nncaseruntime functional_k230 mmz pthread) +#target_link_libraries(${PROJECT_NAME}.elf nncaseruntime nncase_rt_modules_k230 mmz) + +install(TARGETS ${PROJECT_NAME}.elf DESTINATION /app/face_detect) +install(FILES face_detection_320.kmodel ai2d_input.bin DESTINATION /app/face_detect) diff --git a/buildroot-overlay/package/face_detect/Config.in b/buildroot-overlay/package/face_detect/Config.in index cc500dc..1362d46 100644 --- a/buildroot-overlay/package/face_detect/Config.in +++ b/buildroot-overlay/package/face_detect/Config.in @@ -1,4 +1,6 @@ config BR2_PACKAGE_FACE_DETECT bool "face detect demo" + select BR2_PACKAGE_DISPLAY + select BR2_PACKAGE_GSL_LITE help ai demo for retinaface diff --git a/buildroot-overlay/package/face_detect/Makefile b/buildroot-overlay/package/face_detect/Makefile deleted file mode 100644 index 7daf60a..0000000 --- a/buildroot-overlay/package/face_detect/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -CXX=/opt/toolchain/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V2.10.1/bin/riscv64-unknown-linux-gnu-g++ - -OBJ = main.cc model.cc mobile_retinaface.cc anchors_320.cc util.cc - -LIBDIR = -L ../libnncase/nncase/lib -L ../libmmz -LIBS = -l nncase.rt_modules.k230 -l Nncase.Runtime.Native -lfunctional_k230 -lmmz -lpthread -INCLUDE = -I ./ -I ../libnncase/nncase -I ../libnncase/nncase/include -I ../libmmz - -CXX_FLAG = -O2 -march=rv64imafdcv -mabi=lp64d -mcmodel=medany -std=c++17 -DLINUX_RUNTIME -Wno-multichar -Wno-unused-result - -all: - $(CXX) $(CXX_FLAG) $(INCLUDE) $(OBJ) -o face_detect.elf $(LIBDIR) $(LIBS) - -clean: - rm -f *.o *.elf diff --git a/buildroot-overlay/package/face_detect/face_detect.mk b/buildroot-overlay/package/face_detect/face_detect.mk index e6d82b2..f574656 100644 --- a/buildroot-overlay/package/face_detect/face_detect.mk +++ b/buildroot-overlay/package/face_detect/face_detect.mk @@ -1,18 +1,9 @@ FACE_DETECT_SITE = $(realpath $(TOPDIR))"/package/face_detect" FACE_DETECT_SITE_METHOD = local -FACE_DETECT_DEPENDENCIES += libmmz libnncase +FACE_DETECT_DEPENDENCIES += libmmz libnncase gsl-lite +ifeq ($(BR2_PACKAGE_OPENCV4),y) +FACE_DETECT_DEPENDENCIES += opencv4 display vvcam +endif -define FACE_DETECT_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CXX)" -C $(@D) -endef - -define FACE_DETECT_INSTALL_TARGET_CMDS - mkdir -p $(TARGET_DIR)/app/face_detect - $(INSTALL) -m 0755 $(@D)/face_detect.elf $(TARGET_DIR)/app/face_detect - $(INSTALL) -m 0755 $(@D)/ai2d_input.bin $(TARGET_DIR)/app/face_detect - $(INSTALL) -m 0755 $(@D)/face_detection_320.kmodel $(TARGET_DIR)/app/face_detect - $(INSTALL) -m 0755 $(@D)/run.sh $(TARGET_DIR)/app/face_detect -endef - -$(eval $(generic-package)) +$(eval $(cmake-package)) diff --git a/buildroot-overlay/package/face_detect/main.cc b/buildroot-overlay/package/face_detect/main.cc index a630c5b..7ff8a61 100755 --- a/buildroot-overlay/package/face_detect/main.cc +++ b/buildroot-overlay/package/face_detect/main.cc @@ -9,11 +9,7 @@ #include #include #include "mobile_retinaface.h" -#ifdef LINUX_RUNTIME #include "mmz.h" -#else -#include "mpi_sys_api.h" -#endif using namespace nncase; using namespace nncase::runtime; @@ -72,14 +68,6 @@ void ai_proc(const char *kmodel_file, const char *image_file) } } -void __attribute__((destructor)) cleanup() { - std::cout << "Cleaning up memory..." << std::endl; - shrink_memory_pool(); -#ifdef LINUX_RUNTIME - kd_mpi_mmz_deinit(); -#endif -} - int main(int argc, char *argv[]) { std::cout << "case " << argv[0] << " built at " << __DATE__ << " " << __TIME__ << std::endl; diff --git a/buildroot-overlay/package/face_detect/main_cv.cpp b/buildroot-overlay/package/face_detect/main_cv.cpp new file mode 100644 index 0000000..fbdeede --- /dev/null +++ b/buildroot-overlay/package/face_detect/main_cv.cpp @@ -0,0 +1,227 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "mobile_retinaface.h" +#include "mmz.h" +#include "util.h" +#include +#include +#include +#include +#include +#include + +using namespace nncase; +using namespace nncase::runtime; +using namespace nncase::runtime::detail; +using namespace std; + +#define img_channels 3 +#define img_rows 1080 +#define img_cols 1920 + +static mutex face_result_mutex; +static vector face_result; +static volatile unsigned kpu_frame_count = 0; + +atomic ai_stop(false); + +static void ai_proc(const char *kmodel_file, int video_device) +{ + // input data + size_t paddr = 0; + void *vaddr = nullptr; + face_result_mutex.lock(); + face_result_mutex.unlock(); + + auto cap = cv::VideoCapture(video_device); + if (!cap.isOpened()) { + cerr << "can't open video device" << endl; + return; + } + if (!cap.set(cv::CAP_PROP_FOURCC, cv::VideoWriter::fourcc('B', 'G', '3', 'P'))) { + cerr << "can't set video fourcc to BG3P" <> frame; + // run kpu + if (frame.empty()) { + cout << "no frame" << endl; + continue; + } + vector data(frame.data, frame.data + img_rows * img_cols * img_channels); + model.run(data); + auto result = model.get_result(); + + face_result_mutex.lock(); + face_result = result.boxes; + face_result_mutex.unlock(); + kpu_frame_count += 1; + +// cout << "Number of faces detected: " << result.boxes.size() << endl; +// // +// for (size_t i = 0; i < result.boxes.size(); i++) { +// auto box = result.boxes[i]; +// auto landmark = result.landmarks[i]; +// // +// cout << "Face " << i + 1 << ":" << endl; +// cout << " Bounding box: " +// << "(" << box.x1 << ", " << box.y1 << ") to " +// << "(" << box.x2 << ", " << box.y2 << ")" << endl; +// // +// cout << " Landmarks:" << endl; +// for (int j = 0; j < 5; j++) { +// cout << " Point " << j + 1 << ": " +// << "(" << landmark.points[2 * j] << ", " << landmark.points[2 * j + 1] << ")" << endl; +// } +// cout << endl; +// } +// // +// if (result.boxes.size() > 0) { +// cout << "----------------------------------------" << endl; +// idx++; +// idx %= 10; +// cout << "Processing count: " << idx << endl; +// } + } +} + +static struct display* display; +static struct timeval tv, tv2; + +int frame_handler(struct v4l2_drm_context *context, bool displayed) { + // FPS + static bool first_frame = true; + if (first_frame) { + face_result_mutex.unlock(); + first_frame = false; + } + static unsigned response = 0, display_frame_count = 0; + response += 1; + if (displayed) { + if (context[0].buffer_hold[context[0].wp] >= 0) { + // draw result on context[i].buffers[context[i].buffer_hold[context[i].wp]] + auto buffer = context[0].buffers[context[0].buffer_hold[context[0].wp]]; + auto m = cv::Mat(buffer->height, buffer->width, CV_8UC3, buffer->map); + face_result_mutex.lock(); + // cv::rectangle(m, cv::Point(16, 32), cv::Point(160, 180), cv::Scalar(0, 255, 0), 2); + for (auto& box: face_result) { + cv::rectangle( + m, + cv::Point(box.x1 * buffer->width / img_cols, box.y1 * buffer->height / img_rows), + cv::Point(box.x2 * buffer->width / img_cols, box.y2 * buffer->height / img_rows), + cv::Scalar(0, 255, 0), + 2 + ); + } + face_result_mutex.unlock(); + thead_csi_dcache_clean_invalid_range(buffer->map, buffer->size); + } + display_frame_count += 1; + } + gettimeofday(&tv2, NULL); + uint64_t duration = 1000000 * (tv2.tv_sec - tv.tv_sec) + tv2.tv_usec - tv.tv_usec; + if (duration >= 1000000) { + fprintf(stderr, " poll: %.2f, ", response * 1000000. / duration); + response = 0; + if (display) { + fprintf(stderr, "display: %.2f, ", display_frame_count * 1000000. / duration); + display_frame_count = 0; + } + fprintf(stderr, "cam: %.2f, ", context[0].frame_count * 1000000. / duration); + context[0].frame_count = 0; + fprintf(stderr, "KPU: %.2f", kpu_frame_count * 1000000. / duration); + kpu_frame_count = 0; + fprintf(stderr, " \r"); + fflush(stderr); + gettimeofday(&tv, NULL); + } + // key + char c; + ssize_t n = read(STDIN_FILENO, &c, 1); + if ((n > 0) && (c != '\n')) { + return c; + } + if ((n < 0) && (errno != EAGAIN)) { + return -1; + } + return 0; +} + +static void display_proc(int video_device) { + struct v4l2_drm_context context; + int flag = fcntl(STDIN_FILENO, F_GETFL); + flag |= O_NONBLOCK; + if (fcntl(STDIN_FILENO, F_SETFL, flag)) { + cerr << "can't set stdin non-block" << endl; + return; + } + v4l2_drm_default_context(&context); + context.device = 1; + context.width = 480; + context.height = 320; + context.video_format = V4L2_PIX_FMT_BGR24; + context.display_format = 0; // auto + if (v4l2_drm_setup(&context, 1, &display)) { + cerr << "v4l2_drm_setup error" << endl; + return; + } + gettimeofday(&tv, NULL); + v4l2_drm_run(&context, 1, frame_handler); + if (display) { + display_exit(display); + } + ai_stop.store(true); + return; +} + +void __attribute__((destructor)) cleanup() { + std::cout << "Cleaning up memory..." << std::endl; + shrink_memory_pool(); + kd_mpi_mmz_deinit(); +} + +int main(int argc, char *argv[]) +{ + cout << "case " << argv[0] << " built at " << __DATE__ << " " << __TIME__ << endl; + if (argc != 2) + { + cerr << "Usage: " << argv[0] << " #include "model.h" #include "util.h" +#include +#include "mmz.h" Model::Model(const char *model_name, const char *kmodel_file): model_name_(model_name) { @@ -20,10 +22,7 @@ Model::Model(const char *model_name, const char *kmodel_file): model_name_(model } } -Model::~Model() -{ - -} +Model::~Model() {} void Model::run(std::vector &data) { @@ -58,7 +57,6 @@ void Model::input_tensor(size_t idx, runtime_tensor &tensor) runtime_tensor Model::output_tensor(size_t idx) { - printf("output tensor idx: %d\n", idx); return interp_.output_tensor(idx).expect("cannot get output tensor"); } diff --git a/buildroot-overlay/package/face_detect/run.sh b/buildroot-overlay/package/face_detect/run.sh old mode 100644 new mode 100755 diff --git a/buildroot-overlay/package/face_detect/run_cv.sh b/buildroot-overlay/package/face_detect/run_cv.sh new file mode 100755 index 0000000..227a731 --- /dev/null +++ b/buildroot-overlay/package/face_detect/run_cv.sh @@ -0,0 +1 @@ +./face_detect.elf face_detection_320.kmodel ai2d_input.bin diff --git a/buildroot-overlay/package/gsl-lite/Config.in b/buildroot-overlay/package/gsl-lite/Config.in new file mode 100644 index 0000000..8c99e2e --- /dev/null +++ b/buildroot-overlay/package/gsl-lite/Config.in @@ -0,0 +1,2 @@ +config BR2_PACKAGE_GSL_LITE + bool "gsl-lite is an implementation of the C++ Core Guidelines Support Library originally based on Microsoft GSL." diff --git a/buildroot-overlay/package/gsl-lite/gsl-lite.hash b/buildroot-overlay/package/gsl-lite/gsl-lite.hash new file mode 100644 index 0000000..c427f08 --- /dev/null +++ b/buildroot-overlay/package/gsl-lite/gsl-lite.hash @@ -0,0 +1 @@ +sha256 4682d8a60260321b92555760be3b9caab60e2a71f95eddbdfb91e557ee93302a v0.41.0.tar.gz diff --git a/buildroot-overlay/package/gsl-lite/gsl-lite.mk b/buildroot-overlay/package/gsl-lite/gsl-lite.mk new file mode 100644 index 0000000..ab549ff --- /dev/null +++ b/buildroot-overlay/package/gsl-lite/gsl-lite.mk @@ -0,0 +1,12 @@ +################################################################################ +# +# gsl-lite +# +################################################################################ + +GSL_LITE_VERSION = v0.41.0 +GSL_LITE_SOURCE = $(GSL_LITE_VERSION).tar.gz +GSL_LITE_SITE = https://github.com/gsl-lite/gsl-lite/archive/refs/tags +GSL_LITE_INSTALL_STAGING = YES + +$(eval $(cmake-package)) diff --git a/buildroot-overlay/package/libmmz/Makefile b/buildroot-overlay/package/libmmz/Makefile index 358ee80..053471a 100644 --- a/buildroot-overlay/package/libmmz/Makefile +++ b/buildroot-overlay/package/libmmz/Makefile @@ -1,17 +1,8 @@ CFLAG := -mcpu=c908v -O2 -ifeq ($(CC), cc) - CC=riscv64-unknown-linux-gnu-gcc -endif - -ifeq ($(AR), ar) - AR=riscv64-unknown-linux-gnu-ar -endif - all: - echo $(CC) - $(CC) $(CFLAG) -c mmz.c + $(CC) $(CFLAG) -c mmz.c -o mmz.o $(AR) rcs libmmz.a mmz.o clean: - rm -f *.o \ No newline at end of file + rm -f *.o diff --git a/buildroot-overlay/package/libmmz/libmmz.a b/buildroot-overlay/package/libmmz/libmmz.a deleted file mode 100644 index d57a293..0000000 Binary files a/buildroot-overlay/package/libmmz/libmmz.a and /dev/null differ diff --git a/buildroot-overlay/package/libmmz/libmmz.mk b/buildroot-overlay/package/libmmz/libmmz.mk index 7407e7c..7787c79 100644 --- a/buildroot-overlay/package/libmmz/libmmz.mk +++ b/buildroot-overlay/package/libmmz/libmmz.mk @@ -1,12 +1,14 @@ LIBMMZ_SITE = $(realpath $(TOPDIR))"/package/libmmz" LIBMMZ_SITE_METHOD = local +LIBMMZ_INSTALL_STAGING = YES define LIBMMZ_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" AR="$(TARGET_AR)" -C $(@D) endef -define LIBMMZ_INSTALL_TARGET_CMDS - $(INSTALL) -m 0755 $(@D)/libmmz.a $(TARGET_DIR)/usr/lib/ +define LIBMMZ_INSTALL_STAGING_CMDS + $(INSTALL) -m 0644 $(@D)/mmz.h $(STAGING_DIR)/usr/include/mmz.h + $(INSTALL) -m 0755 $(@D)/libmmz.a $(STAGING_DIR)/usr/lib/libmmz.a endef $(eval $(generic-package)) diff --git a/buildroot-overlay/package/libnncase/libnncase.hash b/buildroot-overlay/package/libnncase/libnncase.hash index f708c27..5fb91cb 100644 --- a/buildroot-overlay/package/libnncase/libnncase.hash +++ b/buildroot-overlay/package/libnncase/libnncase.hash @@ -1 +1 @@ -sha256 7220fa6094c05fb7d410cd16422f0d09805e4ff58a6404f039f059ebe5a04f82 nncase_k230_v2.9.0_runtime_linux.tgz +sha256 532884b67c1b02d61365b699ea10ff0f03494a12d5c540ad49e616030bb91e92 nncase_k230_v2.9.0_runtime_linux.tgz diff --git a/buildroot-overlay/package/libnncase/libnncase.mk b/buildroot-overlay/package/libnncase/libnncase.mk index 7be74ca..19df47f 100644 --- a/buildroot-overlay/package/libnncase/libnncase.mk +++ b/buildroot-overlay/package/libnncase/libnncase.mk @@ -8,4 +8,8 @@ define LIBNNCASE_EXTRACT_CMDS mv $(@D)/nncase_k230_$(NNCASE_VERSION)_runtime_linux $(@D)/nncase endef +define LIBNNCASE_INSTALL_TARGET_CMDS + cp -r $(@D)/nncase/* $(STAGING_DIR)/usr/ +endef + $(eval $(generic-package)) \ No newline at end of file diff --git a/buildroot-overlay/package/python-numpy/Config.in b/buildroot-overlay/package/python-numpy/Config.in new file mode 100644 index 0000000..e10618f --- /dev/null +++ b/buildroot-overlay/package/python-numpy/Config.in @@ -0,0 +1,37 @@ +config BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS + bool + # Numpy has some CPU specific code + default y if BR2_arc + default y if BR2_aarch64 + default y if BR2_arm + default y if BR2_armeb + default y if BR2_i386 + default y if BR2_mips + default y if BR2_mipsel + default y if BR2_powerpc + default y if BR2_powerpc64 + default y if BR2_riscv + default y if BR2_sh + default y if BR2_x86_64 + +config BR2_PACKAGE_PYTHON_NUMPY + bool "python-numpy" + depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS + depends on BR2_INSTALL_LIBSTDCPP + # python-numpy needs fenv.h which is not provided by uclibc + depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_9 + help + NumPy is the fundamental package for scientific computing + with Python. + + Note that NumPy needs fenv.h fully supported by the + C library. + + http://www.numpy.org/ + +comment "python-numpy needs a glibc or musl toolchain w/ C++, gcc >= 9" + depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS + depends on !BR2_INSTALL_LIBSTDCPP || \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_9 || \ + !(BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL) diff --git a/buildroot-overlay/package/vg_lite/test/samples/vglite_drm/vglite_drm.c b/buildroot-overlay/package/vg_lite/test/samples/vglite_drm/vglite_drm.c index 1a4e468..c9cb240 100755 --- a/buildroot-overlay/package/vg_lite/test/samples/vglite_drm/vglite_drm.c +++ b/buildroot-overlay/package/vg_lite/test/samples/vglite_drm/vglite_drm.c @@ -123,6 +123,9 @@ int main(int argc, const char * argv[]) { CHECK_ERROR(vg_lite_finish()); printf("display: %d\n", drm_display(0)); + int flag = fcntl(STDIN_FILENO, F_GETFL); + flag &= ~O_NONBLOCK; + fcntl(STDIN_FILENO, F_SETFL, flag); getchar(); test_triangle(&buffer); getchar(); diff --git a/buildroot-overlay/package/vvcam/CMakeLists.txt b/buildroot-overlay/package/vvcam/CMakeLists.txt index f69002f..2894e29 100644 --- a/buildroot-overlay/package/vvcam/CMakeLists.txt +++ b/buildroot-overlay/package/vvcam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.5) set(CMAKE_BUILD_TYPE Debug) @@ -8,6 +8,9 @@ file(GLOB SOURCES "src/*.c") add_library(${PROJECT_NAME} SHARED ${SOURCES}) target_include_directories(${PROJECT_NAME} PUBLIC include) +add_subdirectory(v4l2-drm) + install(TARGETS ${PROJECT_NAME} DESTINATION /usr/lib) install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/isp_media_server DESTINATION /usr/bin) install(DIRECTORY include/ DESTINATION /usr/include) +install(DIRECTORY configs/ DESTINATION /etc/vvcam) diff --git a/buildroot-overlay/package/vvcam/Config.in b/buildroot-overlay/package/vvcam/Config.in index f709fc1..bd7fffa 100644 --- a/buildroot-overlay/package/vvcam/Config.in +++ b/buildroot-overlay/package/vvcam/Config.in @@ -2,5 +2,6 @@ config BR2_PACKAGE_VVCAM bool "K230 ISP server" select BR2_PACKAGE_MXML select BR2_PACKAGE_LIBMICROHTTPD + select BR2_PACKAGE_DISPLAY help K230 ISP server diff --git a/buildroot-overlay/package/vvcam/Makefile b/buildroot-overlay/package/vvcam/Makefile index 206f5df..4a6b49a 100644 --- a/buildroot-overlay/package/vvcam/Makefile +++ b/buildroot-overlay/package/vvcam/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 +ccflags-y += -g ccflags-y += -DVVCAM_ISP0_BASE=0x90000000 ccflags-y += -DVVCAM_ISP_REG_SIZE=0x10000 ccflags-y += -DVVCAM_ISP0_IRQ=129 diff --git a/buildroot-overlay/package/vvcam/configs/ov5647.auto.json b/buildroot-overlay/package/vvcam/configs/ov5647.auto.json new file mode 100644 index 0000000..159f317 --- /dev/null +++ b/buildroot-overlay/package/vvcam/configs/ov5647.auto.json @@ -0,0 +1,1582 @@ +{ + "root": [ + { + "classname": "AdaptiveAe", + "enable": true, + "semMode": 0, + "antiFlikerMode": 0, + "setPoint": 50.0000, + "tolerance": 20.0000, + "dampOver": 0.7000, + "dampOverGain": 1.0000, + "dampOverRatio": 2.0000, + "dampUnder": 0.7000, + "dampUnderGain": 1.0000, + "dampUnderRatio": 0.5000, + "motionFilter": 0.5000, + "motionThreshold": 0.7000, + "targetFilter": 0.5000, + "lowLightLinearRepress": [ + 1.0000, 0.8000, 0.6000, 0.4000, 0.4000, 0.0000, 0.0000, 0.0000 + ], + "lowlightLinearGain": [ + 4.0000, 8.0000, 16.0000, 32.0000, 100.0000, 0.0000, 0.0000, 0.0000 + ], + "lowlightLinearLevel": 4, + "lowlightHdrRepress":[ + 1.0000, 0.8000, 0.8000, 0.8000, 0.8000, 0.0000, 0.0000, 0.0000 + ], + "lowlightHdrGain": [ + 4.0000, 8.0000, 16.0000, 32.0000, 100.0000, 0.0000, 0.0000, 0.0000 + ], + "lowlightHdrLevel": 4, + "wdrContrastMax": 110.0000, + "wdrContrastMin": 10.0000, + "frameCalEnable": false, + "expDecomposeCustom": false, + "performanceOptiMode": 0, + "roiNumber": 0, + "roiWeight": 0.5, + "roiWindow": [ + [ + 0.0000, 0.0000, 100.0000, 100.0000, 1.0000 + ], + [ + 0.0000, 0.0000, 100.0000, 100.0000, 1.0000 + ], + [ + 0.0000, 0.0000, 100.0000, 100.0000, 1.0000 + ], + [ + 0.0000, 0.0000, 100.0000, 100.0000, 1.0000 + ], + [ + 0.0000, 0.0000, 100.0000, 100.0000, 1.0000 + ] + ], + "expV2WindowWeight": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000 + ], + "expTableNum": 0, + "exposureTime": [ + 10000.0, 10000.0, 10000.0, 10000.0, 10000.0, 10000.0, 10000.0, 10000.0 + ], + "aGain": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ], + "dGain": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ], + "ispGain": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ], + "expV3RoiNum": 0, + "expV3RoiWeight": 0.5000, + "expV3RoiWindow": [ + [ + 0.0000, 0.0000, 120.0000, 120.0000, 1.0000 + ], + [ + 120.0000, 0.0000, 120.0000, 120.0000, 1.0000 + ], + [ + 200.0000, 0.0000, 120.0000, 120.0000, 6.0000 + ], + [ + 200.0000, 200.0000, 120.0000, 120.0000, 1.0000 + ], + [ + 400.0000, 400.0000, 120.0000, 120.0000, 1.0000 + ] + ], + "aeFrontGroundType": 1, + "aeFaceWeight": 0.5000, + "aeTouchWeight": 0.5000 + }, + { + "classname": "Awbv3", + "enable": true, + "mode": 0, + "useCcoffset": true, + "useCcmatrix": true, + "performanceOptiMode": 0, + "awbEnterLockThreshold": 0.03, + "awbEnterUnlockThreshold": 0.02, + "useDamping": true, + "useManuDampCoeff": false, + "useDampCoeff": 0.5, + "confidenceThreshold": [ + 3.0000, 3.0000, 3.0000, 3.0000, 3.0000, 3.0000, 3.0000, 3.0000, 3.0000, 3.0000 + ], + "temptureEnable": false, + "preferenceA": 128, + "preferenceCwf": 256, + "preferenceD65": 256, + "lightWeightLevel": [ + { + "lightWeightLevelEnable": false, + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "weight": [ + 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + }, + { + "lightWeightLevelEnable": false, + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "weight": [ + 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + }, + { + "lightWeightLevelEnable": false, + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "weight": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + }, + { + "lightWeightLevelEnable": false, + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "weight": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + }, + { + "lightWeightLevelEnable": false, + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "weight": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + }, + { + "lightWeightLevelEnable": false, + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "weight": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + }, + { + "lightWeightLevelEnable": false, + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "weight": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + }, + { + "lightWeightLevelEnable": false, + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "weight": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + }, + { + "lightWeightLevelEnable": false, + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "weight": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + }, + { + "lightWeightLevelEnable": false, + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "weight": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + } + ], + "grayPreference": [ + { + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "grayBgain": [ + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128 + ], + "grayRgain": [ + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128 + ], + "preferenceGainEnable": false + }, + { + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "grayBgain": [ + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128 + ], + "grayRgain": [ + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128 + ], + "preferenceGainEnable": false + }, + { + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "grayBgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "grayRgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "preferenceGainEnable": false + }, + { + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "grayBgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "grayRgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "preferenceGainEnable": false + }, + { + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "grayBgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "grayRgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "preferenceGainEnable": false + }, + { + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "grayBgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "grayRgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "preferenceGainEnable": false + }, + { + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "grayBgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "grayRgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "preferenceGainEnable": false + }, + { + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "grayBgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "grayRgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "preferenceGainEnable": false + }, + { + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "grayBgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "grayRgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "preferenceGainEnable": false + }, + { + "brightnessLevel": [ + 1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000, 4.0000, 4.5000, 5.5000, 6.0000, + 6.5000, 7.0000, 7.5000, 8.0000, 8.5000, 9.0000, 9.5000, 10.0000 + ], + "grayBgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "grayRgain": [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256 + ], + "preferenceGainEnable": false + } + ], + "faceAwbEnable": false, + "faceAwbRoiNum": 0, + "faceWeight": 0.5000, + "faceAwbRg": 1.0000, + "faceAwbBg": 1.0000, + "customPositionCwfEnable": false, + "confoundPointCwfRg": 1.0000, + "confoundPointCwfBg": 1.0000, + "confoundPointCwfThreshold": 2.0000, + "customPositionTl84Enable": false, + "confoundPointTl84Rg": 1.0000, + "confoundPointTl84Bg": 1.0000, + "confoundPointTl84Threshold": 2.0000, + "customPositionD65Enable": false, + "confoundPointD65Rg": 1.0000, + "confoundPointD65Bg": 1.0000, + "confoundPointD65Threshold": 2.0000, + "roiNumber": 0, + "roiWeight": 0.5, + "roiWindow": [ + [ + 0.0000, 0.0000, 120.0000, 120.0000, 1.0000 + ], + [ + 120.0000, 0.0000, 120.0000, 120.0000, 1.0000 + ], + [ + 200.0000, 0.0000, 120.0000, 120.0000, 6.0000 + ], + [ + 200.0000, 200.0000, 120.0000, 120.0000, 1.0000 + ], + [ + 400.0000, 400.0000, 120.0000, 120.0000, 1.0000 + ] + ] + }, + + { + "classname": "Afv2", + "enable": true, + "mode": 0, + "weightWindow": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ], + "cMotionThreshold": 0.5000, + "cStableTolerance": 0.2000, + "cPointsOfCurve": 12, + "maxFocal": 600, + "minFocal": 300, + "cPdConfThreshold": 300.0000, + "PdShiftThreshold": 10.0000, + "deFocusFrameNum": 3, + "lossConfidenceFrameNum": 3, + "accurateFocusStep": 5, + "accurateFocusEnable": false, + "PdStablecountMax": 2, + "pdRoiIndex": 0, + "afmV11RoiNum": 0, + "afmV11RoiWeight": 1.0000, + "afmV11RoiWindowWeight": 1.0000, + "afmV11RoiWindow": [ + [ + 0, 0, 100, 100 + ], + [ + 0, 0, 100, 100 + ], + [ + 0, 0, 100, 100 + ], + [ + 0, 0, 100, 100 + ], + [ + 0, 0, 100, 100 + ] + ], + "afmV3WeightWindow": [ + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, + 1.0000, 1.0000, 1.0000, 1.0000, 1.0000 + ] + }, + + { + "classname": "AGamma64", + "enable": true, + "tables": [ + { + "curve": [ + [ + 154, 211, 254, 290, 321, 348, 374, 397, 419, 440, 459, 478, 495, + 512, 529, 544, 560, 574, 589, 602, 616, 629, 642, 655, 667, 679, + 691, 702, 713, 725, 735, 746, 757, 767, 777, 787, 797, 807, 816, + 826, 835, 844, 853, 862, 871, 880, 889, 897, 906, 914, 922, 930, + 939, 947, 955, 962, 970, 978, 985, 993, 1001, 1008, 1015, 1023 + ], + [ + 147, 204, 246, 281, 312, 340, 365, 389, 411, 431, 451, 470, 487, + 505, 521, 537, 552, 567, 582, 596, 609, 623, 636, 648, 661, 673, + 685, 697, 708, 719, 730, 741, 752, 763, 773, 783, 793, 803, 813, + 822, 832, 841, 851, 860, 869, 878, 887, 895, 904, 912, 921, 929, + 938, 946, 954, 962, 970, 978, 985, 993, 1001, 1008, 1016, 1023 + ], + [ + 141, 196, 238, 273, 304, 331, 356, 380, 402, 423, 442, 461, 479, + 496, 513, 529, 544, 559, 574, 588, 602, 615, 629, 641, 654, 666, + 678, 690, 702, 713, 725, 736, 746, 757, 768, 778, 788, 798, 808, + 818, 828, 837, 847, 856, 865, 874, 883, 892, 901, 910, 919, 927, + 936, 944, 952, 960, 969, 977, 985, 993, 1000, 1008, 1016, 1023 + ], + [ + 134, 188, 230, 264, 295, 322, 347, 371, 393, 414, 433, 452, 470, + 487, 504, 520, 536, 551, 566, 580, 594, 608, 621, 634, 647, 659, + 672, 684, 695, 707, 719, 730, 741, 752, 762, 773, 783, 794, 804, + 814, 824, 833, 843, 852, 862, 871, 880, 889, 898, 907, 916, 925, + 933, 942, 951, 959, 967, 975, 984, 992, 1000, 1008, 1016, 1023 + ], + [ + 128, 181, 221, 256, 286, 313, 338, 362, 384, 404, 424, 443, 461, + 478, 495, 512, 527, 543, 557, 572, 586, 600, 613, 627, 640, 652, + 665, 677, 689, 701, 712, 724, 735, 746, 757, 768, 778, 789, 799, + 809, 819, 829, 839, 849, 858, 868, 877, 886, 896, 905, 914, 923, + 931, 940, 949, 957, 966, 974, 983, 991, 999, 1007, 1015, 1023 + ], + [ + 114, 165, 204, 237, 267, 294, 319, 342, 364, 385, 405, 424, 442, + 460, 477, 493, 509, 525, 540, 555, 569, 583, 597, 611, 624, 637, + 650, 662, 675, 687, 699, 710, 722, 734, 745, 756, 767, 778, 789, + 799, 810, 820, 830, 840, 850, 860, 870, 880, 889, 899, 908, 917, + 927, 936, 945, 954, 963, 972, 981, 989, 998, 1007, 1015, 1023 + ] + ], + "gains": [1, 8, 16, 32, 64, 240], + "hdr": false + }, + { + "curve": [ + [ + 154, 211, 254, 290, 321, 348, 374, 397, 419, 440, 459, 478, 495, + 512, 529, 544, 560, 574, 589, 602, 616, 629, 642, 655, 667, 679, + 691, 702, 713, 725, 735, 746, 757, 767, 777, 787, 797, 807, 816, + 826, 835, 844, 853, 862, 871, 880, 889, 897, 906, 914, 922, 930, + 939, 947, 955, 962, 970, 978, 985, 993, 1001, 1008, 1015, 1023 + ], + [ + 147, 204, 246, 281, 312, 340, 365, 389, 411, 431, 451, 470, 487, + 505, 521, 537, 552, 567, 582, 596, 609, 623, 636, 648, 661, 673, + 685, 697, 708, 719, 730, 741, 752, 763, 773, 783, 793, 803, 813, + 822, 832, 841, 851, 860, 869, 878, 887, 895, 904, 912, 921, 929, + 938, 946, 954, 962, 970, 978, 985, 993, 1001, 1008, 1016, 1023 + ], + [ + 141, 196, 238, 273, 304, 331, 356, 380, 402, 423, 442, 461, 479, + 496, 513, 529, 544, 559, 574, 588, 602, 615, 629, 641, 654, 666, + 678, 690, 702, 713, 725, 736, 746, 757, 768, 778, 788, 798, 808, + 818, 828, 837, 847, 856, 865, 874, 883, 892, 901, 910, 919, 927, + 936, 944, 952, 960, 969, 977, 985, 993, 1000, 1008, 1016, 1023 + ], + [ + 134, 188, 230, 264, 295, 322, 347, 371, 393, 414, 433, 452, 470, + 487, 504, 520, 536, 551, 566, 580, 594, 608, 621, 634, 647, 659, + 672, 684, 695, 707, 719, 730, 741, 752, 762, 773, 783, 794, 804, + 814, 824, 833, 843, 852, 862, 871, 880, 889, 898, 907, 916, 925, + 933, 942, 951, 959, 967, 975, 984, 992, 1000, 1008, 1016, 1023 + ], + [ + 128, 181, 221, 256, 286, 313, 338, 362, 384, 404, 424, 443, 461, + 478, 495, 512, 527, 543, 557, 572, 586, 600, 613, 627, 640, 652, + 665, 677, 689, 701, 712, 724, 735, 746, 757, 768, 778, 789, 799, + 809, 819, 829, 839, 849, 858, 868, 877, 886, 896, 905, 914, 923, + 931, 940, 949, 957, 966, 974, 983, 991, 999, 1007, 1015, 1023 + ], + [ + 114, 165, 204, 237, 267, 294, 319, 342, 364, 385, 405, 424, 442, + 460, 477, 493, 509, 525, 540, 555, 569, 583, 597, 611, 624, 637, + 650, 662, 675, 687, 699, 710, 722, 734, 745, 756, 767, 778, 789, + 799, 810, 820, 830, 840, 850, 860, 870, 880, 889, 899, 908, 917, + 927, 936, 945, 954, 963, 972, 981, 989, 998, 1007, 1015, 1023 + ] + ], + "gains": [1, 8, 16, 20, 24, 240], + "hdr": true + } + ] + }, + { + "classname": "ALscv2", + "enable": false, + "damping": 0.5, + "interMode": 0, + "tables": [ + { + "hdr": false, + "gains": [ 1, 128, 200, 233, 400 ], + "strength": [ 0, 0.3, 0.5, 0.7, 1.0 ] + }, + { + "hdr": true, + "gains": [ 1, 128, 200, 240, 400 ], + "strength": [ 0, 0.3, 0.5, 0.7, 1.0 ] + } + ] + }, + { + "classname": "ACproc", + "enable": true, + "tables": [ + { + "bright": [0, 0, 0, -6, -12], + "contrast": [1.1, 1.1, 1.1, 1.1, 1.1], + "gains": [1, 24, 128, 256, 512], + "hdr": false, + "hue": [0, 0, 0, 0, 0], + "saturation": [1.4, 1.3, 1.2, 0.8, 0.6] + }, + { + "bright": [-4, -4, -4, -8, -10], + "contrast": [1.1, 1.1, 1.1, 1.1, 1.1], + "gains": [1, 24, 128, 256, 512], + "hdr": true, + "hue": [0, 0, 0, 0, 0], + "saturation": [1.6, 1.4, 1, 0.8, 0.8] + } + ] + }, + { + "classname": "Aeev1", + "enable": false, + "tables": [ + { + "ca_curve": [ + [ + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 + ], + [ + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 + ], + [ + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 + ], + [ + 0, 149, 278, 390, 486, 570, 641, 702, 754, 799, 836, 868, 895, + 918, 937, 953, 966, 977, 986, 993, 999, 1004, 1008, 1012, 1014, + 1016, 1018, 1019, 1020, 1021, 1022, 1022, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1024, 1024 + ], + [ + 0, 149, 278, 390, 486, 570, 641, 702, 754, 799, 836, 868, 895, + 918, 937, 953, 966, 977, 986, 993, 999, 1004, 1008, 1012, 1014, + 1016, 1018, 1019, 1020, 1021, 1022, 1022, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1024, 1024 + ], + [ + 0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, + 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024 + ] + ], + "ca_enable": [1, 1, 1, 1, 1, 1], + "dci_curve": [ + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ], + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ], + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ], + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ], + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ], + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ] + ], + "dci_enable": [1, 1, 1, 1, 1, 1], + "ee_edge_gain": [0, 0, 0, 0, 0, 0], + "ee_src_strength": [1, 1, 1, 1, 1, 1], + "ee_strength": [110, 110, 110, 100, 100, 100], + "ee_uv_gain": [0, 0, 0, 0, 0, 0], + "ee_y_down_gain": [0, 0, 0, 0, 0, 0], + "ee_y_up_gain": [0, 0, 0, 0, 0, 0], + "gains": [1, 8, 32, 128, 256, 512], + "hdr": false + }, + { + "ca_curve": [ + [ + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 + ], + [ + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 + ], + [ + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 + ], + [ + 0, 149, 278, 390, 486, 570, 641, 702, 754, 799, 836, 868, 895, + 918, 937, 953, 966, 977, 986, 993, 999, 1004, 1008, 1012, 1014, + 1016, 1018, 1019, 1020, 1021, 1022, 1022, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1024, 1024 + ], + [ + 0, 149, 278, 390, 486, 570, 641, 702, 754, 799, 836, 868, 895, + 918, 937, 953, 966, 977, 986, 993, 999, 1004, 1008, 1012, 1014, + 1016, 1018, 1019, 1020, 1021, 1022, 1022, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1024, 1024 + ], + [ + 0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, + 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024 + ] + ], + "ca_enable": [1, 1, 1, 1, 1, 1], + "dci_curve": [ + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ], + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ], + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ], + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ], + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ], + [ + 0, 1, 5, 9, 16, 23, 32, 42, 54, 67, 81, 95, 111, 127, 144, 162, + 180, 198, 215, 234, 252, 270, 287, 305, 323, 340, 357, 374, 391, + 407, 424, 440, 457, 473, 489, 506, 522, 539, 556, 573, 590, 607, + 625, 644, 662, 681, 700, 721, 741, 761, 782, 804, 826, 847, 869, + 891, 912, 933, 952, 970, 987, 1000, 1011, 1019, 1022 + ] + ], + "dci_enable": [1, 1, 1, 1, 1, 1], + "ee_edge_gain": [1000, 0, 0, 0, 0, 0], + "ee_src_strength": [1, 1, 1, 1, 1, 1], + "ee_strength": [110, 110, 110, 100, 100, 100], + "ee_uv_gain": [0, 0, 0, 0, 0, 0], + "ee_y_down_gain": [3000, 0, 0, 0, 0, 0], + "ee_y_up_gain": [2000, 0, 0, 0, 0, 0], + "gains": [1, 8, 32, 128, 256, 512], + "hdr": true + } + ] + }, + { + "classname": "ADmscv2", + "enable": true, + "tables": [ + { + "dmsc_denoise_strength": [0, 0, 0, 0, 0, 0], + "dmsc_depurple_cbcr_mode": [3, 3, 3, 3, 3, 3], + "dmsc_depurple_enable": [1, 1, 1, 1, 1, 1], + "dmsc_depurple_sat_shrink": [8, 8, 8, 8, 8, 8], + "dmsc_depurple_thr": [20, 40, 60, 80, 100, 140], + "dmsc_sharpen_clip_black": [500, 500, 500, 300, 300, 300], + "dmsc_sharpen_clip_white": [500, 500, 500, 300, 300, 300], + "dmsc_sharpen_enable": [1, 1, 1, 1, 1, 1], + "dmsc_sharpen_factor_black": [200, 150, 130, 100, 90, 70], + "dmsc_sharpen_factor_white": [200, 150, 130, 100, 90, 70], + "dmsc_sharpen_r1": [0, 0, 0, 0, 0, 0], + "dmsc_sharpen_r2": [256, 230, 210, 190, 128, 100], + "dmsc_sharpen_r3": [256, 230, 210, 190, 128, 100], + "dmsc_sharpen_size": [8, 8, 8, 8, 8, 8], + "dmsc_sharpen_t1": [8, 16, 16, 16, 32, 64], + "dmsc_sharpen_t2_shift": [4, 4, 4, 4, 5, 6], + "dmsc_sharpen_t3": [48, 32, 32, 32, 64, 128], + "dmsc_sharpen_t4_shift": [4, 4, 4, 4, 5, 5], + "gains": [1, 4, 16, 128, 256, 512], + "hdr": false + }, + { + "dmsc_denoise_strength": [0, 0, 0, 0, 0, 0], + "dmsc_depurple_cbcr_mode": [3, 3, 3, 3, 3, 3], + "dmsc_depurple_enable": [1, 1, 1, 1, 1, 1], + "dmsc_depurple_sat_shrink": [8, 8, 8, 8, 8, 8], + "dmsc_depurple_thr": [20, 40, 60, 80, 100, 140], + "dmsc_sharpen_clip_black": [500, 500, 500, 300, 300, 300], + "dmsc_sharpen_clip_white": [500, 500, 500, 300, 300, 300], + "dmsc_sharpen_enable": [1, 1, 1, 1, 1, 1], + "dmsc_sharpen_factor_black": [200, 150, 130, 100, 90, 70], + "dmsc_sharpen_factor_white": [200, 150, 130, 100, 90, 70], + "dmsc_sharpen_r1": [0, 0, 0, 0, 0, 0], + "dmsc_sharpen_r2": [256, 230, 210, 190, 128, 100], + "dmsc_sharpen_r3": [256, 230, 210, 190, 128, 100], + "dmsc_sharpen_size": [8, 8, 8, 8, 8, 8], + "dmsc_sharpen_t1": [8, 16, 16, 16, 32, 64], + "dmsc_sharpen_t2_shift": [4, 4, 4, 4, 5, 6], + "dmsc_sharpen_t3": [48, 32, 32, 32, 64, 128], + "dmsc_sharpen_t4_shift": [4, 4, 4, 4, 5, 5], + "gains": [1, 4, 16, 128, 256, 512], + "hdr": true + } + ] + }, + { + "classname": "AWdrv4", + "enable": false, + "tables": [ + { + "contrast": [ + 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300 + ], + "entropy_base": [ + 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716 + ], + "entropy_slope": [ + 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204 + ], + "flat_strength": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "flat_thr": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "gains": [2, 4, 8, 12, 16, 24, 32, 48, 64, 128, 250, 500], + "global_strength": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "hdr": false, + "high_strength": [90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90], + "low_strength": [4, 80, 80, 80, 80, 80, 80, 80, 80, 80, 2, 2], + "strength": [ + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 + ] + }, + { + "contrast": [ + 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300 + ], + "entropy_base": [ + 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716 + ], + "entropy_slope": [ + 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204 + ], + "flat_strength": [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "flat_thr": [19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "gains": [2, 4, 8, 12, 16, 24, 32, 48, 64, 128, 200, 240], + "global_strength": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "hdr": true, + "high_strength": [80, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24], + "low_strength": [ + 200, 225, 225, 80, 80, 80, 120, 160, 160, 160, 160, 160 + ], + "strength": [ + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 + ] + } + ] + }, + { + "classname": "A3dnrv3_1", + "enable": true, + "nlm_en": true, + "tnr_en": true, + "tables": [ + { + "blend_motion": [80, 80, 80, 80, 80, 80], + "blend_slope": [2, 2, 2, 2, 2, 2], + "blend_static": [10, 10, 10, 10, 20, 30], + "dialte_h": [7, 7, 7, 7, 7, 7], + "filter_len": [20, 20, 20, 20, 20, 20], + "filter_len2": [4, 4, 4, 4, 4, 4], + "gains": [1, 4, 16, 64, 256, 512], + "hdr": false, + "motion_dilate_en": [1, 1, 1, 1, 1, 1], + "motion_erode_en": [1, 1, 1, 1, 1, 1], + "noise_level": [20, 20, 20, 20, 20, 20], + "pregamma_en": [1, 1, 1, 1, 1, 1], + "preweight": [1, 1, 1, 1, 1, 8], + "range_h": [7, 7, 7, 7, 7, 3], + "range_v": [7, 7, 7, 7, 7, 3], + "sadweight": [16, 16, 16, 12, 8, 4], + "sigma": [2, 3, 4, 6, 8, 12], + "strength": [120, 120, 120, 120, 120, 120], + "thr_motion_slope": [16, 16, 16, 16, 16, 16] + }, + { + "blend_motion": [80, 80, 80, 80, 80, 80], + "blend_slope": [2, 2, 2, 2, 2, 2], + "blend_static": [10, 10, 10, 10, 20, 30], + "dialte_h": [7, 7, 7, 7, 7, 7], + "filter_len": [20, 20, 20, 20, 20, 20], + "filter_len2": [4, 4, 4, 4, 4, 4], + "gains": [1, 4, 16, 64, 256, 512], + "hdr": true, + "motion_dilate_en": [1, 1, 1, 1, 1, 1], + "motion_erode_en": [1, 1, 1, 1, 1, 1], + "noise_level": [20, 20, 20, 20, 20, 20], + "pregamma_en": [1, 1, 1, 1, 1, 1], + "preweight": [1, 1, 1, 1, 1, 8], + "range_h": [7, 7, 7, 7, 7, 3], + "range_v": [7, 7, 7, 7, 7, 3], + "sadweight": [16, 16, 16, 12, 8, 4], + "sigma": [2, 3, 4, 6, 8, 12], + "strength": [120, 120, 120, 120, 120, 120], + "thr_motion_slope": [16, 16, 16, 16, 16, 16] + } + ] + }, + { + "classname": "ADpf", + "enable": false, + "tables": [ + { + "div": [64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0], + "gains": [ + 1, 8, 16, 24, 48, 72, 96, 192, 384, 768, 1536, 3072, 3970, 4000 + ], + "gradient": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], + "hdr": false, + "min": [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], + "noise_curve": [ + [ + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095 + ], + [ + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095 + ], + [ + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095 + ], + [ + 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, 2048, 2048 + ], + [ + 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, 2048, 2048 + ], + [ + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024 + ], + [ + 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512 + ], + [ + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256 + ], + [ + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128 + ], + [ + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 + ], + [ + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 + ], + [ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 + ], + [ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 + ], + [16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16] + ], + "offset": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1], + "sigma_g": [2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], + "sigma_rb": [2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4] + }, + { + "div": [64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0, 64.0], + "gains": [ + 1, 1.8, 4.4, 8.6, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128, 160, + 192, 224, 230 + ], + "gradient": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,1.0, 1.0, 1.0, 1.0, 1.0], + "hdr": true, + "min": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], + "noise_curve": [ + [ + 4095, 4095, 4030, 3325, 2894, 2376, 2063, 1848, 1689, 1464, 1311, + 1197, 1038, 928, 848, 785, 736 + ], + [ + 4095, 4095, 3051, 2492, 2158, 1762, 1526, 1365, 1246, 1079, 965, + 881, 763, 682, 623, 577, 540 + ], + [ + 4095, 2741, 1963, 1610, 1397, 1143, 991, 887, 810, 702, 628, 574, + 497, 445, 406, 376, 352 + ], + [ + 2885, 1688, 1311, 1109, 979, 815, 713, 642, 588, 512, 459, 420, + 365, 327, 299, 277, 260 + ], + [ + 1926, 1304, 1051, 904, 805, 677, 596, 538, 495, 432, 388, 356, + 309, 277, 254, 235, 221 + ], + [ + 1029, 886, 790, 720, 665, 585, 529, 486, 452, 401, 364, 336, 295, + 266, 244, 227, 214 + ], + [ + 1027, 841, 730, 653, 597, 517, 463, 423, 391, 345, 312, 287, 251, + 226, 207, 193, 181 + ], + [ + 794, 694, 624, 572, 531, 470, 426, 392, 366, 325, 296, 274, 240, + 217, 199, 185, 174 + ], + [ + 676, 595, 537, 493, 459, 407, 370, 341, 318, 284, 258, 239, 210, + 190, 174, 162, 153 + ], + [ + 561, 506, 464, 431, 404, 363, 332, 308, 289, 259, 237, 219, 194, + 175, 161, 150, 142 + ], + [ + 495, 451, 417, 389, 367, 331, 304, 283, 266, 239, 219, 203, 180, + 163, 150, 140, 132 + ], + [ + 367, 345, 326, 311, 297, 274, 256, 241, 228, 208, 192, 179, 160, + 146, 135, 126, 119 + ], + [ + 326, 306, 289, 275, 263, 242, 226, 213, 201, 183, 169, 158, 141, + 129, 119, 111, 105 + ], + [ + 277, 263, 251, 241, 231, 216, 203, 192, 183, 168, 156, 146, 131, + 120, 112, 105, 99 + ], + [ + 226, 216, 207, 199, 192, 180, 170, 161, 154, 141, 132, 124, 112, + 102, 95, 89, 84 + ], + [ + 190, 183, 176, 170, 164, 155, 146, 139, 133, 123, 115, 109, 98, + 90, 84, 79, 75 + ], + [ + 164, 158, 152, 147, 143, 135, 128, 123, 118, 109, 102, 97, 88, 81, + 75, 71, 67 + ], + [ + 143, 138, 134, 130, 126, 120, 114, 110, 105, 98, 92, 87, 79, 73, + 68, 64, 61 + ], + [ + 143, 138, 133, 129, 125, 119, 113, 108, 104, 97, 91, 86, 78, 72, + 67, 63, 60 + ] + ], + "offset": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "sigma_g": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], + "sigma_rb": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2] + } + ] + }, + { + "classname": "ABls", + "enable": false, + "tables": [ + { + "hdr": false, + "gains": [1, 128, 200, 233, 400], + "bls": [ + [240, 240, 240, 240], + [240, 240, 240, 240], + [240, 240, 240, 240], + [240, 240, 240, 240], + [240, 240, 240, 240] + ] + }, + { + "hdr": true, + "gains": [1, 128, 200, 240, 400], + "bls": [ + [240, 240, 240, 240], + [240, 240, 240, 240], + [240, 240, 240, 240], + [240, 240, 240, 240], + [240, 240, 240, 240] + ] + } + ] + }, + { + "classname": "ADpcc", + "enable": false, + "tables": [ + { + "hdr": false, + "gains": [1,8,16,32,64,240], + "line_mad_fac": [ + [ + [4,24,4], + [4,16,4]], + [ + [4,24,4], + [4,16,4]], + [ + [4,24,4], + [4,16,4]], + [ + [4,24,4], + [4,16,4]], + [ + [4,8,4], + [4,8,4]], + [ + [4,4,4], + [4,4,4]]], + "line_thresh": [ + [ + [8,32,32], + [8,24,32]], + [ + [8,16,32], + [8,16,32]], + [ + [8,16,32], + [8,12,32]], + [ + [8,16,32], + [8,12,32]], + [ + [8,16,8], + [8,12,8]], + [ + [8,16,0], + [8,12,0]]], + "methods_set": [ + [7967,1799,7967], + [7967,1799,7967], + [7453,1799,7967], + [7453,1799,7967], + [7453,1799,7967], + [7453,1799,7967]], + "out_mode": [3,3,3,3,3,3], + "pg_fac": [ + [ + [8,8,10], + [6,6,10]], + [ + [8,8,10], + [6,6,10]], + [ + [8,8,10], + [6,6,10]], + [ + [8,8,10], + [6,6,10]], + [ + [6,6,6], + [6,6,6]], + [ + [4,4,4], + [4,4,4]]], + "rg_fac": [ + [ + [32,8,4], + [32,8,4]], + [ + [32,8,4], + [32,8,4]], + [ + [32,8,4], + [32,8,4]], + [ + [32,8,4], + [32,8,4]], + [ + [16,8,4], + [16,8,4]], + [ + [8,8,4], + [2,8,0]]], + "rnd_offs": [ + [ + [3,3,3], + [3,3,3]], + [ + [3,3,3], + [3,3,3]], + [ + [3,3,3], + [3,3,3]], + [ + [3,3,3], + [3,3,3]], + [ + [3,3,3], + [3,3,3]], + [ + [3,3,3], + [3,3,3]]], + "rnd_thresh": [ + [ + [10,8,8], + [10,8,6]], + [ + [10,8,8], + [10,8,6]], + [ + [10,8,8], + [10,8,6]], + [ + [10,8,8], + [10,8,6]], + [ + [8,8,8], + [8,8,6]], + [ + [8,8,8], + [4,8,4]]], + "ro_limits": [ + [ + [2,3,2], + [2,3,2]], + [ + [2,3,2], + [2,3,2]], + [ + [2,3,2], + [2,3,2]], + [ + [2,3,2], + [2,3,2]], + [ + [2,3,2], + [2,3,2]], + [ + [2,3,2], + [2,3,2]]], + "set_use": [3,3,7,7,15,15] + }, + { + "hdr": true, + "gains": [1,128,200,233,400,600], + "line_mad_fac": [ + [ + [4,24,4], + [4,16,4]], + [ + [4,24,4], + [4,16,4]], + [ + [4,24,4], + [4,16,4]], + [ + [4,24,4], + [4,16,4]], + [ + [4,24,4], + [4,16,4]], + [ + [4,24,4], + [4,16,4]]], + "line_thresh": [ + [ + [8,16,32], + [8,12,32]], + [ + [8,16,32], + [8,12,32]], + [ + [8,16,32], + [8,12,32]], + [ + [8,16,32], + [8,12,32]], + [ + [8,16,32], + [8,12,32]], + [ + [8,16,32], + [8,12,32]]], + "methods_set": [ + [7453,1799,7967], + [7453,1799,7967], + [7453,1799,7967], + [7453,1799,7967], + [7453,1799,7967], + [7453,1799,7967]], + "out_mode": [3,3,3,3,3,3], + "pg_fac": [ + [ + [8,8,10], + [6,6,10]], + [ + [8,8,10], + [6,6,10]], + [ + [8,8,10], + [6,6,10]], + [ + [8,8,10], + [6,6,10]], + [ + [8,8,10], + [6,6,10]], + [ + [8,8,10], + [6,6,10]]], + "rg_fac": [ + [ + [32,8,4], + [32,8,4]], + [ + [32,8,4], + [32,8,4]], + [ + [32,8,4], + [32,8,4]], + [ + [32,8,4], + [32,8,4]], + [ + [32,8,4], + [32,8,4]], + [ + [32,8,4], + [32,8,4]]], + "rnd_offs": [ + [ + [3,3,3], + [3,3,3]], + [ + [3,3,3], + [3,3,3]], + [ + [3,3,3], + [3,3,3]], + [ + [3,3,3], + [3,3,3]], + [ + [3,3,3], + [3,3,3]], + [ + [3,3,3], + [3,3,3]]], + "rnd_thresh": [ + [ + [10,8,8], + [10,8,6]], + [ + [10,8,8], + [10,8,6]], + [ + [10,8,8], + [10,8,6]], + [ + [10,8,8], + [10,8,6]], + [ + [10,8,8], + [10,8,6]], + [ + [10,8,8], + [10,8,6]]], + "ro_limits": [ + [ + [2,3,2], + [2,3,2]], + [ + [2,3,2], + [2,3,2]], + [ + [2,3,2], + [2,3,2]], + [ + [2,3,2], + [2,3,2]], + [ + [2,3,2], + [2,3,2]], + [ + [2,3,2], + [2,3,2]]], + "set_use": [3,3,7,7,15,15] + }] + } + ] +} diff --git a/buildroot-overlay/package/vvcam/configs/ov5647.manual.json b/buildroot-overlay/package/vvcam/configs/ov5647.manual.json new file mode 100644 index 0000000..c2d67da --- /dev/null +++ b/buildroot-overlay/package/vvcam/configs/ov5647.manual.json @@ -0,0 +1,351 @@ +{ + "ARCH": "ISP8000_V2201.Manual_ext", + "root": [ + { + "nr_reloc" : true, + "driver": [ + { + "base_frame": 0, + "bls_out": [0, 0, 0, 0], + "bypass": false, + "bypass_select": 0, + "class": "CHdrv2", + "color_weight": [255, 0, 1], + "enable": false, + "extend_bit": [-1, -1], + "ratio": [2.8124964237213135, 1.0], + "sensor_type": 9, + "stitching_mode": 0, + "trans_range": [ + [0.20000000298023224, 0.80000001192092896], + [0.84999999999999998, 0.94999999999999996], + [0, 0.1], + [0, 0.01], + [0.85, 0.95], + [0, 0.1] + ] + }, + { + "class": "CGreenEqu", + "enable": true, + "threshold": 2.5 + }, + { + "bit" : 12, + "ccmatrix" : [ 1.0, 0, 0, -0.9, 0, 1.0, 0, -0.9, 0, 0, 1.0, -0.9 ], + "class" : "CRgbIR", + "dpcc_mid_th" : [ 4095, 4095, 4095, 4095 ], + "dpcc_th" : [ 400, 100, 100, 100 ], + "enable" : true, + "gain" : [ 1, 1, 1 ], + "ir_threshold" : 4095, + "irbayer_pattern" : 2, + "l_threshold" : 3800, + "out_rgb_pattern" : 3 + }, + { + "class": "CManualWb", + "enable": true, + "gain": [1.6799999999999999, 1, 1, 2.25] + }, + { + "bit": 13, + "ccmatrix": [1, 0, 0, 0, 1, 0, 0, 0, 1], + "ccoffset": [0, 0, 0], + "class": "CCcm", + "enable": true + }, + { + "class": "CDgain", + "digital_gain_b": 1, + "digital_gain_gb": 1, + "digital_gain_gr": 1, + "digital_gain_r": 1, + "enable": true + }, + { + "class": "CCpdv1", + "enable": true, + "expand_curve_x": [ + 21, 20, 18, 16, 13, 12, 21, 17, 16, 14, 15, 14, 13, 12, 16, 15, 17, + 15, 18, 14, 18, 17, 16, 19, 17, 16, 15, 13, 20, 17, 16, 14, 12, 17, + 16, 15, 14, 13, 12, 18, 17, 15, 13, 19, 17, 15, 14, 13, 12, 20, 17, + 14, 20, 19, 18, 17, 14, 21, 20, 17, 14, 13, 0, 0 + ], + "expand_curve_y": [ + 512, 898, 995, 1019, 1022, 1024, 1953, 2011, 2040, 2048, 3140, 3686, + 3959, 4096, 6826, 8192, 14745, 16384, 31804, 32768, 51492, 60854, + 65536, 110636, 121911, 127548, 130367, 131072, 239662, 253236, + 260023, 261719, 262144, 395296, 461872, 495160, 511804, 520126, + 524288, 840839, 999114, 1038683, 1048575, 1048575, 1048575, 1048575, + 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, + 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, + 1048575, 1048575, 1048575, 1048575 + ], + "expand_enable": false, + "expand_use_out_y_curve": false + }, + { + "class" : "Bls", + "bls" : [ 256, 256, 256, 256] + }, + { + "class": "CGamma64", + "curve": [ + 155, 212, 255, 290, 321, 349, 374, 398, 419, 440, 460, 478, 496, + 513, 529, 545, 560, 575, 589, 603, 617, 630, 643, 655, 667, 679, + 691, 703, 714, 725, 736, 747, 757, 767, 778, 788, 798, 807, 817, + 826, 836, 845, 854, 863, 872, 881, 889, 898, 906, 915, 923, 931, + 939, 947, 955, 963, 971, 978, 986, 994, 1001, 1008, 1016, 1023 + ], + "enable": true, + "standard": true, + "standard_val": 2.2 + }, + { + "bpt_enable": false, + "bpt_num": 3, + "bpt_out_mode": 0, + "bpt_pos_x": [0, 0, 0], + "bpt_pos_y": [0, 0, 0], + "bypass": false, + "class": "CDpcc", + "enable": false, + "line_mad_fac": [ + [0, 0, 0], + [0, 0, 0] + ], + "line_thresh": [ + [0, 0, 0], + [0, 0, 0] + ], + "methods_set": [0, 0, 0], + "out_mode": 1, + "pg_fac": [ + [0, 0, 0], + [0, 0, 0] + ], + "rg_fac": [ + [0, 0, 0], + [0, 0, 0] + ], + "rnd_offs": [ + [0, 0, 0], + [0, 0, 0] + ], + "rnd_thresh": [ + [0, 0, 0], + [0, 0, 0] + ], + "ro_limits": [ + [0, 0, 0], + [0, 0, 0] + ], + "set_use": 1 + }, + { + "class": "CDpf", + "div": 64, + "enable": false, + "gain": 1, + "gradient": 1, + "min": 16, + "noise_curve": [ + 3688, 2169, 1687, 1428, 1260, 1050, 918, 827, 758, 660, 592, 542, + 470, 421, 385, 357, 335 + ], + "offset": 1, + "sigma_g": 4, + "sigma_rb": 4 + }, + { + "class": "CLscv2", + "enable": false, + "matrix": [ + [ + 2715, 2577, 2379, 2254, 2095, 2004, 1859, 1754, 1665, 1590, 1508, 1451, 1375, 1331, 1290, 1254, 1234, 1229, 1228, 1246, 1267, 1299, 1340, 1387, 1426, 1489, 1536, 1590, 1641, 1716, 1777, 1863, 1915, 2679, 2508, 2349, 2194, 2077, 1944, 1822, 1740, 1656, 1576, 1487, 1435, 1377, 1315, 1276, 1243, 1221, 1215, 1218, 1236, 1255, 1290, 1325, 1373, 1423, 1463, 1521, 1577, 1631, 1682, 1765, 1826, 1898, 2538, 2431, 2271, 2128, 1999, 1883, 1806, 1681, 1611, 1530, 1460, 1387, 1336, 1286, 1247, 1215, 1198, 1189, 1190, 1205, 1231, 1259, 1303, 1338, 1386, 1431, 1486, 1535, 1591, 1647, 1701, 1789, 1835, 2505, 2351, 2206, 2062, 1928, 1869, 1753, 1677, 1562, 1493, 1423, 1354, 1304, 1255, 1211, 1183, 1163, 1156, 1161, 1175, 1198, 1230, 1263, 1311, 1349, 1400, 1448, 1505, 1551, 1613, 1660, 1728, 1787, 2489, 2295, 2168, 2007, 1989, 1788, 1714, 1628, 1552, 1474, 1404, 1342, 1281, 1238, 1195, 1166, 1149, 1141, 1144, 1159, 1186, 1208, 1254, 1293, 1337, 1383, 1428, 1481, 1527, 1585, 1637, 1709, 1769, 2378, 2262, 2121, 2020, 1886, 1795, 1702, 1626, 1548, 1468, 1406, 1335, 1278, 1235, 1193, 1159, 1147, 1136, 1139, 1158, 1177, 1211, 1249, 1286, 1329, 1382, 1427, 1473, 1527, 1584, 1625, 1696, 1760, 2339, 2244, 2116, 1999, 1861, 1765, 1688, 1600, 1530, 1444, 1396, 1320, 1267, 1215, 1179, 1146, 1128, 1122, 1124, 1139, 1166, 1195, 1232, 1269, 1319, 1360, 1407, 1457, 1505, 1557, 1614, 1669, 1725, 2272, 2181, 2050, 1931, 1832, 1738, 1650, 1572, 1503, 1427, 1362, 1292, 1254, 1195, 1155, 1123, 1106, 1101, 1103, 1119, 1144, 1173, 1209, 1251, 1296, 1335, 1383, 1434, 1480, 1534, 1585, 1650, 1706, 2256, 2150, 2026, 1919, 1813, 1725, 1642, 1562, 1490, 1414, 1348, 1290, 1231, 1186, 1143, 1113, 1095, 1090, 1090, 1107, 1133, 1162, 1197, 1241, 1283, 1329, 1371, 1425, 1466, 1519, 1567, 1625, 1676, 2186, 2079, 1983, 1873, 1781, 1680, 1602, 1528, 1457, 1386, 1325, 1263, 1205, 1159, 1118, 1089, 1079, 1066, 1068, 1078, 1105, 1137, 1178, 1214, 1260, 1302, 1346, 1388, 1435, 1491, 1536, 1595, 1639, 2194, 2096, 1971, 1868, 1763, 1686, 1607, 1531, 1460, 1385, 1322, 1261, 1204, 1160, 1118, 1086, 1075, 1067, 1067, 1083, 1106, 1135, 1171, 1218, 1259, 1303, 1348, 1396, 1439, 1489, 1543, 1591, 1645, 2187, 2075, 1968, 1861, 1772, 1686, 1606, 1539, 1458, 1388, 1326, 1260, 1212, 1159, 1116, 1085, 1075, 1067, 1073, 1081, 1105, 1138, 1176, 1219, 1258, 1305, 1349, 1395, 1439, 1486, 1540, 1595, 1643, 2128, 2045, 1937, 1824, 1734, 1653, 1598, 1504, 1441, 1370, 1301, 1245, 1184, 1141, 1094, 1072, 1062, 1048, 1053, 1068, 1083, 1118, 1151, 1196, 1237, 1283, 1328, 1372, 1415, 1465, 1514, 1569, 1608, 2097, 2014, 1899, 1808, 1712, 1635, 1570, 1489, 1417, 1349, 1286, 1226, 1173, 1124, 1080, 1058, 1037, 1035, 1040, 1051, 1070, 1100, 1139, 1179, 1222, 1263, 1309, 1356, 1395, 1447, 1501, 1544, 1607, 2133, 2033, 1916, 1821, 1730, 1654, 1569, 1510, 1432, 1361, 1295, 1239, 1182, 1136, 1092, 1066, 1050, 1037, 1041, 1060, 1077, 1113, 1147, 1192, 1231, 1280, 1322, 1370, 1412, 1465, 1508, 1567, 1614, 2120, 2023, 1957, 1821, 1725, 1663, 1581, 1505, 1438, 1370, 1300, 1239, 1185, 1137, 1092, 1071, 1048, 1037, 1044, 1063, 1081, 1110, 1154, 1190, 1238, 1279, 1328, 1372, 1412, 1461, 1513, 1567, 1618, 2104, 2010, 1886, 1806, 1710, 1629, 1561, 1488, 1422, 1351, 1281, 1226, 1171, 1125, 1082, 1057, 1036, 1024, 1032, 1049, 1070, 1099, 1138, 1180, 1219, 1266, 1309, 1355, 1398, 1443, 1494, 1548, 1599, 2105, 2017, 1915, 1797, 1720, 1654, 1562, 1491, 1425, 1367, 1286, 1228, 1175, 1124, 1081, 1057, 1037, 1029, 1034, 1053, 1072, 1103, 1141, 1179, 1229, 1267, 1312, 1359, 1401, 1450, 1500, 1557, 1598, 2156, 2041, 1944, 1835, 1750, 1674, 1586, 1522, 1444, 1377, 1306, 1252, 1194, 1145, 1107, 1078, 1062, 1049, 1056, 1070, 1091, 1120, 1159, 1202, 1245, 1289, 1334, 1380, 1428, 1475, 1529, 1574, 1633, 2196, 2061, 1944, 1848, 1745, 1672, 1593, 1518, 1450, 1371, 1341, 1245, 1202, 1147, 1110, 1078, 1059, 1058, 1056, 1071, 1089, 1125, 1163, 1203, 1251, 1293, 1338, 1386, 1428, 1479, 1531, 1595, 1628, 2133, 2054, 1953, 1835, 1740, 1657, 1583, 1515, 1444, 1368, 1313, 1247, 1192, 1142, 1107, 1074, 1058, 1050, 1051, 1066, 1089, 1118, 1159, 1198, 1241, 1287, 1330, 1374, 1424, 1472, 1524, 1581, 1628, 2194, 2094, 1975, 1873, 1771, 1692, 1608, 1534, 1462, 1394, 1328, 1265, 1211, 1161, 1117, 1085, 1070, 1065, 1067, 1080, 1103, 1139, 1173, 1219, 1262, 1310, 1354, 1403, 1445, 1506, 1543, 1609, 1650, 2229, 2138, 2026, 1914, 1814, 1724, 1639, 1567, 1493, 1419, 1357, 1290, 1241, 1188, 1144, 1110, 1091, 1086, 1089, 1105, 1132, 1161, 1204, 1243, 1286, 1334, 1376, 1423, 1471, 1529, 1578, 1632, 1692, 2252, 2159, 2032, 1919, 1821, 1731, 1653, 1570, 1501, 1421, 1357, 1299, 1241, 1193, 1147, 1117, 1098, 1089, 1090, 1112, 1134, 1171, 1206, 1249, 1293, 1335, 1387, 1436, 1477, 1530, 1583, 1649, 1688, 2282, 2192, 2059, 1948, 1826, 1741, 1659, 1576, 1506, 1429, 1364, 1301, 1243, 1201, 1155, 1122, 1106, 1094, 1104, 1116, 1142, 1172, 1215, 1251, 1297, 1343, 1392, 1429, 1484, 1542, 1589, 1645, 1719, 2358, 2226, 2103, 1982, 1879, 1774, 1692, 1607, 1534, 1457, 1389, 1325, 1273, 1224, 1182, 1147, 1126, 1118, 1126, 1140, 1169, 1197, 1239, 1281, 1322, 1368, 1420, 1464, 1517, 1568, 1625, 1692, 1731, 2421, 2300, 2152, 2049, 1924, 1825, 1728, 1650, 1574, 1491, 1426, 1358, 1298, 1254, 1210, 1172, 1159, 1152, 1152, 1172, 1196, 1226, 1266, 1306, 1350, 1402, 1448, 1501, 1551, 1613, 1659, 1728, 1788, 2470, 2341, 2206, 2080, 1954, 1847, 1746, 1661, 1583, 1504, 1436, 1369, 1310, 1262, 1219, 1188, 1169, 1162, 1168, 1182, 1206, 1238, 1276, 1322, 1367, 1411, 1458, 1511, 1568, 1615, 1680, 1747, 1813, 2510, 2379, 2241, 2091, 1969, 1860, 1759, 1680, 1591, 1511, 1440, 1374, 1318, 1271, 1227, 1192, 1175, 1168, 1172, 1190, 1215, 1245, 1279, 1323, 1370, 1420, 1473, 1517, 1571, 1631, 1691, 1764, 1817, 2566, 2445, 2279, 2142, 2009, 1897, 1799, 1696, 1619, 1536, 1468, 1401, 1339, 1290, 1245, 1215, 1193, 1186, 1190, 1208, 1230, 1264, 1301, 1344, 1390, 1435, 1489, 1540, 1601, 1658, 1719, 1792, 1858, 2695, 2550, 2361, 2211, 2092, 1960, 1844, 1750, 1656, 1576, 1504, 1434, 1375, 1322, 1276, 1247, 1228, 1218, 1221, 1249, 1261, 1296, 1330, 1375, 1429, 1481, 1529, 1583, 1634, 1705, 1770, 1856, 1915, 2798, 2629, 2443, 2299, 2137, 2020, 1895, 1789, 1695, 1615, 1540, 1464, 1406, 1352, 1311, 1273, 1255, 1251, 1251, 1275, 1292, 1325, 1368, 1403, 1462, 1511, 1560, 1626, 1675, 1744, 1820, 1908, 1973, 2879, 2705, 2513, 2342, 2193, 2038, 1935, 1829, 1731, 1625, 1563, 1483, 1422, 1374, 1324, 1291, 1267, 1267, 1266, 1282, 1308, 1337, 1382, 1426, 1476, 1530, 1587, 1634, 1708, 1778, 1861, 1934, 2018 + ], + [ + 2725, 2508, 2366, 2199, 2078, 1985, 1830, 1742, 1651, 1582, 1493, 1446, 1366, 1323, 1281, 1250, 1229, 1225, 1226, 1240, 1260, 1291, 1330, 1374, 1415, 1467, 1515, 1576, 1627, 1685, 1752, 1831, 1893, 2624, 2477, 2318, 2168, 2043, 1927, 1803, 1713, 1638, 1562, 1474, 1425, 1369, 1303, 1267, 1233, 1218, 1208, 1210, 1225, 1248, 1281, 1312, 1357, 1405, 1451, 1501, 1557, 1610, 1664, 1743, 1796, 1864, 2511, 2394, 2248, 2108, 1976, 1870, 1783, 1675, 1598, 1525, 1449, 1383, 1331, 1282, 1239, 1211, 1191, 1184, 1186, 1202, 1223, 1254, 1288, 1331, 1375, 1422, 1472, 1522, 1580, 1630, 1687, 1759, 1807, 2475, 2316, 2176, 2047, 1920, 1856, 1738, 1664, 1558, 1486, 1418, 1356, 1297, 1256, 1210, 1179, 1166, 1156, 1159, 1175, 1194, 1223, 1261, 1301, 1344, 1391, 1440, 1488, 1539, 1593, 1657, 1709, 1770, 2455, 2274, 2134, 1985, 1965, 1786, 1696, 1622, 1535, 1470, 1397, 1335, 1280, 1233, 1196, 1166, 1147, 1139, 1142, 1154, 1182, 1205, 1243, 1282, 1326, 1372, 1422, 1466, 1520, 1566, 1623, 1687, 1743, 2354, 2243, 2099, 1991, 1865, 1770, 1683, 1608, 1531, 1458, 1401, 1328, 1275, 1226, 1187, 1156, 1138, 1129, 1135, 1149, 1172, 1200, 1236, 1277, 1319, 1363, 1414, 1456, 1509, 1562, 1618, 1676, 1728, 2293, 2207, 2094, 1977, 1842, 1749, 1668, 1589, 1519, 1439, 1385, 1313, 1254, 1212, 1173, 1142, 1123, 1117, 1118, 1136, 1156, 1185, 1225, 1260, 1305, 1348, 1394, 1445, 1491, 1540, 1600, 1647, 1702, 2255, 2160, 2027, 1909, 1812, 1724, 1637, 1567, 1487, 1421, 1354, 1287, 1248, 1192, 1152, 1120, 1102, 1096, 1099, 1116, 1136, 1167, 1200, 1239, 1283, 1329, 1373, 1422, 1467, 1517, 1572, 1620, 1678, 2221, 2115, 2000, 1898, 1785, 1709, 1623, 1551, 1481, 1403, 1341, 1278, 1228, 1178, 1141, 1106, 1094, 1086, 1087, 1102, 1123, 1154, 1192, 1229, 1273, 1316, 1361, 1406, 1458, 1505, 1556, 1615, 1641, 2178, 2074, 1957, 1848, 1762, 1672, 1592, 1521, 1447, 1378, 1316, 1257, 1202, 1156, 1116, 1087, 1079, 1067, 1067, 1079, 1105, 1130, 1169, 1209, 1250, 1294, 1338, 1382, 1429, 1476, 1527, 1573, 1633, 2156, 2054, 1948, 1842, 1749, 1670, 1591, 1516, 1450, 1376, 1314, 1252, 1199, 1155, 1113, 1081, 1073, 1063, 1065, 1076, 1100, 1128, 1168, 1202, 1247, 1289, 1338, 1379, 1428, 1473, 1520, 1572, 1607, 2148, 2049, 1940, 1841, 1741, 1667, 1588, 1523, 1444, 1373, 1312, 1252, 1201, 1152, 1112, 1080, 1066, 1061, 1066, 1076, 1098, 1129, 1165, 1205, 1245, 1293, 1332, 1379, 1424, 1474, 1518, 1576, 1617, 2106, 2014, 1910, 1809, 1719, 1639, 1580, 1492, 1426, 1358, 1293, 1234, 1183, 1136, 1093, 1070, 1063, 1042, 1050, 1062, 1080, 1112, 1146, 1187, 1228, 1272, 1317, 1361, 1406, 1451, 1501, 1553, 1593, 2077, 2002, 1883, 1785, 1699, 1622, 1561, 1474, 1410, 1340, 1276, 1222, 1166, 1120, 1080, 1055, 1035, 1037, 1035, 1051, 1066, 1097, 1134, 1173, 1215, 1256, 1303, 1344, 1389, 1439, 1481, 1535, 1574, 2087, 2004, 1889, 1794, 1709, 1639, 1553, 1491, 1417, 1350, 1287, 1227, 1174, 1128, 1085, 1061, 1045, 1031, 1040, 1056, 1070, 1102, 1139, 1181, 1219, 1265, 1311, 1352, 1395, 1444, 1491, 1549, 1583, 2094, 1997, 1937, 1791, 1711, 1647, 1562, 1490, 1421, 1352, 1287, 1229, 1174, 1128, 1089, 1064, 1046, 1035, 1040, 1057, 1075, 1105, 1141, 1182, 1223, 1266, 1311, 1357, 1404, 1448, 1492, 1546, 1584, 2073, 1984, 1872, 1784, 1697, 1613, 1547, 1481, 1409, 1337, 1277, 1218, 1164, 1119, 1077, 1055, 1034, 1024, 1031, 1045, 1066, 1094, 1130, 1172, 1212, 1256, 1303, 1341, 1388, 1439, 1480, 1531, 1585, 2076, 1990, 1886, 1788, 1695, 1646, 1545, 1479, 1408, 1355, 1276, 1220, 1167, 1120, 1079, 1053, 1038, 1026, 1031, 1049, 1066, 1097, 1131, 1173, 1214, 1256, 1301, 1345, 1387, 1441, 1486, 1534, 1574, 2121, 2008, 1917, 1810, 1722, 1646, 1574, 1502, 1428, 1358, 1289, 1236, 1185, 1135, 1101, 1069, 1052, 1044, 1047, 1062, 1080, 1111, 1148, 1189, 1233, 1273, 1319, 1364, 1412, 1462, 1508, 1560, 1594, 2161, 2034, 1924, 1820, 1728, 1654, 1572, 1508, 1435, 1359, 1334, 1236, 1187, 1140, 1103, 1072, 1058, 1048, 1053, 1066, 1084, 1115, 1153, 1193, 1238, 1282, 1326, 1370, 1413, 1463, 1513, 1562, 1606, 2124, 2026, 1920, 1819, 1725, 1646, 1576, 1498, 1430, 1360, 1302, 1237, 1184, 1137, 1102, 1072, 1059, 1046, 1050, 1063, 1081, 1113, 1151, 1191, 1232, 1278, 1319, 1364, 1413, 1462, 1510, 1557, 1605, 2164, 2058, 1952, 1847, 1748, 1672, 1593, 1520, 1446, 1380, 1319, 1252, 1198, 1154, 1109, 1078, 1064, 1060, 1063, 1073, 1097, 1127, 1165, 1205, 1248, 1293, 1337, 1385, 1426, 1478, 1527, 1582, 1625, 2206, 2099, 1991, 1882, 1788, 1702, 1620, 1548, 1473, 1405, 1341, 1277, 1225, 1174, 1135, 1102, 1087, 1079, 1081, 1095, 1120, 1151, 1188, 1230, 1270, 1316, 1362, 1409, 1456, 1509, 1559, 1608, 1659, 2242, 2131, 2016, 1896, 1799, 1713, 1635, 1558, 1484, 1414, 1348, 1285, 1232, 1185, 1143, 1112, 1090, 1087, 1088, 1105, 1129, 1160, 1198, 1235, 1281, 1324, 1366, 1416, 1465, 1518, 1568, 1623, 1660, 2260, 2155, 2023, 1919, 1818, 1720, 1646, 1565, 1490, 1419, 1353, 1292, 1240, 1190, 1149, 1119, 1102, 1094, 1095, 1112, 1137, 1167, 1205, 1244, 1284, 1331, 1379, 1423, 1476, 1525, 1575, 1633, 1680, 2319, 2209, 2076, 1957, 1857, 1759, 1678, 1592, 1522, 1446, 1380, 1316, 1262, 1216, 1175, 1141, 1123, 1117, 1120, 1134, 1161, 1190, 1227, 1267, 1312, 1355, 1403, 1452, 1501, 1555, 1603, 1668, 1706, 2386, 2270, 2134, 2007, 1907, 1800, 1706, 1634, 1552, 1476, 1409, 1347, 1289, 1245, 1201, 1169, 1150, 1143, 1147, 1163, 1188, 1216, 1253, 1293, 1333, 1388, 1430, 1486, 1534, 1589, 1640, 1694, 1756, 2450, 2310, 2175, 2048, 1928, 1831, 1734, 1650, 1571, 1493, 1429, 1359, 1306, 1255, 1215, 1183, 1166, 1156, 1163, 1177, 1200, 1233, 1267, 1305, 1355, 1401, 1450, 1498, 1548, 1610, 1659, 1728, 1783, 2483, 2355, 2210, 2077, 1949, 1847, 1750, 1664, 1582, 1505, 1436, 1371, 1311, 1267, 1221, 1192, 1177, 1167, 1170, 1188, 1209, 1239, 1276, 1311, 1361, 1408, 1457, 1509, 1566, 1613, 1682, 1743, 1789, 2566, 2402, 2262, 2122, 2001, 1884, 1783, 1690, 1612, 1532, 1459, 1391, 1335, 1286, 1244, 1211, 1196, 1187, 1193, 1205, 1228, 1260, 1295, 1340, 1383, 1431, 1482, 1537, 1586, 1641, 1704, 1769, 1839, 2661, 2514, 2343, 2196, 2060, 1942, 1830, 1738, 1649, 1570, 1495, 1429, 1369, 1318, 1272, 1245, 1224, 1217, 1218, 1249, 1255, 1287, 1328, 1366, 1417, 1465, 1519, 1574, 1627, 1691, 1754, 1827, 1889, 2755, 2589, 2419, 2258, 2110, 1992, 1884, 1774, 1687, 1598, 1530, 1453, 1394, 1347, 1303, 1271, 1252, 1243, 1249, 1264, 1285, 1316, 1351, 1397, 1443, 1502, 1549, 1607, 1658, 1732, 1794, 1869, 1940, 2845, 2673, 2471, 2304, 2163, 2041, 1915, 1810, 1708, 1627, 1545, 1475, 1416, 1361, 1321, 1287, 1266, 1262, 1266, 1277, 1303, 1333, 1371, 1419, 1461, 1516, 1570, 1626, 1687, 1754, 1821, 1908, 1964 + ], + [ + 2715, 2537, 2359, 2210, 2096, 1991, 1840, 1741, 1659, 1581, 1494, 1447, 1369, 1320, 1279, 1246, 1233, 1223, 1223, 1238, 1264, 1291, 1331, 1373, 1417, 1475, 1519, 1577, 1625, 1693, 1763, 1837, 1898, 2607, 2466, 2328, 2166, 2051, 1927, 1803, 1721, 1638, 1566, 1480, 1423, 1368, 1303, 1267, 1234, 1216, 1209, 1212, 1225, 1249, 1278, 1317, 1357, 1406, 1451, 1500, 1556, 1611, 1664, 1744, 1802, 1874, 2527, 2397, 2251, 2116, 1988, 1871, 1792, 1678, 1601, 1532, 1452, 1387, 1332, 1283, 1242, 1209, 1193, 1186, 1187, 1203, 1223, 1251, 1291, 1330, 1380, 1427, 1476, 1524, 1573, 1640, 1688, 1771, 1822, 2460, 2336, 2180, 2065, 1925, 1862, 1749, 1670, 1559, 1490, 1420, 1356, 1302, 1254, 1211, 1181, 1164, 1155, 1159, 1173, 1196, 1227, 1260, 1304, 1347, 1391, 1444, 1493, 1546, 1596, 1658, 1717, 1782, 2468, 2270, 2147, 1994, 1972, 1785, 1704, 1622, 1544, 1465, 1398, 1337, 1278, 1235, 1193, 1167, 1146, 1140, 1143, 1155, 1179, 1209, 1241, 1283, 1328, 1372, 1420, 1468, 1527, 1577, 1633, 1689, 1744, 2343, 2254, 2096, 1999, 1869, 1776, 1687, 1616, 1537, 1457, 1400, 1330, 1274, 1225, 1188, 1154, 1139, 1131, 1134, 1150, 1170, 1200, 1239, 1279, 1319, 1367, 1416, 1463, 1516, 1564, 1622, 1675, 1727, 2307, 2214, 2097, 1984, 1848, 1756, 1669, 1594, 1521, 1439, 1388, 1313, 1253, 1212, 1173, 1141, 1123, 1118, 1120, 1134, 1158, 1186, 1223, 1261, 1308, 1354, 1399, 1445, 1497, 1545, 1600, 1652, 1715, 2262, 2165, 2042, 1914, 1821, 1721, 1643, 1568, 1493, 1424, 1353, 1290, 1254, 1192, 1152, 1122, 1102, 1096, 1099, 1115, 1140, 1166, 1204, 1242, 1287, 1328, 1374, 1422, 1473, 1521, 1576, 1630, 1671, 2226, 2122, 2016, 1902, 1794, 1715, 1624, 1550, 1483, 1409, 1342, 1278, 1229, 1180, 1140, 1107, 1093, 1085, 1087, 1101, 1127, 1156, 1189, 1234, 1275, 1320, 1367, 1412, 1457, 1508, 1563, 1609, 1660, 2170, 2085, 1959, 1859, 1761, 1679, 1599, 1523, 1451, 1383, 1316, 1260, 1201, 1156, 1119, 1083, 1082, 1066, 1067, 1081, 1103, 1134, 1167, 1211, 1250, 1294, 1338, 1384, 1432, 1480, 1533, 1577, 1624, 2166, 2062, 1952, 1848, 1752, 1673, 1592, 1522, 1445, 1376, 1315, 1252, 1199, 1154, 1112, 1080, 1070, 1061, 1064, 1075, 1099, 1128, 1165, 1205, 1249, 1292, 1339, 1379, 1431, 1479, 1527, 1579, 1622, 2151, 2055, 1946, 1839, 1754, 1668, 1591, 1525, 1448, 1376, 1313, 1255, 1199, 1152, 1109, 1081, 1067, 1061, 1068, 1076, 1097, 1130, 1166, 1206, 1247, 1294, 1338, 1381, 1428, 1475, 1526, 1572, 1627, 2121, 2019, 1918, 1822, 1721, 1652, 1587, 1495, 1431, 1358, 1298, 1236, 1182, 1136, 1093, 1070, 1063, 1043, 1050, 1061, 1081, 1111, 1148, 1188, 1231, 1276, 1318, 1366, 1409, 1457, 1505, 1558, 1600, 2091, 1998, 1888, 1788, 1700, 1627, 1565, 1480, 1414, 1341, 1279, 1220, 1167, 1122, 1078, 1054, 1035, 1034, 1037, 1050, 1068, 1096, 1134, 1171, 1217, 1259, 1303, 1350, 1393, 1438, 1488, 1540, 1572, 2085, 2003, 1897, 1800, 1716, 1640, 1557, 1490, 1420, 1350, 1285, 1229, 1175, 1126, 1087, 1061, 1044, 1033, 1039, 1054, 1073, 1102, 1140, 1180, 1221, 1264, 1311, 1353, 1399, 1448, 1495, 1544, 1593, 2096, 2007, 1940, 1799, 1714, 1654, 1568, 1495, 1423, 1351, 1290, 1230, 1176, 1129, 1088, 1064, 1044, 1036, 1040, 1059, 1076, 1105, 1143, 1183, 1225, 1271, 1317, 1355, 1408, 1453, 1500, 1553, 1590, 2069, 1989, 1878, 1793, 1705, 1619, 1549, 1489, 1409, 1341, 1279, 1215, 1168, 1118, 1079, 1052, 1035, 1024, 1032, 1049, 1065, 1097, 1133, 1171, 1214, 1257, 1301, 1348, 1393, 1440, 1490, 1537, 1582, 2093, 1997, 1887, 1794, 1698, 1652, 1545, 1483, 1409, 1357, 1279, 1222, 1164, 1121, 1079, 1054, 1036, 1026, 1031, 1048, 1067, 1095, 1136, 1172, 1217, 1260, 1302, 1348, 1395, 1442, 1491, 1541, 1584, 2119, 2017, 1924, 1814, 1725, 1657, 1574, 1506, 1424, 1360, 1292, 1239, 1184, 1135, 1100, 1069, 1050, 1044, 1046, 1063, 1081, 1111, 1149, 1190, 1233, 1277, 1321, 1365, 1411, 1465, 1512, 1563, 1609, 2165, 2039, 1930, 1822, 1733, 1656, 1582, 1511, 1437, 1363, 1330, 1237, 1188, 1140, 1103, 1073, 1058, 1051, 1054, 1066, 1084, 1117, 1153, 1195, 1238, 1282, 1328, 1373, 1418, 1472, 1519, 1569, 1612, 2124, 2027, 1926, 1822, 1729, 1657, 1574, 1507, 1432, 1357, 1306, 1237, 1183, 1136, 1101, 1072, 1055, 1047, 1049, 1061, 1085, 1114, 1151, 1191, 1233, 1280, 1322, 1367, 1414, 1464, 1513, 1562, 1604, 2173, 2065, 1951, 1851, 1756, 1670, 1600, 1521, 1447, 1385, 1318, 1252, 1202, 1153, 1109, 1080, 1067, 1060, 1062, 1072, 1096, 1130, 1167, 1204, 1250, 1293, 1339, 1385, 1431, 1488, 1529, 1589, 1625, 2210, 2105, 2003, 1882, 1793, 1703, 1623, 1553, 1478, 1404, 1341, 1279, 1224, 1176, 1132, 1102, 1084, 1080, 1081, 1095, 1120, 1153, 1190, 1231, 1275, 1320, 1365, 1414, 1459, 1511, 1560, 1616, 1659, 2242, 2137, 2020, 1903, 1806, 1716, 1637, 1561, 1487, 1416, 1349, 1286, 1232, 1183, 1142, 1111, 1094, 1085, 1089, 1107, 1130, 1162, 1196, 1240, 1281, 1324, 1371, 1421, 1472, 1521, 1575, 1627, 1672, 2260, 2155, 2034, 1913, 1817, 1730, 1643, 1575, 1492, 1417, 1353, 1294, 1237, 1192, 1150, 1118, 1101, 1092, 1096, 1111, 1138, 1167, 1203, 1244, 1285, 1332, 1381, 1431, 1476, 1525, 1582, 1635, 1687, 2329, 2210, 2082, 1968, 1861, 1758, 1678, 1596, 1521, 1449, 1378, 1316, 1262, 1214, 1174, 1141, 1122, 1117, 1120, 1134, 1163, 1189, 1224, 1269, 1311, 1358, 1405, 1458, 1499, 1558, 1612, 1666, 1717, 2389, 2265, 2138, 2017, 1899, 1807, 1713, 1636, 1555, 1475, 1409, 1345, 1289, 1242, 1201, 1166, 1149, 1141, 1147, 1163, 1188, 1218, 1256, 1294, 1335, 1388, 1437, 1483, 1539, 1596, 1644, 1705, 1757, 2443, 2325, 2179, 2050, 1935, 1831, 1731, 1650, 1575, 1495, 1427, 1364, 1303, 1256, 1215, 1182, 1167, 1156, 1161, 1180, 1202, 1231, 1268, 1309, 1356, 1404, 1450, 1504, 1557, 1613, 1662, 1729, 1787, 2486, 2350, 2215, 2081, 1952, 1853, 1753, 1667, 1588, 1505, 1437, 1368, 1316, 1265, 1220, 1192, 1173, 1169, 1172, 1187, 1209, 1243, 1278, 1315, 1363, 1414, 1462, 1513, 1567, 1621, 1683, 1755, 1798, 2562, 2424, 2268, 2130, 2001, 1884, 1789, 1691, 1611, 1535, 1459, 1394, 1335, 1284, 1243, 1215, 1193, 1189, 1191, 1206, 1229, 1262, 1294, 1338, 1383, 1432, 1484, 1538, 1597, 1646, 1716, 1775, 1832, 2665, 2511, 2340, 2196, 2069, 1949, 1831, 1740, 1652, 1568, 1496, 1426, 1368, 1315, 1274, 1241, 1223, 1216, 1218, 1247, 1256, 1290, 1329, 1371, 1419, 1468, 1524, 1578, 1626, 1694, 1756, 1832, 1898, 2742, 2594, 2433, 2268, 2115, 2006, 1881, 1782, 1690, 1606, 1528, 1459, 1394, 1347, 1300, 1270, 1253, 1244, 1246, 1265, 1283, 1320, 1356, 1398, 1449, 1499, 1556, 1614, 1667, 1732, 1801, 1880, 1957, 2837, 2678, 2472, 2307, 2172, 2035, 1916, 1809, 1707, 1630, 1547, 1478, 1417, 1363, 1319, 1289, 1263, 1264, 1268, 1276, 1301, 1334, 1372, 1414, 1467, 1519, 1576, 1632, 1689, 1763, 1845, 1912, 1981 + ], + [ + 2608, 2432, 2299, 2161, 2041, 1947, 1793, 1715, 1634, 1554, 1466, 1424, 1346, 1306, 1268, 1231, 1216, 1207, 1213, 1226, 1249, 1276, 1307, 1344, 1403, 1445, 1494, 1543, 1591, 1657, 1702, 1770, 1819, 2532, 2363, 2228, 2112, 1992, 1880, 1778, 1682, 1617, 1535, 1456, 1399, 1355, 1285, 1253, 1215, 1201, 1193, 1194, 1208, 1231, 1259, 1287, 1338, 1379, 1426, 1471, 1526, 1567, 1628, 1695, 1744, 1804, 2408, 2300, 2172, 2036, 1929, 1834, 1748, 1634, 1566, 1502, 1426, 1364, 1303, 1265, 1220, 1193, 1175, 1166, 1165, 1181, 1200, 1232, 1262, 1305, 1346, 1394, 1445, 1490, 1538, 1583, 1635, 1700, 1750, 2393, 2225, 2105, 2000, 1879, 1829, 1714, 1645, 1528, 1462, 1400, 1331, 1286, 1241, 1200, 1169, 1152, 1141, 1142, 1155, 1179, 1205, 1241, 1279, 1322, 1363, 1411, 1466, 1504, 1550, 1606, 1654, 1707, 2360, 2214, 2086, 1950, 1937, 1757, 1669, 1602, 1530, 1452, 1383, 1325, 1268, 1222, 1187, 1156, 1142, 1131, 1130, 1146, 1171, 1193, 1236, 1272, 1313, 1352, 1402, 1446, 1503, 1545, 1593, 1639, 1674, 2278, 2175, 2047, 1964, 1847, 1744, 1677, 1604, 1522, 1448, 1384, 1327, 1270, 1225, 1186, 1154, 1137, 1127, 1132, 1146, 1164, 1199, 1223, 1271, 1314, 1349, 1410, 1451, 1492, 1534, 1591, 1630, 1660, 2212, 2153, 2032, 1930, 1816, 1733, 1650, 1571, 1500, 1427, 1374, 1305, 1245, 1205, 1167, 1138, 1119, 1110, 1115, 1126, 1153, 1178, 1214, 1252, 1288, 1340, 1383, 1434, 1465, 1522, 1561, 1612, 1641, 2170, 2087, 1986, 1880, 1790, 1695, 1624, 1544, 1481, 1401, 1351, 1279, 1243, 1184, 1148, 1116, 1098, 1091, 1089, 1109, 1130, 1155, 1193, 1229, 1273, 1315, 1361, 1398, 1445, 1490, 1534, 1583, 1618, 2162, 2048, 1952, 1852, 1766, 1696, 1605, 1540, 1459, 1396, 1323, 1272, 1219, 1176, 1133, 1102, 1090, 1080, 1082, 1090, 1119, 1145, 1178, 1222, 1265, 1301, 1348, 1398, 1435, 1481, 1524, 1568, 1593, 2068, 2033, 1907, 1813, 1734, 1646, 1579, 1505, 1439, 1364, 1304, 1246, 1194, 1152, 1113, 1082, 1078, 1064, 1062, 1077, 1096, 1123, 1159, 1203, 1235, 1284, 1321, 1370, 1408, 1452, 1491, 1523, 1574, 2097, 2004, 1913, 1822, 1733, 1656, 1585, 1507, 1445, 1369, 1309, 1250, 1197, 1152, 1113, 1078, 1075, 1063, 1066, 1076, 1095, 1126, 1160, 1204, 1242, 1281, 1324, 1376, 1409, 1457, 1489, 1543, 1563, 2089, 2002, 1898, 1812, 1727, 1659, 1575, 1506, 1434, 1365, 1305, 1247, 1199, 1147, 1108, 1079, 1068, 1057, 1067, 1073, 1096, 1123, 1157, 1194, 1238, 1280, 1329, 1361, 1416, 1448, 1488, 1529, 1566, 2042, 1945, 1860, 1771, 1696, 1619, 1564, 1472, 1410, 1342, 1283, 1223, 1172, 1131, 1083, 1063, 1059, 1039, 1045, 1055, 1072, 1099, 1138, 1171, 1215, 1256, 1300, 1344, 1379, 1424, 1459, 1499, 1535, 2002, 1952, 1840, 1771, 1678, 1610, 1555, 1462, 1398, 1326, 1264, 1212, 1161, 1115, 1073, 1052, 1031, 1034, 1034, 1044, 1061, 1088, 1125, 1162, 1205, 1245, 1293, 1332, 1365, 1407, 1448, 1491, 1533, 2050, 1948, 1867, 1775, 1698, 1626, 1544, 1479, 1408, 1337, 1281, 1222, 1172, 1124, 1085, 1061, 1043, 1035, 1036, 1058, 1070, 1100, 1137, 1173, 1213, 1260, 1304, 1340, 1383, 1428, 1465, 1499, 1535, 2021, 1949, 1895, 1761, 1694, 1626, 1555, 1482, 1410, 1339, 1280, 1221, 1170, 1124, 1085, 1061, 1042, 1033, 1037, 1054, 1073, 1095, 1134, 1173, 1217, 1251, 1297, 1338, 1383, 1423, 1461, 1504, 1528, 2010, 1926, 1828, 1763, 1674, 1596, 1538, 1462, 1394, 1323, 1264, 1204, 1155, 1108, 1070, 1044, 1029, 1024, 1025, 1042, 1057, 1083, 1120, 1158, 1199, 1248, 1282, 1328, 1360, 1402, 1438, 1486, 1513, 2014, 1930, 1848, 1763, 1682, 1633, 1539, 1467, 1403, 1343, 1267, 1214, 1161, 1117, 1074, 1055, 1034, 1027, 1029, 1047, 1065, 1089, 1127, 1168, 1206, 1246, 1287, 1334, 1378, 1419, 1449, 1497, 1521, 2050, 1977, 1879, 1789, 1709, 1640, 1561, 1493, 1413, 1352, 1286, 1231, 1184, 1128, 1099, 1068, 1051, 1042, 1046, 1063, 1078, 1109, 1144, 1184, 1225, 1267, 1308, 1355, 1395, 1435, 1473, 1517, 1567, 2085, 1969, 1873, 1793, 1711, 1631, 1553, 1492, 1419, 1345, 1312, 1229, 1180, 1134, 1093, 1065, 1050, 1041, 1045, 1060, 1078, 1107, 1143, 1185, 1224, 1265, 1308, 1348, 1391, 1432, 1474, 1517, 1539, 2045, 1970, 1881, 1779, 1698, 1629, 1559, 1482, 1415, 1344, 1292, 1228, 1175, 1124, 1096, 1064, 1052, 1041, 1045, 1054, 1077, 1107, 1141, 1178, 1219, 1262, 1308, 1341, 1386, 1425, 1468, 1504, 1549, 2092, 2018, 1907, 1822, 1733, 1655, 1576, 1507, 1437, 1376, 1312, 1245, 1196, 1151, 1106, 1079, 1065, 1061, 1063, 1070, 1095, 1124, 1163, 1200, 1239, 1281, 1322, 1370, 1406, 1456, 1496, 1532, 1578, 2139, 2046, 1951, 1855, 1771, 1683, 1614, 1537, 1462, 1387, 1333, 1270, 1219, 1166, 1131, 1099, 1084, 1074, 1080, 1091, 1117, 1146, 1185, 1223, 1266, 1307, 1352, 1393, 1434, 1481, 1522, 1565, 1593, 2163, 2054, 1971, 1857, 1775, 1685, 1616, 1542, 1464, 1395, 1331, 1273, 1217, 1176, 1131, 1099, 1086, 1077, 1081, 1097, 1123, 1150, 1190, 1225, 1265, 1308, 1352, 1393, 1437, 1490, 1520, 1569, 1602, 2193, 2096, 1985, 1876, 1793, 1704, 1625, 1554, 1478, 1407, 1341, 1286, 1224, 1181, 1144, 1113, 1096, 1086, 1091, 1107, 1136, 1161, 1196, 1233, 1275, 1313, 1365, 1409, 1446, 1493, 1532, 1581, 1627, 2245, 2134, 2041, 1933, 1831, 1742, 1665, 1584, 1512, 1437, 1367, 1308, 1257, 1211, 1172, 1141, 1121, 1113, 1116, 1136, 1161, 1185, 1221, 1260, 1304, 1350, 1395, 1441, 1477, 1527, 1572, 1613, 1669, 2315, 2188, 2097, 1989, 1874, 1783, 1687, 1623, 1532, 1467, 1395, 1337, 1276, 1234, 1194, 1162, 1147, 1140, 1138, 1159, 1180, 1209, 1244, 1283, 1328, 1374, 1425, 1456, 1516, 1557, 1601, 1655, 1685, 2327, 2233, 2114, 1987, 1901, 1794, 1703, 1625, 1547, 1474, 1406, 1340, 1287, 1242, 1203, 1170, 1153, 1144, 1150, 1167, 1187, 1218, 1251, 1295, 1332, 1380, 1426, 1476, 1519, 1562, 1612, 1660, 1712, 2375, 2273, 2142, 2022, 1902, 1814, 1715, 1638, 1550, 1477, 1412, 1347, 1294, 1249, 1204, 1175, 1162, 1151, 1155, 1169, 1192, 1225, 1253, 1295, 1334, 1386, 1431, 1478, 1529, 1569, 1630, 1680, 1724, 2478, 2312, 2195, 2067, 1959, 1845, 1759, 1664, 1581, 1511, 1432, 1377, 1313, 1268, 1231, 1198, 1179, 1175, 1173, 1191, 1213, 1246, 1278, 1319, 1359, 1412, 1454, 1506, 1543, 1599, 1657, 1709, 1764, 2551, 2415, 2253, 2142, 2014, 1904, 1788, 1706, 1617, 1536, 1475, 1399, 1341, 1294, 1258, 1223, 1213, 1201, 1202, 1231, 1235, 1269, 1308, 1343, 1393, 1439, 1490, 1534, 1592, 1635, 1693, 1756, 1812, 2611, 2486, 2322, 2183, 2049, 1945, 1836, 1736, 1647, 1566, 1497, 1424, 1364, 1318, 1273, 1247, 1224, 1223, 1220, 1240, 1257, 1288, 1323, 1369, 1406, 1459, 1509, 1564, 1609, 1676, 1738, 1803, 1838, 2696, 2538, 2345, 2231, 2065, 1986, 1841, 1750, 1651, 1578, 1501, 1431, 1373, 1324, 1287, 1252, 1236, 1227, 1225, 1244, 1263, 1291, 1332, 1369, 1422, 1463, 1524, 1574, 1628, 1683, 1752, 1803, 1893 + ] + ], + "x_size": [ + 28, 35, 38, 41, 43, 47, 51, 56, 63, 66, 73, 76, 79, 88, 89, 87, 87, 89, 88, 79, 76, 73, 66, 63, 56, 51, 47, 43, 41, 38, 35, 28 + ], + "y_size": [ + 27, 29, 29, 30, 32, 31, 33, 33, 35, 35, 37, 37, 37, 39, 38, 38 + ] + }, + { + "class": "CWdrv4", + "contrast": 400, + "enable": false, + "entropy": [ + 0, 0, 0, 2, 3, 6, 11, 22, 39, 67, 111, 177, 227, 266, 321, 355, 377, + 355, 221, 0 + ], + "entropy_base": 200, + "entropy_slope": 700, + "flat_strength": 8, + "flat_thr": 1, + "gamma_down": [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 16, 36, 64, 136, 256, 576, + 1023 + ], + "gamma_pre": [ + 0, 31514, 36815, 42173, 47646, 53350, 59514, 66602, 75530, 88145, + 108135, 142869, 175428, 207095, 269144, 330303, 442139, 571475, + 810472, 1048575 + ], + "gamma_up": [ + 0, 1024, 34837, 56737, 82912, 116814, 162079, 223337, 306767, + 420749, 576707, 735048, 745499, 755950, 776852, 797754, 839557, + 881361, 964968, 1048575 + ], + "global_strength": 0, + "high_strength": 90, + "low_strength": 16, + "strength": 128 + }, + { + "blend_motion": 80, + "blend_slope": 2, + "blend_static": 20, + "class": "C3dnrv3_1", + "dialte_h": 3, + "enable": false, + "filter_len": 20, + "filter_len2": 10, + "motion_dilate_en": true, + "motion_erode_en": true, + "nlm_en": true, + "noise_level": 60, + "noisemodel_a": 4, + "noisemodel_b": 16, + "pregamma_en": true, + "preweight": 8, + "range_h": 7, + "range_v": 3, + "sadweight": 8, + "sigma": 5, + "strength": 120, + "thr_motion_slope": 32, + "tnr_en": true + }, + { + "bright": 0, + "class": "CCproc", + "yuvRange": 2, + "contrast": 1, + "enable": true, + "hue": 0, + "saturation": 1 + }, + { + "ca_curve": [ + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 + ], + "ca_en": false, + "ca_mode": 1, + "class": "CEEv1", + "curve_en": true, + "dci_curve": [ + 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, + 240, 256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, + 448, 464, 480, 496, 512, 528, 544, 560, 576, 592, 608, 624, 640, + 656, 672, 688, 704, 720, 736, 752, 768, 784, 800, 816, 832, 848, + 864, 880, 896, 912, 928, 944, 960, 976, 992, 1008, 1023 + ], + "dci_en": false, + "ee_edge_gain": 2000, + "ee_src_strength": 1, + "ee_strength": 100, + "ee_uv_gain": 0, + "ee_y_down_gain": 8000, + "ee_y_up_gain": 5000, + "enable": true, + "degamma": 1.0, + "dci_mode": 0, + "low_luma_index": 1.0, + "middle_luma_index": 1.0, + "high_luma_index": 1.0, + "inflct_start_y": 0, + "inflct_1_x": 16, + "inflct_1_y": 16, + "inflct_2_x": 32, + "inflct_2_y": 32, + "inflct_stop_y": 64 + }, + { + "a_blue": 0, + "a_red": 0, + "b_blue": 0, + "b_red": 0, + "c_blue": 0, + "c_red": 0, + "cac_enable": false, + "center_h_offs": 0, + "center_v_offs": 0, + "class": "CDmscv2", + "demoire_edge_r1": 251, + "demoire_edge_r2": 256, + "demoire_edge_t1": 80, + "demoire_edge_t2_shift": 3, + "demosaic_enable": true, + "demosaic_thr": 0, + "dmsc_demoire_area_thr": 3, + "dmsc_demoire_enable": false, + "dmsc_demoire_r1": 0, + "dmsc_demoire_r2": 256, + "dmsc_demoire_sat_shrink": 8, + "dmsc_demoire_t1": 8, + "dmsc_demoire_t2_shift": 4, + "dmsc_denoise_strength": 0, + "dmsc_depurple_cbcr_mode": 3, + "dmsc_depurple_enable": false, + "dmsc_depurple_sat_shrink": 3, + "dmsc_depurple_thr": 8, + "dmsc_dir_thr_max": 0, + "dmsc_dir_thr_min": 0, + "dmsc_sharpen_clip_black": 500, + "dmsc_sharpen_clip_white": 500, + "dmsc_sharpen_enable": true, + "dmsc_sharpen_factor_black": 200, + "dmsc_sharpen_factor_white": 200, + "dmsc_sharpen_line_enable": false, + "dmsc_sharpen_line_r1": 5, + "dmsc_sharpen_line_r2": 200, + "dmsc_sharpen_line_strength": 4095, + "dmsc_sharpen_line_thr": 1000, + "dmsc_sharpen_line_thr_shift1": 5, + "dmsc_sharpen_r1": 0, + "dmsc_sharpen_r2": 0, + "dmsc_sharpen_r3": 0, + "dmsc_sharpen_size": 16, + "dmsc_sharpen_t1": 0, + "dmsc_sharpen_t2_shift": 0, + "dmsc_sharpen_t3": 0, + "dmsc_sharpen_t4_shift": 0, + "dmsc_skin_cb_thr_max": 0, + "dmsc_skin_cb_thr_min": 0, + "dmsc_skin_cr_thr_max": 0, + "dmsc_skin_cr_thr_min": 0, + "dmsc_skin_enable": false, + "dmsc_skin_y_thr_max": 0, + "dmsc_skin_y_thr_min": 0 + } + ] + } + ] +} diff --git a/buildroot-overlay/package/vvcam/configs/ov5647.xml b/buildroot-overlay/package/vvcam/configs/ov5647.xml new file mode 100644 index 0000000..72fd533 --- /dev/null +++ b/buildroot-overlay/package/vvcam/configs/ov5647.xml @@ -0,0 +1,1605 @@ + + +
+ + 13-Jan-2021 + + + VSI + + + OS08A20_FPGA + + + 8MLens_02 + + + v2.0.19 + + + + + 1920x1080 + + + 0x00000001 + + + [ 1920] + + + [ 1080] + + + + + FPS_15 + + + [ 14.9916] + + + + + FPS_10 + + + [ 9.9944] + + + + + FPS_05 + + + [ 4.9972] + + + + + +
+ + + + [6 6 128 256] + + + + + + + 1920x1080 + + + 1920x1080 + + + [0.327085 0.438344 0.23457] + + + [-0.701264 -0.0115438 0.712808 0.418205 -0.816415 0.39821] + + + [-0.806822 -0.590795 -2.6856] + + + [0.995 1.11562 1.2508 1.34956 1.44833 1.55225 1.59072 1.67066 1.78393 1.88487 2.04092 2.13969 2.22396 2.29624 2.35492 2.4349] + + + [0.154354 0.106619 0.061968 0.0310305 0.00418765 0.0620936 0.238853 0.263946 0.166529 0.0485834 -0.0385808 -0.0106964 0.0281462 0.0794464 0.127288 0.20841] + + + [0.995 1.12875 1.2508 1.34956 1.44833 1.5471 1.64586 1.74463 1.84339 1.94216 2.04092 2.1409 2.21633 2.30556 2.38143 2.4349] + + + [-0.0395026 0.0147157 0.058032 0.0889695 0.115812 0.139005 0.157346 0.169761 0.175397 0.17245 0.158581 0.13991 0.109243 0.0586642 0.00704189 -0.05677] + + + [0.8 0.918317 1.03663 1.15495 1.27327 1.39158 1.51645 1.56595 1.69014 1.84726 1.98317 2.10148 2.20478 2.29603 2.37356 2.4758] + + + [0.355654 0.305185 0.258426 0.214367 0.174584 0.139125 0.170938 0.317311 0.332925 0.169218 0.071868 0.0967314 0.135492 0.190735 0.258194 0.36671] + + + [0.8 0.918317 1.03663 1.15495 1.27327 1.39158 1.5099 1.62822 1.74653 1.86485 1.98317 2.10148 2.2198 2.29152 2.39117 2.4753] + + + [0.00434573 0.0548153 0.101574 0.145633 0.185416 0.220875 0.250999 0.274321 0.290001 0.295548 0.288132 0.263269 0.215941 0.174965 0.100294 0.013567] + + + [ 0.995] + + + [ 2.4347] + + + [ 2.4747] + + + [ 1.9422] + + + D50 + + + [ 3.1754] + + + [0.75 1.28836 1.77672 2.164 2.6 3.0618] + + + [114 114 105 95 95 90] + + + [83 83 110 120 122 128] + + + [28 27 18 16 9 9] + + + [123 123 123 123 123 120] + + + [123 123 123 123 123 126] + + + [5 5 5 5 5 5] + + + [ 1] + + + [ 0.8] + + + [ 0.05] + + + + [ 0.05] + + + [ 0.05] + + + [ 0.4] + + + [ 0.5] + + + [ 0.9] + + + [ 0.5] + + + [ 50] + + + [ 1] + + + [ 0.5] + + + + + + + + A + + + Indoor + + + + [1756.76 2080.32 2080.32 4124.98] + + + [ 271.9119] + + + [0.9 0.95] + + + [-0.0681442 -0.035073] + + + + + + 1920x1080 + + + 1920x1080_A_90 + + + + + [1.29861 1 1 2.7191] + + + [1.79208 -0.198145 -0.574427 -0.736462 2.07131 -0.252126 0.0406771 -1.85276 2.9297] + + + [-79.894 -70.2343 -142.9449] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + A_100 + + + + + + D50 + + + Outdoor + + + + [372.984 199.983 199.983 1717.7201] + + + [ 123.3517] + + + [1 1] + + + [0.098966 -0.051827] + + + + + + 1920x1080 + + + 1920x1080_D50_90 + + + + + [2.03176 1 1 1.6856] + + + [1.8971 -0.68931 -0.189578 -0.439486 1.85772 -0.363208 -0.00556919 -0.805211 1.8949] + + + [-74.5768 -58.993 -83.6998] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + D50_100 + + + + + + D65 + + + Outdoor + + + + [314.718 -52.939 -52.939 1435.9119] + + + [ 106.6582] + + + [1 1] + + + [0.154464 -0.031993] + + + + + + 1920x1080 + + + 1920x1080_D65_90 + + + + + [2.25275 1 1 1.3939] + + + [1.91996 -0.737372 -0.16497 -0.390371 1.87095 -0.429982 -0.0116974 -0.742648 1.8593] + + + [-72.1478 -56.5678 -78.7406] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + D65_100 + + + + + + D75 + + + Outdoor + + + + [318.443 -139.254 -139.254 1365.6664] + + + [ 102.5896] + + + [1 1] + + + [0.183948 -0.035073] + + + + + + 1920x1080 + + + 1920x1080_D75_90 + + + + + [2.53436 1 1 1.3216] + + + [2.06265 -0.906923 -0.138793 -0.328267 1.80435 -0.40235 -0.00832665 -0.614651 1.7507] + + + [-69.3699 -50.9566 -79.3041] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + D75_100 + + + + + + F11 (TL84) + + + Indoor + + + + [394.499 72.4509 72.4509 1250.0547] + + + [ 111.169] + + + [0.9 0.95] + + + [-0.00111496 -0.047418] + + + + + + 1920x1080 + + + 1920x1080_F11_90 + + + + + [1.54875 1 1 2.22] + + + [1.8945 -0.613902 -0.26542 -0.680027 2.04979 -0.286085 -0.0488421 -0.910602 2.0246] + + + [-62.1546 -68.9576 -94.2628] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + F11_100 + + + + + + F12 + + + Indoor + + + + [658.177 466.573 466.573 1663.4321] + + + [ 149.058] + + + [1 1] + + + [-0.0886111 -0.035296] + + + + + + 1920x1080 + + + 1920x1080_F12_90 + + + + + [1.25028 1 1 2.9754] + + + [1.96163 -0.525891 -0.419709 -0.807525 2.17333 -0.29513 -0.0741742 -1.39696 2.5138] + + + [-65.6438 -68.4671 -91.182] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + F12_100 + + + + + + F2 (CWF) + + + Indoor + + + + [446.603 -192.135 -192.135 1336.663] + + + [ 119.1051] + + + [0.9 0.95] + + + [0.0308396 -0.084126] + + + + + + 1920x1080 + + + 1920x1080_F2_90 + + + + + [1.87464 1 1 2.2715] + + + [2.40858 -1.16543 -0.225184 -0.587047 1.8635 -0.196449 -0.0505826 -0.951502 2.1198] + + + [-73.612 -79.3348 -109.7283] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + F2_100 + + + + + + + + + 1920x1080_A_90 + + + 1920x1080 + + + A + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [21 43 70 93 130 170 210 223] + + + [41 52 62 68 76 70 85 86] + + + [ 90] + + + [6272 5422 4083 2920 2103 1790 1501 1340 1341 1398 1611 1906 2241 3003 3974 5473 6045 5427 4706 3635 2685 2021 1724 1444 1288 1283 1352 1549 1834 2154 2664 3866 4391 5427 4559 4028 3217 2460 1947 1643 1381 1219 1226 1287 1479 1757 2050 2489 3041 4086 4371 3887 3507 2891 2278 1882 1569 1314 1155 1180 1225 1409 1671 1961 2242 2875 3386 3809 3450 3143 2619 2155 1822 1497 1246 1139 1118 1179 1345 1601 1890 2142 2559 3075 3330 3138 2881 2437 2074 1762 1418 1213 1110 1076 1136 1295 1516 1777 2010 2359 2758 3011 2967 2736 2328 2035 1735 1378 1223 1084 1050 1108 1265 1457 1718 1869 2024 2778 2558 2814 2617 2257 1994 1727 1431 1204 1068 1028 1089 1224 1396 1694 1829 2050 2252 2502 2781 2570 2238 1977 1716 1439 1196 1065 1024 1085 1226 1410 1694 1869 2088 2317 2497 2824 2617 2252 2001 1723 1448 1205 1075 1031 1093 1231 1427 1686 1877 2091 2421 2640 2950 2735 2335 2032 1766 1474 1230 1101 1063 1110 1259 1452 1749 1950 2196 2580 2790 3135 2908 2451 2087 1822 1449 1227 1148 1094 1143 1290 1499 1783 1994 2318 2752 2993 3492 3174 2655 2166 1881 1487 1271 1175 1132 1186 1318 1565 1851 2109 2545 3060 3312 3958 3562 2931 2303 1962 1558 1327 1233 1157 1229 1383 1629 1932 2227 2850 3401 3816 4707 4144 3308 2521 2052 1641 1384 1299 1185 1286 1449 1718 2001 2443 3120 4009 4444 5607 4886 3749 2776 2159 1721 1435 1350 1278 1334 1520 1803 2099 2688 3660 4605 5341 6564 5738 4245 3059 2286 1795 1497 1389 1343 1395 1595 1884 2224 2965 4055 5466 6239] + + + [5172 4449 3392 2437 1768 1547 1337 1232 1257 1295 1453 1658 1884 2504 3277 4429 4970 4433 3897 3025 2261 1708 1496 1296 1194 1216 1265 1406 1605 1830 2224 3196 3612 4398 3766 3340 2698 2068 1658 1437 1248 1146 1174 1223 1360 1553 1757 2083 2551 3376 3571 3228 2921 2416 1921 1618 1379 1201 1100 1145 1177 1311 1492 1697 1894 2409 2829 3165 2869 2634 2204 1831 1576 1330 1152 1099 1095 1145 1265 1442 1651 1826 2148 2571 2760 2628 2415 2052 1772 1531 1267 1133 1080 1067 1112 1231 1380 1560 1723 1985 2305 2532 2481 2290 1962 1742 1520 1235 1148 1062 1043 1093 1210 1336 1512 1604 1698 2330 2114 2358 2181 1903 1708 1514 1293 1140 1052 1026 1079 1175 1285 1499 1574 1733 1869 2071 2321 2151 1889 1700 1503 1305 1133 1051 1024 1074 1181 1300 1502 1611 1767 1930 2067 2352 2184 1899 1715 1511 1307 1142 1059 1027 1083 1185 1316 1494 1612 1769 2013 2200 2467 2283 1956 1736 1540 1327 1158 1081 1057 1094 1207 1333 1541 1678 1853 2143 2319 2612 2430 2056 1772 1585 1293 1147 1121 1080 1122 1226 1370 1563 1706 1946 2295 2480 2883 2632 2222 1828 1628 1319 1176 1139 1109 1156 1246 1409 1618 1795 2135 2549 2755 3303 2949 2461 1940 1686 1371 1217 1183 1123 1186 1293 1458 1673 1881 2391 2831 3137 3884 3427 2751 2124 1751 1435 1253 1232 1139 1226 1338 1524 1715 2059 2617 3307 3649 4609 4022 3115 2340 1830 1496 1289 1263 1216 1261 1394 1585 1793 2248 3046 3779 4379 5352 4678 3527 2552 1937 1544 1331 1283 1266 1302 1445 1640 1877 2485 3352 4399 5085] + + + [5183 4439 3411 2440 1774 1545 1339 1230 1258 1298 1454 1667 1898 2528 3317 4511 5155 4464 3906 3040 2270 1709 1498 1296 1194 1215 1269 1410 1615 1839 2248 3237 3662 4420 3768 3356 2704 2077 1657 1439 1251 1147 1173 1226 1364 1561 1766 2104 2574 3419 3639 3249 2926 2422 1924 1621 1381 1205 1100 1145 1179 1316 1498 1709 1906 2436 2849 3175 2879 2633 2208 1836 1577 1334 1153 1099 1096 1148 1269 1451 1663 1838 2167 2599 2796 2620 2419 2052 1776 1535 1268 1133 1083 1068 1118 1236 1390 1573 1735 2007 2320 2547 2485 2294 1960 1745 1519 1236 1151 1064 1046 1095 1214 1346 1523 1614 1714 2369 2130 2368 2187 1908 1713 1516 1293 1144 1054 1027 1083 1180 1293 1511 1583 1745 1873 2090 2331 2148 1888 1702 1507 1306 1137 1052 1024 1079 1186 1307 1509 1625 1775 1950 2083 2366 2185 1903 1713 1513 1308 1145 1059 1030 1086 1190 1323 1505 1622 1780 2020 2208 2453 2276 1959 1735 1544 1331 1158 1081 1056 1098 1209 1339 1551 1690 1866 2162 2338 2614 2429 2048 1777 1584 1295 1149 1121 1082 1122 1232 1376 1573 1715 1952 2314 2488 2886 2627 2219 1827 1631 1318 1176 1136 1111 1156 1251 1414 1623 1804 2144 2560 2778 3277 2941 2451 1937 1683 1372 1215 1182 1124 1185 1295 1466 1681 1891 2396 2839 3160 3851 3408 2739 2114 1749 1432 1252 1227 1137 1224 1340 1526 1722 2060 2629 3315 3647 4532 3982 3099 2329 1826 1490 1285 1260 1212 1259 1390 1589 1795 2258 3048 3776 4357 5346 4608 3489 2548 1926 1536 1327 1280 1259 1300 1445 1644 1878 2484 3346 4427 4992] + + + [4686 4092 3172 2303 1693 1480 1292 1211 1243 1276 1414 1599 1806 2363 3077 4084 4606 4132 3595 2843 2145 1639 1437 1261 1177 1206 1255 1377 1557 1759 2118 2973 3344 3954 3459 3121 2561 1985 1597 1389 1228 1139 1174 1222 1347 1517 1707 1991 2408 3140 3318 3008 2769 2288 1853 1565 1344 1191 1100 1145 1181 1308 1469 1651 1830 2284 2662 2918 2706 2476 2105 1774 1524 1302 1145 1102 1100 1151 1265 1425 1606 1768 2031 2406 2589 2462 2295 1958 1717 1488 1244 1130 1084 1071 1119 1236 1370 1531 1672 1895 2157 2344 2330 2174 1874 1690 1479 1215 1149 1068 1047 1099 1215 1330 1484 1550 1617 2197 1972 2210 2065 1824 1661 1476 1279 1144 1054 1027 1085 1182 1277 1476 1526 1657 1745 1929 2188 2035 1812 1647 1466 1289 1137 1053 1024 1079 1185 1294 1480 1561 1688 1810 1933 2220 2055 1821 1658 1473 1288 1145 1058 1029 1084 1189 1305 1470 1557 1693 1881 2030 2308 2149 1866 1682 1496 1308 1156 1084 1054 1097 1206 1317 1511 1626 1766 2014 2171 2456 2260 1948 1710 1536 1270 1142 1124 1082 1120 1225 1353 1525 1651 1841 2149 2303 2671 2455 2097 1756 1572 1288 1169 1140 1111 1157 1243 1384 1572 1728 2011 2376 2501 3058 2735 2298 1856 1623 1329 1202 1181 1121 1181 1288 1428 1622 1798 2228 2619 2889 3504 3142 2569 2002 1677 1378 1230 1217 1125 1219 1314 1482 1650 1940 2442 3018 3281 4135 3612 2879 2188 1731 1427 1246 1240 1191 1237 1358 1521 1704 2098 2786 3398 3862 4703 4180 3234 2362 1812 1461 1276 1250 1231 1271 1392 1568 1769 2298 3038 3907 4460] + + + + + 1920x1080_D50_90 + + + 1920x1080 + + + D50 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [21 43 72 102 135 173 199 215] + + + [44 55 61 68 76 68 84 84] + + + [ 90] + + + [5576 4730 3523 2520 1901 1596 1376 1262 1313 1365 1540 1800 2068 2772 3716 5043 5705 4710 4141 3130 2312 1820 1531 1318 1217 1254 1316 1480 1733 2000 2452 3558 4038 4946 4083 3567 2808 2109 1762 1465 1260 1190 1196 1259 1412 1656 1916 2295 2810 3760 4009 3513 3185 2560 1980 1708 1411 1223 1166 1145 1204 1354 1579 1849 2099 2680 3165 3558 3172 2864 2382 1905 1643 1390 1191 1132 1098 1155 1301 1514 1781 2018 2367 2863 3085 2866 2668 2227 1872 1591 1353 1157 1103 1066 1115 1257 1466 1694 1891 2208 2607 2837 2717 2519 2145 1851 1557 1318 1149 1083 1037 1093 1228 1435 1665 1903 2087 2756 2551 2608 2408 2084 1834 1543 1286 1149 1061 1028 1074 1210 1406 1640 1880 2098 2276 2501 2562 2383 2070 1838 1543 1258 1159 1057 1024 1072 1207 1404 1626 1871 2066 2211 2407 2612 2406 2095 1860 1567 1259 1159 1065 1034 1082 1215 1405 1624 1871 2066 2335 2573 2715 2532 2172 1896 1638 1340 1170 1105 1051 1104 1248 1399 1636 1894 2109 2464 2654 2907 2675 2261 1946 1678 1375 1195 1146 1079 1131 1281 1404 1671 1937 2191 2605 2843 3172 2921 2463 2012 1747 1421 1236 1164 1123 1174 1321 1459 1734 2002 2381 2858 3106 3627 3255 2705 2130 1815 1482 1274 1209 1170 1223 1361 1545 1795 2107 2676 3197 3562 4258 3792 3024 2318 1885 1547 1281 1268 1207 1276 1414 1635 1859 2283 2925 3734 4071 5088 4484 3481 2565 1977 1618 1331 1323 1230 1311 1480 1708 1961 2484 3409 4271 4992 6100 5302 4001 2837 2090 1695 1406 1352 1328 1354 1543 1784 2063 2787 3759 5072 5744] + + + [4631 3988 2976 2154 1633 1395 1234 1167 1234 1277 1411 1598 1782 2367 3130 4250 4823 4050 3477 2666 1971 1579 1349 1199 1139 1199 1246 1367 1550 1741 2107 3036 3432 4124 3432 3032 2399 1807 1530 1299 1155 1128 1156 1208 1321 1497 1681 1972 2428 3208 3416 3010 2708 2205 1698 1490 1260 1130 1121 1119 1167 1278 1437 1638 1821 2314 2711 3024 2694 2450 2041 1644 1440 1251 1111 1101 1082 1131 1239 1393 1586 1760 2048 2452 2645 2459 2270 1916 1623 1400 1221 1092 1079 1055 1099 1206 1356 1518 1660 1913 2241 2422 2325 2148 1842 1609 1374 1194 1087 1066 1035 1081 1186 1334 1496 1676 1809 2381 2184 2231 2055 1791 1596 1365 1172 1095 1047 1025 1065 1174 1317 1480 1660 1822 1946 2143 2186 2029 1779 1601 1366 1145 1106 1044 1024 1066 1171 1317 1470 1653 1798 1887 2052 2232 2064 1794 1617 1385 1144 1105 1050 1029 1074 1181 1315 1468 1648 1791 2002 2189 2319 2160 1855 1647 1444 1217 1111 1085 1047 1089 1208 1304 1468 1664 1827 2104 2264 2482 2284 1941 1684 1481 1241 1126 1122 1069 1113 1232 1297 1493 1695 1894 2224 2418 2719 2493 2103 1740 1535 1278 1158 1130 1105 1150 1266 1339 1542 1744 2044 2443 2647 3098 2790 2328 1833 1592 1326 1179 1169 1146 1190 1293 1408 1589 1834 2308 2738 3032 3620 3239 2612 1999 1647 1377 1180 1211 1170 1235 1333 1485 1638 1973 2526 3178 3469 4353 3832 2974 2215 1716 1436 1212 1254 1182 1257 1383 1534 1713 2147 2929 3624 4163 5207 4508 3397 2452 1813 1490 1272 1261 1262 1283 1423 1598 1789 2391 3205 4217 4868] + + + [4671 3976 2993 2154 1635 1396 1239 1171 1234 1279 1417 1601 1793 2383 3156 4305 4849 4023 3480 2665 1976 1579 1350 1198 1139 1201 1249 1370 1556 1744 2126 3052 3456 4210 3444 3036 2392 1809 1532 1300 1157 1128 1157 1209 1324 1506 1689 1988 2440 3236 3411 2994 2696 2204 1699 1491 1260 1131 1122 1120 1171 1282 1444 1644 1833 2329 2726 3049 2693 2449 2035 1644 1445 1250 1111 1102 1083 1132 1242 1398 1595 1767 2063 2464 2650 2451 2267 1916 1623 1401 1224 1093 1081 1056 1101 1211 1362 1527 1668 1915 2253 2442 2325 2149 1843 1606 1377 1193 1089 1068 1036 1083 1189 1340 1502 1681 1819 2398 2195 2230 2055 1794 1597 1365 1174 1097 1049 1025 1068 1176 1322 1487 1668 1831 1955 2146 2179 2023 1783 1599 1367 1146 1107 1046 1024 1066 1175 1321 1477 1662 1802 1901 2052 2234 2061 1794 1616 1385 1145 1107 1051 1030 1075 1185 1321 1473 1652 1804 2004 2207 2321 2156 1855 1647 1444 1218 1113 1085 1047 1091 1211 1308 1472 1671 1829 2110 2267 2454 2277 1931 1683 1481 1241 1129 1122 1070 1113 1236 1301 1501 1696 1898 2234 2421 2720 2486 2096 1734 1535 1278 1158 1130 1104 1151 1268 1344 1547 1747 2044 2444 2654 3071 2770 2315 1828 1588 1324 1180 1166 1146 1188 1295 1409 1594 1831 2312 2740 3033 3599 3201 2587 1991 1644 1374 1180 1209 1169 1235 1333 1486 1638 1978 2522 3162 3475 4300 3790 2959 2197 1714 1433 1209 1252 1177 1256 1380 1536 1715 2140 2926 3608 4161 5139 4462 3356 2430 1806 1485 1272 1261 1259 1279 1425 1594 1787 2385 3203 4203 4858] + + + [4243 3666 2753 2007 1529 1316 1179 1144 1220 1258 1379 1538 1699 2226 2914 3906 4364 3678 3192 2478 1839 1484 1275 1155 1116 1188 1236 1341 1499 1663 1986 2838 3194 3777 3183 2812 2230 1694 1445 1237 1120 1119 1151 1207 1308 1458 1620 1880 2277 2974 3162 2803 2536 2051 1606 1411 1208 1108 1115 1118 1171 1272 1410 1585 1748 2175 2537 2836 2519 2278 1912 1556 1367 1204 1091 1100 1085 1133 1240 1371 1540 1692 1935 2291 2445 2288 2115 1805 1538 1334 1184 1080 1079 1060 1105 1210 1342 1481 1596 1813 2089 2268 2165 2007 1739 1526 1314 1160 1079 1065 1035 1087 1187 1325 1463 1613 1720 2245 2021 2069 1914 1690 1520 1305 1144 1087 1047 1028 1071 1177 1310 1449 1605 1738 1817 2004 2038 1888 1684 1519 1307 1116 1100 1041 1024 1067 1176 1311 1441 1598 1718 1778 1890 2066 1911 1689 1537 1326 1116 1101 1048 1028 1077 1181 1306 1441 1592 1713 1871 2032 2145 2008 1747 1567 1380 1184 1106 1084 1046 1091 1208 1294 1427 1606 1737 1963 2107 2284 2121 1811 1598 1412 1208 1117 1120 1069 1113 1229 1285 1451 1632 1784 2074 2226 2516 2312 1960 1646 1458 1237 1143 1130 1104 1148 1262 1317 1492 1673 1918 2264 2444 2839 2573 2162 1727 1510 1275 1161 1164 1141 1186 1287 1379 1531 1746 2146 2533 2797 3305 2954 2420 1865 1556 1312 1150 1196 1162 1225 1314 1443 1576 1858 2351 2912 3177 3917 3481 2741 2048 1617 1354 1166 1233 1159 1240 1349 1478 1630 1994 2699 3297 3793 4640 4033 3101 2252 1682 1399 1210 1232 1234 1251 1382 1525 1685 2214 2940 3822 4320] + + + + + 1920x1080_D65_90 + + + 1920x1080 + + + D65 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [19 41 68 100 134 171 204 223] + + + [41 54 60 70 79 67 84 85] + + + [ 90] + + + [5731 5069 3830 2717 1944 1634 1374 1251 1299 1360 1543 1807 2091 2828 3736 5093 5734 4956 4383 3418 2522 1872 1576 1323 1218 1250 1309 1488 1745 2011 2513 3617 4082 4890 4142 3745 2993 2307 1818 1517 1262 1194 1192 1255 1417 1669 1915 2344 2859 3802 4031 3616 3276 2704 2132 1785 1459 1224 1167 1140 1201 1361 1598 1857 2134 2721 3208 3552 3177 2942 2466 2019 1740 1415 1201 1130 1097 1152 1306 1528 1784 1995 2385 2830 3032 2917 2699 2279 1951 1690 1375 1165 1101 1063 1113 1259 1477 1725 1944 2205 2570 2773 2741 2570 2198 1914 1653 1356 1145 1087 1037 1093 1235 1450 1677 1907 2110 2773 2549 2659 2464 2130 1888 1631 1346 1131 1073 1029 1077 1216 1429 1653 1885 2099 2319 2609 2595 2431 2120 1886 1628 1340 1123 1076 1024 1078 1217 1428 1638 1876 2082 2370 2530 2670 2473 2155 1905 1647 1365 1133 1082 1038 1090 1227 1441 1623 1876 2096 2384 2561 2777 2619 2229 1954 1688 1417 1169 1111 1062 1114 1255 1474 1595 1898 2150 2492 2678 2963 2769 2338 2005 1734 1457 1199 1147 1093 1146 1283 1514 1590 1953 2246 2645 2815 3266 3042 2571 2087 1809 1521 1259 1175 1142 1192 1335 1562 1682 2028 2453 2899 3138 3773 3422 2842 2244 1882 1606 1309 1224 1194 1244 1387 1620 1797 2133 2746 3252 3608 4441 4024 3218 2463 1961 1677 1360 1274 1222 1299 1448 1685 1897 2330 2980 3810 4164 5332 4779 3709 2737 2070 1761 1428 1315 1290 1328 1516 1761 1993 2569 3501 4384 5027 6335 5559 4236 3018 2211 1831 1506 1355 1347 1403 1585 1833 2119 2871 3895 5172 5894] + + + [4944 4314 3304 2359 1672 1441 1234 1163 1229 1274 1417 1610 1816 2439 3207 4319 4827 4232 3771 2945 2184 1631 1395 1200 1143 1195 1245 1373 1567 1764 2190 3124 3510 4205 3595 3220 2603 2000 1596 1348 1155 1134 1154 1204 1330 1512 1696 2039 2500 3279 3444 3097 2824 2350 1857 1573 1305 1131 1124 1118 1166 1284 1459 1653 1871 2371 2775 3057 2761 2531 2130 1758 1538 1272 1118 1102 1080 1129 1245 1411 1599 1761 2086 2454 2632 2499 2327 1976 1709 1498 1246 1096 1081 1056 1099 1214 1370 1552 1723 1927 2230 2410 2380 2210 1901 1675 1473 1229 1085 1070 1036 1081 1193 1353 1509 1695 1848 2421 2211 2280 2118 1841 1653 1453 1226 1075 1059 1027 1069 1182 1336 1498 1680 1843 2019 2237 2245 2095 1835 1650 1451 1221 1069 1064 1024 1073 1182 1341 1481 1670 1831 2056 2194 2284 2136 1860 1672 1460 1246 1077 1069 1036 1084 1190 1353 1467 1671 1839 2061 2206 2408 2243 1926 1702 1498 1285 1108 1094 1056 1105 1214 1376 1435 1681 1882 2159 2307 2553 2382 2024 1746 1535 1316 1131 1123 1085 1131 1236 1405 1428 1728 1967 2279 2446 2838 2619 2214 1815 1599 1371 1176 1144 1126 1171 1278 1439 1502 1786 2148 2518 2703 3291 2967 2479 1950 1662 1442 1214 1182 1172 1215 1321 1486 1602 1869 2402 2819 3103 3855 3471 2790 2149 1727 1507 1255 1221 1194 1261 1368 1542 1685 2042 2619 3305 3596 4647 4123 3215 2396 1816 1575 1309 1245 1249 1279 1426 1595 1759 2261 3048 3778 4284 5495 4816 3651 2646 1927 1628 1362 1275 1284 1335 1467 1647 1853 2504 3387 4393 4970] + + + [4906 4322 3288 2351 1670 1437 1235 1157 1226 1274 1418 1613 1817 2456 3234 4334 4863 4240 3740 2933 2180 1626 1392 1199 1141 1194 1243 1375 1569 1766 2193 3136 3527 4222 3557 3195 2597 1994 1590 1347 1155 1133 1152 1206 1329 1516 1697 2044 2500 3291 3460 3087 2811 2334 1852 1569 1302 1130 1121 1116 1165 1287 1458 1656 1872 2380 2780 3078 2744 2514 2124 1755 1536 1271 1117 1101 1080 1129 1247 1413 1602 1765 2090 2464 2637 2488 2319 1971 1702 1495 1243 1095 1079 1055 1099 1214 1373 1555 1726 1931 2228 2415 2367 2195 1891 1673 1469 1228 1084 1070 1034 1080 1193 1356 1512 1697 1851 2428 2209 2266 2109 1838 1651 1448 1224 1073 1057 1025 1069 1182 1339 1498 1680 1846 2018 2243 2226 2081 1831 1646 1447 1220 1068 1062 1024 1072 1182 1341 1483 1670 1833 2060 2188 2276 2124 1850 1667 1457 1240 1075 1068 1033 1083 1191 1355 1468 1673 1838 2060 2202 2386 2223 1920 1698 1492 1283 1105 1091 1056 1103 1214 1378 1440 1680 1879 2161 2307 2532 2360 2009 1742 1529 1312 1127 1122 1080 1130 1234 1406 1428 1726 1962 2271 2436 2809 2585 2197 1807 1593 1367 1173 1142 1123 1169 1277 1440 1500 1785 2136 2509 2694 3229 2937 2452 1938 1653 1433 1208 1178 1170 1211 1320 1484 1594 1866 2389 2812 3080 3811 3406 2758 2126 1717 1499 1251 1215 1189 1259 1365 1539 1682 2034 2610 3276 3586 4570 4070 3185 2369 1806 1565 1304 1241 1244 1275 1420 1593 1752 2247 3027 3735 4235 5416 4743 3601 2611 1904 1619 1353 1269 1278 1329 1462 1641 1842 2488 3340 4353 4943] + + + [4495 3945 3067 2194 1570 1347 1181 1127 1210 1260 1380 1551 1733 2296 3010 3939 4419 3911 3451 2728 2035 1527 1310 1150 1120 1184 1233 1347 1512 1684 2059 2912 3254 3860 3302 2985 2426 1872 1502 1277 1119 1120 1148 1201 1315 1472 1635 1933 2352 3038 3205 2892 2623 2191 1750 1485 1245 1101 1116 1115 1167 1279 1426 1601 1788 2223 2598 2851 2562 2366 1985 1669 1453 1221 1097 1096 1083 1131 1244 1389 1550 1694 1968 2289 2450 2337 2160 1856 1614 1425 1201 1079 1078 1057 1102 1213 1356 1513 1657 1830 2080 2248 2198 2059 1781 1589 1403 1193 1070 1069 1036 1086 1193 1344 1473 1634 1751 2283 2046 2119 1968 1735 1565 1387 1192 1063 1055 1027 1076 1183 1329 1466 1618 1757 1887 2102 2080 1944 1726 1565 1385 1187 1060 1058 1024 1075 1183 1335 1450 1611 1750 1934 2049 2123 1978 1742 1581 1394 1211 1065 1064 1035 1086 1191 1342 1436 1608 1749 1929 2055 2217 2079 1806 1613 1425 1247 1096 1090 1055 1105 1212 1361 1400 1613 1793 2013 2156 2354 2194 1885 1650 1461 1274 1115 1122 1082 1132 1232 1388 1386 1654 1853 2129 2270 2615 2418 2056 1712 1514 1320 1158 1138 1124 1169 1273 1417 1452 1708 2013 2327 2493 2991 2736 2293 1824 1574 1382 1187 1172 1169 1210 1312 1459 1537 1774 2232 2618 2850 3505 3173 2575 1997 1629 1432 1216 1206 1184 1253 1349 1498 1617 1909 2442 3026 3292 4181 3734 2956 2203 1701 1487 1257 1220 1230 1260 1396 1539 1674 2098 2801 3422 3853 4935 4322 3339 2430 1786 1527 1294 1239 1257 1307 1421 1581 1742 2311 3085 3934 4487] + + + + + 1920x1080_D75_90 + + + 1920x1080 + + + D75 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [18 38 70 101 136 173 200 224] + + + [42 53 61 71 77 66 85 85] + + + [ 90] + + + [5247 4566 3534 2489 1824 1556 1350 1277 1297 1359 1535 1801 2054 2811 3746 5040 5517 4437 3975 3103 2273 1746 1498 1304 1255 1241 1310 1473 1729 1989 2489 3595 4029 4814 3852 3445 2765 2085 1691 1432 1272 1217 1183 1256 1416 1656 1909 2311 2875 3739 3970 3335 3054 2522 1935 1655 1401 1240 1176 1139 1203 1356 1588 1845 2113 2698 3133 3477 2972 2749 2320 1847 1604 1376 1197 1136 1092 1158 1303 1524 1765 1964 2365 2794 2991 2728 2537 2178 1810 1552 1326 1174 1101 1060 1116 1260 1470 1704 1881 2219 2584 2757 2562 2425 2082 1796 1528 1297 1167 1081 1037 1097 1231 1444 1674 1896 2107 2709 2484 2478 2316 2024 1785 1510 1271 1159 1061 1026 1077 1216 1419 1656 1864 2074 2227 2412 2410 2286 2014 1787 1504 1232 1168 1057 1024 1077 1214 1417 1634 1865 2026 2217 2422 2487 2326 2028 1808 1538 1253 1165 1070 1033 1089 1220 1421 1644 1844 2049 2336 2510 2577 2435 2119 1839 1596 1321 1182 1100 1057 1110 1252 1433 1654 1872 2091 2423 2581 2765 2584 2212 1891 1639 1359 1200 1136 1084 1138 1284 1433 1690 1907 2191 2553 2725 3026 2821 2428 1963 1714 1427 1235 1169 1124 1179 1331 1471 1746 1982 2384 2856 3067 3464 3188 2675 2103 1778 1513 1255 1221 1173 1230 1372 1568 1805 2108 2710 3149 3467 4103 3731 3016 2299 1853 1569 1285 1272 1207 1280 1427 1636 1854 2293 2933 3705 4019 4826 4417 3491 2552 1942 1618 1350 1299 1265 1327 1487 1702 1954 2495 3418 4239 4840 5844 5094 3967 2824 2072 1689 1412 1346 1316 1375 1554 1782 2067 2793 3796 5006 5613] + + + [4558 3982 3050 2181 1601 1380 1226 1199 1235 1284 1420 1619 1819 2461 3300 4362 4834 3911 3466 2726 2002 1542 1340 1198 1186 1197 1251 1378 1571 1770 2199 3166 3543 4181 3369 3014 2438 1829 1501 1288 1176 1167 1152 1213 1333 1518 1708 2052 2551 3302 3463 2912 2674 2218 1702 1476 1267 1157 1137 1118 1172 1292 1460 1668 1876 2409 2777 3062 2622 2409 2040 1630 1432 1248 1126 1111 1080 1135 1251 1413 1598 1760 2096 2470 2631 2375 2216 1907 1604 1390 1208 1113 1084 1055 1102 1217 1374 1554 1682 1977 2277 2428 2260 2108 1827 1593 1367 1187 1112 1065 1034 1085 1197 1353 1527 1705 1874 2412 2177 2164 2022 1772 1581 1357 1163 1111 1049 1026 1070 1183 1334 1510 1683 1849 1940 2117 2124 1990 1762 1585 1349 1127 1119 1047 1024 1072 1181 1336 1497 1675 1804 1948 2115 2163 2030 1779 1600 1379 1147 1114 1056 1030 1081 1190 1339 1497 1657 1820 2050 2187 2268 2127 1853 1628 1428 1207 1123 1084 1051 1098 1216 1341 1502 1682 1855 2117 2259 2412 2259 1945 1667 1464 1235 1138 1115 1076 1122 1241 1340 1536 1706 1940 2244 2393 2664 2469 2122 1729 1528 1297 1162 1140 1110 1160 1280 1362 1578 1770 2117 2514 2702 3074 2801 2365 1854 1594 1372 1170 1183 1155 1204 1315 1450 1628 1883 2416 2784 3031 3639 3285 2678 2041 1652 1418 1195 1225 1181 1248 1358 1506 1673 2042 2625 3264 3508 4318 3873 3077 2264 1732 1461 1247 1245 1230 1284 1405 1563 1748 2229 3040 3719 4203 5122 4552 3505 2500 1834 1512 1286 1271 1264 1318 1449 1615 1834 2477 3360 4359 4902] + + + [4509 3975 3047 2173 1600 1380 1229 1197 1237 1287 1425 1624 1829 2475 3309 4406 4856 3919 3452 2719 2001 1542 1342 1198 1188 1196 1254 1382 1575 1775 2211 3190 3568 4220 3359 3008 2431 1827 1501 1289 1176 1168 1154 1215 1337 1525 1714 2059 2567 3319 3483 2924 2666 2209 1701 1475 1266 1158 1140 1119 1174 1296 1466 1673 1885 2416 2791 3075 2597 2402 2036 1626 1431 1248 1127 1112 1081 1137 1255 1416 1605 1768 2103 2482 2649 2372 2213 1905 1603 1390 1211 1112 1085 1056 1104 1220 1379 1558 1686 1982 2276 2446 2259 2103 1828 1589 1368 1189 1113 1068 1034 1087 1200 1357 1533 1709 1887 2415 2188 2152 2016 1770 1579 1358 1165 1109 1051 1027 1073 1185 1339 1515 1686 1854 1946 2121 2119 1986 1757 1582 1350 1128 1120 1048 1024 1072 1185 1340 1500 1683 1808 1950 2124 2159 2019 1777 1600 1376 1147 1113 1057 1031 1082 1192 1343 1503 1663 1826 2049 2200 2255 2121 1850 1625 1427 1206 1125 1083 1052 1100 1217 1344 1507 1680 1859 2126 2264 2385 2249 1933 1668 1462 1234 1138 1115 1075 1122 1243 1343 1539 1709 1944 2242 2394 2647 2461 2108 1725 1523 1295 1161 1138 1110 1160 1281 1364 1581 1772 2116 2513 2700 3035 2779 2346 1846 1589 1368 1170 1182 1154 1203 1316 1448 1628 1885 2404 2780 3023 3581 3226 2650 2027 1651 1414 1193 1224 1179 1248 1357 1504 1674 2037 2621 3248 3504 4269 3814 3049 2244 1728 1459 1243 1243 1227 1280 1406 1560 1748 2224 3028 3694 4195 5063 4466 3465 2478 1822 1502 1285 1268 1263 1317 1446 1616 1830 2466 3341 4316 4845] + + + [4150 3620 2835 2032 1505 1301 1179 1175 1223 1271 1396 1565 1737 2328 3099 4008 4397 3595 3202 2533 1865 1453 1265 1154 1170 1188 1245 1358 1525 1703 2077 2969 3305 3880 3097 2803 2266 1716 1416 1226 1144 1160 1153 1212 1325 1484 1654 1951 2409 3074 3217 2722 2496 2068 1604 1400 1212 1135 1136 1119 1177 1289 1437 1619 1802 2271 2611 2846 2448 2244 1908 1543 1356 1202 1112 1108 1084 1141 1254 1393 1558 1691 1981 2312 2479 2212 2065 1796 1522 1323 1170 1102 1085 1058 1108 1221 1363 1517 1621 1878 2129 2280 2104 1969 1723 1509 1304 1154 1103 1066 1039 1092 1200 1346 1497 1648 1783 2278 2028 2015 1885 1670 1502 1296 1134 1102 1048 1028 1077 1186 1330 1484 1627 1768 1832 1980 1970 1856 1660 1503 1290 1099 1114 1045 1024 1076 1185 1332 1471 1622 1730 1825 1968 2014 1883 1679 1520 1317 1117 1107 1053 1032 1085 1193 1332 1471 1603 1738 1923 2049 2095 1982 1740 1547 1362 1175 1117 1082 1050 1101 1215 1333 1467 1620 1760 1978 2104 2241 2095 1814 1582 1396 1199 1128 1116 1075 1124 1241 1325 1495 1645 1831 2098 2225 2454 2285 1973 1637 1452 1252 1148 1137 1112 1159 1278 1343 1530 1701 1982 2327 2516 2825 2594 2194 1740 1512 1318 1152 1178 1151 1202 1309 1421 1571 1796 2251 2596 2795 3289 2991 2474 1903 1566 1351 1163 1214 1172 1243 1344 1465 1615 1913 2451 2999 3221 3916 3522 2826 2099 1624 1382 1202 1225 1216 1267 1379 1511 1668 2077 2802 3384 3818 4609 4085 3192 2301 1709 1417 1229 1241 1240 1297 1409 1550 1730 2288 3082 3920 4384] + + + + + 1920x1080_F11_90 + + + 1920x1080 + + + F11 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [19 38 68 100 132 165 206 232] + + + [39 53 62 70 77 67 84 88] + + + [ 90] + + + [5566 4958 3753 2691 1983 1710 1455 1343 1281 1325 1515 1752 2016 2764 3666 4927 5560 4841 4271 3360 2487 1886 1665 1408 1307 1227 1275 1447 1692 1940 2456 3557 3989 4808 4056 3616 2952 2253 1803 1597 1367 1255 1171 1216 1380 1623 1852 2278 2803 3695 3910 3482 3155 2647 2047 1743 1541 1333 1202 1125 1158 1311 1521 1792 2047 2643 3071 3427 3063 2836 2418 1877 1705 1492 1299 1158 1080 1111 1253 1430 1725 1940 2328 2760 2955 2810 2601 2221 1785 1667 1462 1273 1120 1050 1072 1210 1377 1638 1806 2114 2436 2624 2640 2482 2088 1752 1636 1448 1253 1103 1030 1051 1184 1344 1599 1806 1986 2512 2242 2551 2379 2005 1742 1594 1439 1241 1088 1024 1033 1165 1318 1568 1794 1915 2049 2329 2535 2357 2016 1737 1571 1447 1240 1089 1025 1034 1163 1310 1549 1784 1919 2146 2310 2594 2421 2057 1753 1570 1465 1255 1097 1034 1050 1168 1346 1592 1790 1945 2218 2386 2730 2551 2179 1820 1589 1502 1285 1129 1052 1072 1203 1330 1626 1818 2036 2300 2463 2903 2699 2304 1900 1616 1524 1318 1173 1078 1104 1222 1424 1661 1853 2133 2461 2610 3177 2950 2522 2012 1686 1543 1369 1199 1121 1148 1274 1484 1711 1922 2333 2720 2918 3689 3346 2806 2189 1789 1577 1425 1241 1171 1197 1337 1550 1754 2057 2618 3087 3423 4370 3894 3165 2419 1888 1645 1479 1298 1221 1253 1403 1622 1811 2259 2884 3624 3998 5256 4636 3635 2683 2000 1723 1535 1354 1272 1312 1478 1684 1904 2472 3400 4187 4821 6120 5370 4122 2940 2124 1800 1592 1407 1322 1362 1542 1749 2007 2748 3761 4913 5671] + + + [5051 4453 3459 2492 1833 1599 1371 1292 1245 1279 1437 1646 1857 2530 3349 4440 4969 4370 3892 3087 2298 1755 1558 1339 1267 1201 1241 1387 1593 1799 2253 3237 3613 4319 3703 3319 2732 2085 1680 1503 1304 1227 1153 1189 1325 1536 1729 2095 2583 3357 3550 3165 2894 2440 1896 1633 1450 1279 1183 1115 1139 1269 1442 1679 1895 2435 2810 3123 2822 2606 2226 1743 1597 1408 1255 1144 1076 1097 1215 1355 1623 1803 2150 2530 2713 2569 2394 2041 1662 1564 1385 1236 1113 1047 1062 1182 1310 1543 1685 1949 2233 2389 2436 2278 1919 1631 1535 1374 1219 1098 1029 1044 1159 1281 1505 1688 1828 2314 2041 2329 2180 1838 1624 1502 1368 1212 1082 1024 1027 1142 1259 1472 1682 1769 1864 2122 2322 2160 1851 1614 1480 1375 1213 1083 1025 1029 1143 1254 1459 1669 1773 1969 2099 2376 2215 1885 1632 1480 1394 1226 1095 1033 1044 1148 1291 1504 1672 1795 2024 2173 2491 2332 1988 1684 1497 1424 1255 1123 1053 1065 1183 1265 1535 1693 1879 2106 2248 2646 2473 2114 1753 1518 1444 1281 1166 1076 1096 1197 1367 1563 1724 1968 2247 2390 2921 2705 2317 1854 1577 1467 1322 1189 1114 1139 1244 1419 1610 1785 2149 2488 2660 3386 3051 2588 2018 1671 1494 1373 1227 1164 1182 1303 1476 1642 1904 2414 2831 3105 3960 3561 2906 2236 1755 1553 1421 1273 1212 1238 1361 1542 1696 2090 2655 3301 3593 4745 4209 3331 2483 1857 1625 1471 1325 1257 1288 1426 1596 1769 2278 3114 3801 4314 5486 4885 3744 2720 1968 1678 1513 1365 1295 1332 1481 1647 1856 2515 3396 4439 4950] + + + [5079 4478 3472 2490 1842 1605 1372 1295 1243 1283 1447 1654 1875 2554 3381 4543 4997 4412 3904 3102 2306 1756 1560 1340 1269 1202 1242 1392 1603 1811 2282 3277 3659 4381 3714 3329 2737 2087 1686 1506 1306 1229 1155 1192 1331 1549 1738 2117 2614 3398 3603 3186 2895 2449 1898 1636 1453 1283 1183 1114 1143 1275 1450 1687 1911 2458 2838 3150 2816 2611 2227 1746 1601 1410 1258 1146 1076 1100 1221 1363 1633 1818 2169 2557 2737 2582 2398 2048 1665 1568 1388 1238 1115 1049 1065 1188 1318 1553 1695 1968 2243 2421 2443 2277 1925 1636 1537 1377 1223 1100 1030 1046 1163 1289 1513 1699 1844 2347 2048 2338 2184 1842 1626 1505 1370 1214 1085 1024 1030 1148 1268 1482 1692 1779 1875 2141 2311 2161 1852 1619 1483 1378 1216 1085 1026 1032 1147 1260 1468 1681 1782 1984 2110 2384 2221 1884 1634 1483 1395 1229 1094 1035 1046 1152 1299 1514 1685 1809 2044 2191 2482 2332 1986 1686 1498 1427 1256 1124 1052 1066 1187 1270 1545 1705 1887 2119 2258 2659 2471 2110 1755 1521 1447 1282 1166 1075 1096 1201 1373 1574 1735 1977 2261 2388 2921 2689 2312 1852 1580 1466 1324 1186 1115 1138 1247 1425 1616 1795 2159 2496 2677 3350 3037 2580 2010 1666 1495 1372 1227 1162 1182 1305 1478 1654 1910 2421 2829 3117 3956 3533 2897 2226 1754 1551 1419 1272 1206 1237 1360 1547 1699 2095 2668 3313 3597 4716 4162 3317 2468 1851 1621 1468 1320 1254 1285 1425 1597 1773 2285 3124 3810 4348 5469 4829 3737 2695 1959 1678 1510 1359 1291 1327 1481 1647 1859 2515 3416 4398 4975] + + + [4785 4185 3285 2370 1762 1521 1330 1272 1230 1262 1405 1599 1784 2402 3180 4151 4657 4133 3650 2925 2184 1686 1487 1296 1249 1192 1223 1360 1545 1742 2148 3060 3401 4021 3504 3151 2592 1997 1629 1446 1279 1222 1149 1185 1309 1503 1683 2006 2459 3157 3339 3010 2741 2332 1829 1589 1404 1264 1183 1113 1138 1261 1413 1632 1834 2311 2658 2917 2686 2477 2116 1705 1553 1370 1246 1146 1079 1097 1210 1331 1585 1749 2046 2392 2556 2424 2274 1960 1637 1518 1356 1233 1116 1050 1063 1179 1292 1512 1630 1866 2084 2252 2318 2158 1852 1608 1498 1351 1219 1101 1031 1046 1154 1269 1472 1639 1746 2210 1914 2203 2069 1781 1597 1470 1348 1214 1086 1024 1027 1140 1247 1442 1637 1693 1746 1977 2209 2049 1783 1592 1457 1355 1219 1084 1025 1028 1139 1240 1431 1623 1705 1855 1974 2247 2101 1814 1605 1465 1370 1231 1095 1034 1042 1143 1274 1481 1627 1725 1915 2040 2354 2200 1894 1647 1481 1399 1255 1124 1048 1062 1175 1240 1504 1646 1791 1980 2098 2494 2337 2001 1697 1501 1416 1280 1167 1074 1093 1187 1345 1531 1669 1873 2099 2223 2749 2534 2191 1781 1550 1439 1314 1189 1114 1133 1233 1398 1571 1722 2020 2327 2463 3155 2875 2432 1920 1617 1468 1356 1223 1160 1174 1288 1447 1596 1821 2271 2646 2863 3698 3322 2734 2116 1688 1513 1391 1265 1199 1224 1339 1503 1636 1973 2489 3056 3327 4397 3862 3103 2321 1766 1561 1426 1299 1239 1266 1393 1539 1686 2132 2891 3494 3960 5021 4511 3474 2537 1844 1602 1458 1332 1266 1298 1432 1577 1752 2347 3125 4009 4506] + + + + + 1920x1080_F12_90 + + + 1920x1080 + + + F12 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [20 40 70 97 129 168 206 230] + + + [42 52 61 70 77 69 84 85] + + + [ 90] + + + [5696 5007 3776 2714 2023 1730 1458 1330 1292 1334 1508 1743 1996 2701 3596 4921 5588 4875 4281 3378 2497 1931 1677 1408 1303 1230 1281 1448 1678 1923 2386 3458 3908 4734 4146 3693 2993 2279 1859 1613 1370 1255 1174 1221 1379 1616 1839 2228 2753 3642 3879 3558 3226 2691 2105 1793 1553 1340 1204 1128 1161 1317 1538 1773 2015 2596 3040 3391 3163 2911 2454 1983 1725 1513 1313 1160 1085 1114 1248 1462 1714 1920 2308 2751 2980 2888 2685 2283 1923 1664 1493 1290 1126 1053 1077 1202 1404 1627 1797 2095 2432 2616 2755 2556 2182 1886 1640 1487 1278 1109 1029 1056 1177 1365 1580 1787 1929 2417 2193 2648 2454 2117 1878 1650 1481 1273 1098 1024 1038 1161 1329 1574 1774 1798 1990 2283 2615 2430 2122 1890 1673 1481 1278 1102 1024 1039 1157 1326 1555 1764 1826 2124 2292 2671 2484 2156 1926 1698 1497 1291 1121 1033 1050 1167 1333 1577 1762 1928 2210 2365 2815 2617 2241 1970 1749 1529 1321 1151 1049 1073 1194 1358 1609 1797 1999 2269 2458 2979 2779 2352 2022 1791 1563 1345 1181 1081 1103 1223 1421 1643 1833 2098 2401 2540 3296 3029 2571 2089 1857 1609 1385 1212 1121 1147 1273 1482 1699 1903 2287 2680 2892 3804 3432 2867 2239 1925 1669 1439 1261 1170 1197 1341 1537 1747 2020 2581 3072 3408 4486 3971 3207 2455 1995 1746 1490 1310 1220 1255 1403 1613 1808 2222 2831 3580 3943 5378 4697 3655 2716 2092 1811 1550 1367 1273 1316 1472 1676 1889 2415 3333 4130 4781 6414 5502 4174 2991 2214 1882 1616 1418 1326 1375 1540 1743 1994 2691 3674 4909 5602] + + + [5217 4522 3486 2517 1878 1626 1379 1287 1257 1293 1443 1640 1843 2486 3285 4432 4974 4492 3928 3119 2318 1803 1578 1345 1267 1206 1249 1391 1588 1788 2206 3170 3569 4284 3804 3384 2771 2119 1738 1520 1311 1229 1158 1196 1334 1529 1720 2055 2543 3328 3547 3273 2986 2494 1957 1681 1474 1290 1188 1118 1144 1278 1465 1667 1871 2400 2787 3105 2950 2691 2278 1847 1623 1434 1271 1150 1079 1102 1217 1396 1618 1793 2134 2538 2728 2688 2477 2117 1795 1567 1425 1256 1121 1051 1069 1175 1347 1538 1680 1940 2235 2405 2538 2356 2023 1761 1547 1420 1247 1106 1030 1050 1153 1307 1501 1673 1785 2230 2003 2448 2265 1968 1755 1558 1416 1248 1095 1024 1034 1141 1277 1490 1665 1667 1823 2086 2419 2244 1963 1771 1579 1419 1254 1101 1025 1034 1140 1274 1480 1653 1698 1952 2103 2467 2288 1994 1798 1607 1431 1270 1118 1031 1046 1150 1282 1494 1655 1792 2027 2170 2581 2403 2073 1841 1647 1460 1292 1150 1049 1067 1173 1303 1527 1681 1849 2085 2240 2752 2558 2175 1877 1688 1488 1313 1176 1079 1095 1201 1365 1555 1718 1948 2207 2337 3027 2795 2377 1947 1746 1529 1346 1204 1117 1138 1248 1421 1602 1773 2113 2454 2656 3482 3152 2654 2080 1813 1590 1388 1248 1163 1184 1309 1469 1645 1882 2390 2828 3108 4103 3658 2970 2286 1877 1652 1439 1291 1210 1242 1365 1540 1697 2061 2614 3271 3587 4868 4287 3388 2531 1955 1717 1489 1339 1261 1296 1425 1593 1762 2246 3061 3759 4320 5848 5023 3849 2779 2071 1766 1541 1382 1302 1341 1480 1647 1854 2484 3384 4423 5094] + + + [5243 4568 3508 2522 1887 1628 1383 1287 1257 1295 1451 1650 1864 2509 3330 4490 5042 4505 3953 3125 2330 1804 1583 1345 1266 1209 1250 1395 1598 1801 2224 3221 3623 4366 3822 3406 2783 2123 1744 1526 1314 1231 1158 1199 1340 1542 1736 2073 2579 3369 3587 3295 2980 2509 1966 1685 1475 1292 1188 1117 1146 1283 1476 1681 1889 2424 2830 3149 2940 2702 2280 1852 1627 1439 1274 1152 1080 1104 1223 1406 1631 1810 2160 2563 2773 2684 2486 2123 1800 1570 1427 1258 1121 1051 1071 1180 1355 1550 1694 1959 2253 2444 2550 2361 2027 1768 1550 1423 1250 1107 1030 1051 1158 1317 1510 1689 1807 2261 2008 2446 2278 1970 1760 1563 1417 1251 1097 1025 1035 1147 1285 1504 1677 1682 1838 2112 2414 2244 1968 1775 1582 1422 1257 1102 1024 1037 1143 1282 1489 1666 1705 1971 2117 2475 2298 1998 1806 1609 1434 1270 1118 1032 1048 1154 1289 1506 1669 1805 2048 2188 2584 2408 2077 1840 1654 1462 1295 1150 1049 1068 1178 1311 1536 1697 1862 2113 2265 2749 2554 2174 1886 1689 1490 1314 1174 1077 1097 1204 1371 1566 1730 1959 2216 2353 3031 2789 2372 1947 1750 1529 1348 1203 1115 1138 1250 1427 1614 1787 2130 2466 2664 3468 3133 2646 2076 1811 1588 1386 1244 1161 1183 1310 1476 1654 1892 2398 2845 3139 4047 3640 2954 2277 1871 1651 1436 1289 1206 1239 1367 1541 1704 2068 2635 3288 3624 4858 4270 3353 2519 1950 1717 1485 1333 1253 1292 1424 1597 1764 2257 3074 3768 4292 5694 4991 3833 2759 2065 1762 1536 1379 1297 1336 1483 1646 1865 2495 3372 4450 5031] + + + [4985 4326 3350 2405 1820 1564 1340 1263 1242 1272 1411 1591 1788 2378 3114 4147 4790 4214 3736 2973 2226 1750 1516 1308 1251 1198 1234 1367 1546 1732 2110 3020 3399 3956 3622 3234 2672 2045 1687 1478 1290 1223 1155 1190 1321 1498 1683 1980 2429 3176 3343 3176 2847 2401 1903 1645 1444 1277 1188 1118 1145 1272 1444 1631 1824 2294 2657 2944 2793 2580 2191 1810 1594 1410 1264 1153 1082 1103 1212 1380 1585 1747 2049 2413 2606 2558 2373 2048 1752 1551 1406 1259 1124 1054 1069 1172 1336 1510 1638 1862 2114 2288 2425 2261 1959 1733 1527 1405 1251 1109 1032 1052 1149 1299 1473 1637 1713 2137 1874 2348 2160 1911 1725 1537 1405 1257 1098 1024 1035 1140 1268 1474 1626 1603 1711 1960 2300 2149 1910 1734 1552 1408 1263 1104 1024 1032 1138 1262 1455 1618 1632 1849 1974 2355 2185 1937 1764 1578 1419 1274 1120 1029 1043 1143 1269 1475 1613 1723 1917 2051 2472 2289 2000 1797 1615 1443 1295 1151 1047 1064 1167 1284 1499 1641 1775 1976 2108 2613 2409 2098 1833 1646 1472 1314 1179 1075 1089 1191 1348 1524 1672 1854 2081 2187 2879 2654 2262 1895 1700 1503 1340 1206 1112 1132 1237 1398 1572 1720 2016 2291 2479 3314 2963 2523 2000 1756 1554 1380 1242 1160 1174 1295 1446 1600 1811 2256 2667 2909 3835 3429 2810 2182 1815 1607 1411 1280 1195 1227 1342 1497 1648 1952 2480 3043 3325 4522 4004 3170 2391 1876 1651 1454 1314 1236 1268 1390 1534 1690 2112 2852 3450 3958 5319 4603 3581 2614 1961 1693 1480 1347 1268 1303 1432 1578 1760 2319 3128 4041 4680] + + + + + 1920x1080_F2_90 + + + 1920x1080 + + + F2 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [16 35 66 100 132 172 209 230] + + + [39 53 60 70 78 68 84 88] + + + [ 90] + + + [5567 4912 3885 2746 2016 1716 1439 1289 1291 1349 1517 1753 2040 2855 3804 5128 5492 4745 4280 3416 2543 1919 1662 1386 1243 1247 1299 1469 1695 1953 2524 3654 4076 4811 3996 3658 2998 2297 1838 1598 1326 1202 1188 1244 1404 1635 1859 2326 2886 3763 3897 3417 3179 2683 2104 1781 1541 1275 1176 1141 1195 1345 1564 1799 2091 2706 3131 3432 3027 2838 2436 1949 1722 1486 1233 1145 1093 1146 1292 1504 1732 1963 2404 2807 2971 2757 2603 2244 1863 1670 1445 1204 1114 1059 1107 1253 1418 1646 1795 2085 2448 2612 2597 2465 2121 1819 1639 1416 1192 1096 1033 1085 1227 1401 1625 1697 2025 2559 2311 2501 2359 2027 1779 1613 1395 1183 1079 1024 1066 1204 1381 1581 1723 1965 2152 2352 2458 2328 1989 1765 1602 1391 1183 1074 1024 1066 1197 1380 1554 1758 1934 2161 2280 2493 2369 2001 1762 1613 1401 1195 1092 1029 1078 1199 1380 1599 1752 1922 2218 2349 2616 2482 2094 1757 1643 1429 1224 1112 1054 1098 1234 1405 1629 1773 2040 2331 2464 2792 2613 2250 1764 1665 1465 1253 1143 1083 1128 1254 1438 1663 1856 2158 2504 2640 3092 2876 2479 1864 1679 1513 1298 1168 1128 1169 1297 1482 1726 1954 2410 2805 2986 3586 3270 2771 2097 1691 1575 1351 1219 1163 1220 1351 1544 1785 2098 2696 3150 3411 4210 3833 3110 2363 1747 1626 1406 1270 1178 1263 1403 1622 1819 2338 2983 3731 4010 5035 4540 3600 2649 1880 1672 1471 1302 1269 1320 1464 1695 1907 2553 3548 4344 4848 5952 5293 4140 2902 2039 1723 1535 1353 1307 1371 1527 1761 2041 2810 3962 5076 5608] + + + [4941 4428 3503 2521 1841 1584 1346 1233 1250 1294 1436 1624 1858 2575 3438 4523 4912 4291 3870 3107 2317 1761 1541 1308 1199 1215 1261 1394 1584 1789 2302 3307 3663 4330 3610 3304 2734 2100 1694 1490 1258 1167 1170 1215 1347 1534 1715 2120 2647 3380 3504 3114 2880 2452 1922 1642 1440 1213 1153 1127 1173 1298 1474 1666 1918 2470 2830 3104 2764 2571 2224 1786 1595 1393 1180 1131 1087 1132 1255 1424 1614 1805 2203 2555 2694 2500 2360 2044 1712 1549 1356 1161 1104 1057 1097 1225 1348 1536 1653 1905 2218 2380 2363 2235 1931 1667 1520 1332 1153 1089 1035 1078 1199 1339 1520 1565 1843 2324 2083 2267 2144 1842 1639 1496 1316 1149 1073 1024 1062 1181 1322 1479 1593 1800 1948 2125 2225 2106 1807 1624 1489 1313 1150 1069 1024 1061 1176 1323 1458 1623 1772 1960 2057 2261 2145 1821 1621 1496 1319 1161 1087 1029 1075 1177 1325 1496 1623 1756 1998 2126 2371 2242 1906 1613 1522 1343 1185 1105 1055 1090 1209 1342 1524 1633 1861 2110 2221 2518 2371 2042 1620 1543 1369 1208 1131 1081 1119 1227 1371 1552 1707 1973 2265 2393 2807 2610 2253 1707 1555 1415 1245 1154 1121 1158 1263 1406 1606 1799 2200 2547 2695 3218 2966 2525 1917 1567 1470 1291 1196 1154 1204 1310 1458 1657 1928 2474 2857 3103 3790 3455 2841 2163 1616 1515 1339 1240 1165 1244 1353 1524 1685 2145 2745 3371 3618 4523 4096 3268 2422 1732 1560 1395 1266 1249 1294 1406 1595 1758 2349 3236 3902 4387 5341 4778 3700 2666 1870 1592 1444 1303 1271 1330 1455 1643 1866 2566 3553 4563 5013] + + + [4940 4449 3493 2511 1839 1583 1344 1232 1248 1294 1435 1632 1864 2592 3468 4552 4952 4288 3865 3124 2311 1761 1540 1306 1195 1213 1257 1396 1584 1793 2316 3330 3694 4375 3613 3299 2729 2098 1690 1488 1256 1165 1168 1214 1348 1539 1718 2133 2660 3411 3538 3115 2876 2443 1919 1643 1439 1213 1148 1125 1173 1298 1478 1672 1924 2484 2849 3124 2757 2567 2216 1787 1592 1392 1179 1129 1085 1131 1256 1427 1617 1814 2211 2559 2710 2500 2359 2038 1707 1547 1356 1159 1102 1055 1096 1225 1353 1541 1660 1912 2222 2393 2357 2227 1927 1669 1519 1332 1152 1087 1034 1077 1201 1339 1524 1566 1854 2337 2103 2251 2136 1840 1636 1495 1315 1147 1071 1024 1061 1182 1325 1481 1597 1802 1954 2129 2220 2099 1805 1622 1487 1311 1149 1068 1024 1061 1176 1325 1461 1626 1775 1964 2068 2261 2134 1813 1621 1493 1318 1159 1084 1028 1074 1177 1328 1498 1626 1759 2004 2137 2355 2235 1896 1614 1518 1341 1183 1101 1051 1089 1209 1343 1526 1636 1865 2112 2221 2503 2365 2032 1617 1542 1367 1206 1129 1078 1116 1227 1371 1553 1707 1975 2257 2401 2779 2584 2239 1702 1552 1412 1242 1150 1116 1156 1261 1406 1608 1798 2202 2548 2703 3194 2952 2500 1907 1562 1463 1287 1190 1151 1200 1307 1458 1657 1926 2462 2855 3083 3774 3419 2811 2146 1611 1511 1332 1234 1158 1240 1350 1522 1684 2142 2737 3361 3622 4464 4055 3236 2398 1725 1551 1389 1260 1241 1287 1402 1589 1755 2346 3225 3888 4343 5263 4687 3675 2632 1855 1583 1436 1295 1265 1323 1450 1637 1862 2553 3563 4512 5019] + + + [4582 4148 3301 2382 1758 1510 1301 1211 1240 1280 1405 1571 1778 2444 3223 4183 4548 4004 3621 2931 2200 1681 1474 1264 1178 1206 1251 1374 1533 1721 2184 3103 3422 3991 3409 3114 2600 1998 1630 1431 1229 1159 1166 1215 1336 1497 1664 2018 2507 3159 3311 2947 2729 2322 1842 1583 1391 1193 1149 1128 1177 1296 1449 1624 1843 2338 2665 2911 2614 2439 2112 1733 1535 1353 1167 1131 1089 1136 1254 1403 1572 1749 2086 2399 2544 2377 2229 1955 1664 1497 1324 1152 1106 1059 1101 1228 1338 1497 1599 1801 2070 2220 2242 2123 1853 1627 1473 1306 1148 1090 1037 1082 1201 1330 1487 1507 1744 2196 1950 2150 2028 1776 1601 1449 1294 1148 1074 1024 1065 1185 1318 1451 1534 1712 1827 1984 2118 1992 1750 1585 1441 1290 1149 1069 1024 1063 1177 1316 1432 1566 1692 1849 1932 2149 2031 1761 1588 1448 1296 1161 1085 1028 1076 1175 1317 1465 1572 1669 1874 1978 2251 2121 1833 1588 1473 1313 1182 1105 1051 1090 1208 1327 1493 1574 1763 1973 2076 2361 2236 1940 1602 1494 1334 1203 1134 1080 1117 1225 1355 1510 1648 1860 2115 2210 2649 2450 2131 1672 1516 1368 1234 1154 1119 1156 1261 1381 1562 1730 2064 2367 2517 3017 2774 2367 1839 1535 1415 1274 1192 1148 1202 1303 1429 1605 1835 2307 2663 2876 3508 3204 2665 2045 1581 1456 1308 1229 1151 1237 1334 1483 1627 2016 2570 3106 3307 4171 3766 3026 2267 1664 1485 1347 1245 1228 1277 1374 1533 1671 2194 2977 3547 3978 4821 4327 3423 2478 1767 1515 1383 1267 1247 1298 1416 1571 1765 2375 3285 4101 4534] + + + + + 1920x1080_H_90 + + + 1920x1080 + + + H + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [16 36 67 95 127 168 212 239] + + + [41 54 61 69 79 66 82 88] + + + [ 90] + + + [6269 5658 4452 3127 2309 1899 1532 1337 1336 1410 1631 1921 2267 3104 4126 5424 5849 5432 4913 3941 2881 2191 1833 1474 1283 1281 1357 1564 1858 2169 2768 3955 4400 5134 4578 4195 3454 2616 2086 1755 1403 1224 1226 1291 1493 1781 2056 2555 3155 4059 4203 3967 3661 3095 2407 2002 1680 1342 1184 1171 1231 1421 1687 1980 2305 2969 3411 3722 3495 3274 2817 2252 1926 1605 1280 1155 1114 1175 1358 1606 1903 2171 2621 3055 3239 3180 3002 2595 2161 1846 1524 1240 1128 1069 1130 1304 1539 1797 2001 2380 2738 2895 3033 2859 2479 2122 1814 1495 1235 1119 1038 1102 1276 1484 1748 1971 2274 2773 2560 2885 2733 2395 2088 1803 1500 1238 1081 1025 1079 1260 1426 1702 1955 2181 2375 2584 2860 2701 2374 2079 1791 1494 1234 1079 1024 1077 1250 1442 1699 1945 2170 2434 2577 2916 2749 2404 2104 1808 1505 1250 1087 1031 1088 1258 1452 1722 1974 2216 2326 2376 3038 2870 2501 2146 1851 1550 1271 1119 1055 1113 1286 1485 1765 2022 2306 2663 2814 3229 3045 2630 2202 1905 1564 1273 1162 1086 1143 1315 1528 1814 2069 2423 2789 2936 3552 3326 2857 2294 1966 1617 1316 1201 1137 1196 1364 1596 1882 2160 2657 3084 3270 4027 3722 3143 2471 2037 1700 1378 1259 1194 1258 1408 1676 1957 2320 2960 3449 3742 4740 4336 3562 2727 2136 1787 1445 1317 1227 1312 1488 1757 2030 2553 3254 4034 4329 5617 5141 4090 3023 2264 1877 1512 1373 1286 1353 1567 1836 2152 2816 3833 4663 5146 6586 5956 4683 3335 2423 1939 1583 1412 1372 1419 1635 1918 2300 3118 4249 5429 6019] + + + [5159 4724 3693 2638 1949 1645 1364 1230 1252 1308 1472 1671 1911 2593 3421 4435 4818 4536 4090 3297 2433 1859 1600 1322 1192 1216 1274 1422 1627 1841 2319 3287 3643 4241 3813 3505 2909 2211 1784 1544 1272 1151 1176 1228 1373 1575 1764 2150 2647 3367 3492 3311 3059 2609 2032 1730 1485 1227 1129 1139 1184 1321 1505 1713 1949 2491 2847 3100 2948 2750 2372 1915 1668 1429 1182 1115 1095 1143 1277 1447 1663 1848 2208 2561 2698 2673 2519 2189 1844 1609 1366 1157 1100 1061 1109 1240 1401 1578 1714 2008 2296 2434 2539 2401 2094 1819 1593 1347 1158 1098 1035 1087 1220 1358 1544 1699 1912 2338 2133 2440 2297 2022 1791 1583 1356 1171 1065 1026 1069 1210 1309 1508 1691 1847 1981 2161 2397 2266 2003 1788 1574 1354 1169 1065 1024 1069 1203 1329 1507 1683 1840 2044 2155 2445 2304 2028 1805 1586 1362 1181 1073 1031 1079 1211 1338 1528 1705 1874 1928 1973 2559 2408 2104 1835 1618 1395 1197 1100 1052 1098 1231 1361 1559 1741 1946 2233 2359 2705 2553 2212 1876 1661 1404 1190 1135 1078 1123 1252 1395 1595 1773 2049 2337 2457 2980 2778 2400 1944 1702 1439 1218 1163 1118 1167 1288 1441 1643 1839 2237 2585 2716 3357 3108 2638 2086 1755 1503 1263 1205 1166 1214 1319 1499 1698 1963 2494 2879 3112 3955 3602 2989 2306 1826 1571 1313 1249 1184 1255 1378 1556 1743 2155 2730 3352 3573 4695 4270 3433 2552 1924 1636 1361 1285 1229 1280 1434 1618 1833 2372 3192 3854 4271 5461 4931 3890 2806 2049 1684 1410 1310 1295 1328 1481 1674 1938 2626 3516 4465 4893] + + + [5192 4715 3699 2646 1953 1645 1362 1228 1250 1311 1471 1678 1924 2624 3452 4521 4864 4524 4099 3305 2429 1860 1599 1319 1192 1216 1273 1428 1635 1848 2337 3322 3683 4307 3838 3520 2906 2211 1781 1543 1273 1151 1176 1228 1376 1581 1774 2163 2673 3404 3524 3314 3068 2605 2039 1727 1486 1226 1128 1138 1186 1325 1513 1723 1964 2512 2881 3123 2949 2754 2369 1914 1671 1429 1182 1115 1095 1145 1282 1457 1672 1859 2230 2582 2726 2680 2521 2193 1846 1610 1367 1157 1101 1061 1109 1246 1409 1588 1726 2024 2307 2460 2541 2402 2094 1820 1591 1345 1160 1099 1036 1090 1224 1365 1554 1706 1932 2364 2142 2436 2299 2021 1796 1582 1356 1172 1067 1026 1071 1215 1316 1516 1700 1855 1995 2180 2404 2259 2005 1787 1574 1357 1170 1066 1024 1071 1209 1334 1516 1693 1852 2059 2174 2438 2302 2030 1804 1587 1362 1182 1073 1031 1080 1215 1345 1537 1713 1881 1932 1982 2553 2405 2100 1835 1620 1395 1198 1100 1052 1100 1235 1368 1567 1746 1959 2240 2373 2693 2542 2207 1873 1659 1403 1190 1135 1077 1124 1256 1400 1601 1782 2058 2350 2471 2957 2762 2391 1939 1697 1437 1216 1163 1116 1167 1291 1443 1651 1848 2241 2592 2730 3343 3089 2626 2076 1750 1497 1260 1203 1163 1214 1319 1502 1702 1969 2496 2892 3126 3913 3585 2967 2290 1819 1564 1309 1244 1182 1252 1376 1560 1747 2157 2738 3359 3577 4669 4229 3394 2536 1916 1628 1354 1282 1220 1275 1432 1619 1832 2373 3189 3850 4271 5420 4891 3859 2780 2033 1674 1402 1302 1290 1321 1478 1674 1936 2622 3522 4455 4933] + + + [4471 4024 3287 2443 1857 1577 1335 1219 1246 1293 1437 1601 1806 2385 3017 3775 4085 3917 3581 2969 2263 1784 1547 1297 1188 1212 1266 1398 1572 1753 2165 2919 3183 3589 3384 3143 2674 2094 1722 1505 1264 1158 1185 1234 1367 1538 1704 2019 2447 2970 3051 2979 2794 2423 1948 1676 1463 1228 1143 1150 1197 1322 1484 1665 1851 2299 2575 2760 2703 2536 2226 1846 1629 1416 1188 1127 1107 1155 1285 1433 1622 1772 2062 2339 2433 2453 2333 2069 1787 1573 1355 1166 1114 1069 1121 1250 1396 1547 1649 1885 2109 2231 2344 2233 1983 1761 1561 1343 1169 1108 1042 1099 1231 1357 1512 1636 1809 2170 1950 2245 2146 1916 1742 1552 1354 1183 1076 1031 1078 1221 1307 1478 1630 1743 1835 1987 2232 2102 1902 1731 1543 1353 1184 1073 1024 1074 1213 1328 1481 1626 1744 1896 1977 2237 2138 1916 1739 1555 1354 1193 1082 1033 1083 1218 1332 1501 1644 1766 1787 1815 2352 2225 1982 1764 1582 1383 1209 1110 1054 1101 1237 1351 1524 1674 1829 2046 2161 2447 2334 2067 1799 1612 1390 1198 1145 1080 1129 1254 1380 1557 1698 1907 2138 2235 2689 2517 2224 1849 1649 1418 1219 1173 1123 1172 1288 1419 1596 1750 2070 2322 2439 2970 2767 2402 1969 1686 1469 1260 1211 1169 1214 1315 1468 1636 1849 2263 2572 2739 3388 3159 2704 2143 1745 1522 1298 1244 1180 1249 1359 1513 1663 1994 2456 2903 3078 3940 3621 3035 2328 1808 1566 1327 1269 1210 1265 1395 1547 1726 2158 2798 3275 3568 4487 4073 3341 2524 1912 1591 1360 1280 1267 1295 1430 1582 1799 2347 3042 3695 4063] + + + + + + + A_100 + + + [ 100] + + + [1.79208 -0.198145 -0.574427 -0.736462 2.07131 -0.252126 0.0406771 -1.85276 2.9297] + + + [-79.894 -70.2343 -142.9449] + + + [1.29861 1 1 2.7191] + + + + + D50_100 + + + [ 100] + + + [1.8971 -0.68931 -0.189578 -0.439486 1.85772 -0.363208 -0.00556919 -0.805211 1.8949] + + + [-74.5768 -58.993 -83.6998] + + + [2.03176 1 1 1.6856] + + + + + D65_100 + + + [ 100] + + + [1.91996 -0.737372 -0.16497 -0.390371 1.87095 -0.429982 -0.0116974 -0.742648 1.8593] + + + [-72.1478 -56.5678 -78.7406] + + + [2.25275 1 1 1.3939] + + + + + D75_100 + + + [ 100] + + + [2.06265 -0.906923 -0.138793 -0.328267 1.80435 -0.40235 -0.00832665 -0.614651 1.7507] + + + [-69.3699 -50.9566 -79.3041] + + + [2.53436 1 1 1.3216] + + + + + F11_100 + + + [ 100] + + + [1.8945 -0.613902 -0.26542 -0.680027 2.04979 -0.286085 -0.0488421 -0.910602 2.0246] + + + [-62.1546 -68.9576 -94.2628] + + + [1.54875 1 1 2.22] + + + + + F12_100 + + + [ 100] + + + [1.96163 -0.525891 -0.419709 -0.807525 2.17333 -0.29513 -0.0741742 -1.39696 2.5138] + + + [-65.6438 -68.4671 -91.182] + + + [1.25028 1 1 2.9754] + + + + + F2_100 + + + [ 100] + + + [2.40858 -1.16543 -0.225184 -0.587047 1.8635 -0.196449 -0.0505826 -0.951502 2.1198] + + + [-73.612 -79.3348 -109.7283] + + + [1.87464 1 1 2.2715] + + + + + H_100 + + + [ 100] + + + [1.8447 0.0266051 -0.8555 -0.909121 2.16612 -0.1927 -0.476481 -2.33876 3.9297] + + + [-64.7293 -69.7923 -254.8237] + + + [1.09628 1 1 3.1826] + + + + + + [ -1] + + + + + [ 80] + + + [ 20] + + + [ 0.2] + + + [ 0.3] + + + [ 0.7] + + + [ 0.9] + + + + + 1920x1080_FPS_15 + + + + + fast + + + [ 1] + + + [ 2] + + + + + normal + + + [ 1] + + + [ 1] + + + + + slow + + + [ 2] + + + [ 1] + + + + + + + 1920x1080_FPS_10 + + + + + fast + + + [ 1] + + + [ 2] + + + + + normal + + + [ 1] + + + [ 1] + + + + + slow + + + [ 2] + + + [ 1] + + + + + + + 1920x1080_FPS_05 + + + + + fast + + + [ 1] + + + [ 1] + + + + + normal + + + [ 2] + + + [ 0.9] + + + + + slow + + + [ 4] + + + [ 0.9] + + + + + + + [ 8] + + + + + + 1920x1080 + + + 1920x1080 + + + [256 256 256 256] + + + + + + + linear + + + [256 512 768 1024 1280 1536 1792 2048 2304 2560 2816 3072 3328 3584 3840 4096] + + + [0 256 512 768 1024 1280 1536 1792 2048 2304 2560 2816 3072 3328 3584 3840 4095] + + + + + + [ -1] + + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + + + + + 1920x1080 + + + 1920x1080 + + + [ 7] + + + [ 29] + + + [ 7] + + + [ 29] + + + [ 0] + + + [ 0] + + + [0 0 0] + + + [0 0 0] + + + + + + + 1920x1080 + + + 1920x1080 + + + [ 1] + + + [1023 1013 727 597 518 424 367 329 301 260 233 213 184 165 151 139 131] + + + [ 4] + + + [ 4] + + + [ 0.15] + + + [ 0] + + + [1 1 1 1] + + + + + + + 1920x1080 + + + 1920x1080 + + + + + ISP_DPCC_MODE + + + 0x0004 + + + + + ISP_DPCC_OUT_MODE + + + 0x0003 + + + + + ISP_DPCC_SET_USE + + + 0x0007 + + + + + ISP_DPCC_METHODS_SET1 + + + 0x1D1D + + + + + ISP_DPCC_METHODS_SET2 + + + 0x0707 + + + + + ISP_DPCC_METHODS_SET3 + + + 0x1F1F + + + + + ISP_DPCC_LINE_THRESH_1 + + + 0x0808 + + + + + ISP_DPCC_LINE_MAD_FAC_1 + + + 0x0404 + + + + + ISP_DPCC_PG_FAC_1 + + + 0x0403 + + + + + ISP_DPCC_RND_THRESH_1 + + + 0x0A0A + + + + + ISP_DPCC_RG_FAC_1 + + + 0x2020 + + + + + ISP_DPCC_LINE_THRESH_2 + + + 0x100C + + + + + ISP_DPCC_LINE_MAD_FAC_2 + + + 0x1810 + + + + + ISP_DPCC_PG_FAC_2 + + + 0x0403 + + + + + ISP_DPCC_RND_THRESH_2 + + + 0x0808 + + + + + ISP_DPCC_RG_FAC_2 + + + 0x0808 + + + + + ISP_DPCC_LINE_THRESH_3 + + + 0x2020 + + + + + ISP_DPCC_LINE_MAD_FAC_3 + + + 0x0404 + + + + + ISP_DPCC_PG_FAC_3 + + + 0x0403 + + + + + ISP_DPCC_RND_THRESH_3 + + + 0x0806 + + + + + ISP_DPCC_RG_FAC_3 + + + 0x0404 + + + + + ISP_DPCC_RO_LIMITS + + + 0x0A0A + + + + + ISP_DPCC_RND_OFFS + + + 0x0FFF + + + + + + + + + + on + + + +
diff --git a/buildroot-overlay/package/vvcam/include/vvcam_sensor.h b/buildroot-overlay/package/vvcam/include/vvcam_sensor.h index 239f3bc..19fecac 100644 --- a/buildroot-overlay/package/vvcam/include/vvcam_sensor.h +++ b/buildroot-overlay/package/vvcam/include/vvcam_sensor.h @@ -1,8 +1,10 @@ #pragma once -#include #ifndef __VVCAM_SENSOR_H__ #define __VVCAM_SENSOR_H__ +#define VVCAM_API_VERSION 1UL + +#include #include enum vvcam_sensor_freq { @@ -43,6 +45,96 @@ enum vvcam_sensor_bayer { VVCAM_BAYER_PAT_RYYCY = 0x50, }; +struct vvcam_fps_range { + uint32_t min; + uint32_t max; +}; + +struct vvcam_auto_fps { + struct vvcam_fps_range afps_range; + uint32_t max_gain; +}; + +struct vvcam_gain_info { + float min; + float max; + float step; +}; + +struct vvcam_ae_info { + uint16_t frame_length; + uint16_t cur_frame_length; + + float one_line_exp_time; + + uint32_t gain_accuracy; + + float min_gain; + float max_gain; + + float integration_time_increment; + float gain_increment; + + uint16_t max_long_integraion_line; + uint16_t min_long_integraion_line; + + uint16_t max_integraion_line; + uint16_t min_integraion_line; + + uint16_t max_vs_integraion_line; + uint16_t min_vs_integraion_line; + + float max_long_integraion_time; + float min_long_integraion_time; + + float max_integraion_time; + float min_integraion_time; + + float max_vs_integraion_time; + float min_vs_integraion_time; + + + float cur_long_integration_time; + float cur_integration_time; + float cur_vs_integration_time; + + float cur_long_gain; + float cur_long_again; + float cur_long_dgain; + + float cur_gain; + float cur_again; + float cur_dgain; + + float cur_vs_gain; + float cur_vs_again; + float cur_vs_dgain; + + + struct vvcam_gain_info long_gain; + struct vvcam_gain_info gain; + struct vvcam_gain_info vs_gain; + + struct vvcam_gain_info a_long_gain; + struct vvcam_gain_info a_gain; + struct vvcam_gain_info a_vs_gain; + + struct vvcam_gain_info d_long_gain; + struct vvcam_gain_info d_gain; + struct vvcam_gain_info d_vs_gain; + + uint32_t max_fps; + uint32_t min_fps; + uint32_t cur_fps; + struct vvcam_auto_fps afps_info; + uint32_t hdr_ratio; + + uint32_t int_time_delay_frame; + uint32_t gain_delay_frame; + + uint8_t color_type; //0, color image; 1, mono sensor image; 2, color sensor gray image. +}; + struct vvcam_sensor_mode { uint16_t width; uint16_t height; @@ -51,6 +143,7 @@ struct vvcam_sensor_mode { enum vvcam_sensor_bayer bayer; enum vvcam_sensor_freq freq; enum vvcam_sensor_lanes lanes; + struct vvcam_ae_info ae_info; }; struct vvcam_sensor_ctrl { @@ -58,7 +151,7 @@ struct vvcam_sensor_ctrl { void (*deinit)(void* ctx); int (*enum_mode)(void* ctx, uint32_t index, struct vvcam_sensor_mode* mode); int (*get_mode)(void* ctx, struct vvcam_sensor_mode* mode); - int (*set_mode)(void* ctx, struct vvcam_sensor_mode* mode); + int (*set_mode)(void* ctx, uint32_t index); int (*set_stream)(void* ctx, bool on); int (*set_analog_gain)(void* ctx, float gain); int (*set_digital_gain)(void* ctx, float gain); @@ -71,5 +164,6 @@ struct vvcam_sensor { }; void vvcam_sensor_add(struct vvcam_sensor* sensor); +void vvcam_sensor_init(void); #endif \ No newline at end of file diff --git a/buildroot-overlay/package/vvcam/isp/Makefile b/buildroot-overlay/package/vvcam/isp/Makefile deleted file mode 100644 index b11c348..0000000 --- a/buildroot-overlay/package/vvcam/isp/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-m := vvcam_isp.o diff --git a/buildroot-overlay/package/vvcam/isp/vvcam_isp.h b/buildroot-overlay/package/vvcam/isp/vvcam_isp.h index fd3fa9e..8ab8399 100644 --- a/buildroot-overlay/package/vvcam/isp/vvcam_isp.h +++ b/buildroot-overlay/package/vvcam/isp/vvcam_isp.h @@ -68,18 +68,20 @@ enum { VVCAM_EID_MCM_WR_G2_RAW0_MIS = 0x09, VVCAM_EID_MCM_WR_G2_RAW1_MIS = 0x10, VVCAM_EID_FE_MIS = 0x11, - VVCAM_EID_MIV2_MIS2_HDR = 0x12, - VVCAM_EID_MIV2_JDP = 0x13, - VVCAM_EID_FUSA_ECC_IMSC1 = 0x14, - VVCAM_EID_FUSA_ECC_IMSC2 = 0x15, - VVCAM_EID_FUSA_ECC_IMSC3 = 0x16, - VVCAM_EID_FUSA_ECC_IMSC4 = 0x17, - VVCAM_EID_FUSA_ECC_IMSC5 = 0x18, - VVCAM_EID_FUSA_ECC_IMSC6 = 0x19, - VVCAM_EID_FUSA_DUP_IMSC = 0x1a, - VVCAM_EID_FUSA_PARITY_IMSC = 0x1b, - VVCAM_EID_FUSA_LV1_IMSC1 = 0x1c, - VVCAM_EID_MAX = 0x1d + VVCAM_EID_FE_BATCH_MODE_MIS = 0x12, + VVCAM_EID_MIV2_MIS2_HDR = 0x13, + VVCAM_EID_MIV2_JDP = 0x14, + VVCAM_EID_FUSA_ECC_IMSC1 = 0x15, + VVCAM_EID_FUSA_ECC_IMSC2 = 0x16, + VVCAM_EID_FUSA_ECC_IMSC3 = 0x17, + VVCAM_EID_FUSA_ECC_IMSC4 = 0x18, + VVCAM_EID_FUSA_ECC_IMSC5 = 0x19, + VVCAM_EID_FUSA_ECC_IMSC6 = 0x1a, + VVCAM_EID_FUSA_DUP_IMSC = 0x1b, + VVCAM_EID_FUSA_PARITY_IMSC = 0x1c, + VVCAM_EID_FUSA_LV1_IMSC1 = 0x1d, + VVCAM_EID_RDCD_MI_MIS = 0x1e, + VVCAM_EID_MAX = 0x1f }; diff --git a/buildroot-overlay/package/vvcam/isp/vvcam_isp_driver.c b/buildroot-overlay/package/vvcam/isp/vvcam_isp_driver.c index b65cb34..743143d 100644 --- a/buildroot-overlay/package/vvcam/isp/vvcam_isp_driver.c +++ b/buildroot-overlay/package/vvcam/isp/vvcam_isp_driver.c @@ -386,6 +386,7 @@ static int vvcam_isp_remove(struct platform_device *pdev) devm_free_irq(&pdev->dev, isp_dev->isp_irq, isp_dev); devm_free_irq(&pdev->dev, isp_dev->mi_irq, isp_dev); devm_free_irq(&pdev->dev, isp_dev->fe_irq, isp_dev); + tasklet_kill(&isp_dev->stat_tasklet); return 0; } diff --git a/buildroot-overlay/package/vvcam/isp/vvcam_isp_hal.c b/buildroot-overlay/package/vvcam/isp/vvcam_isp_hal.c index 3ebc195..a1f37ab 100644 --- a/buildroot-overlay/package/vvcam/isp/vvcam_isp_hal.c +++ b/buildroot-overlay/package/vvcam/isp/vvcam_isp_hal.c @@ -1,19 +1,19 @@ /**************************************************************************** - * +* * The MIT License (MIT) - * +* * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * +* * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * +* * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * +* * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,35 +21,36 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * +* +***************************************************************************** +* * The GPL License (GPL) - * +* * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * +* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * +* * You should have received a copy of the GNU General Public License * along with this program; - * - ***************************************************************************** - * +* +***************************************************************************** +* * Note: This software is released under dual MIT and GPL licenses. A * recipient may use this file under the terms of either the MIT license or * GPL License. If you wish to use only one license not the other, you can * indicate your decision by deleting one of the above license notices in your * version of this file. - * - *****************************************************************************/ +* +*****************************************************************************/ + #include #include @@ -152,6 +153,7 @@ irqreturn_t vvcam_isp_irq_process(struct vvcam_isp_dev *isp_dev) irqreturn_t vvcam_isp_mi_irq_process(struct vvcam_isp_dev *isp_dev) { + uint32_t miv1_mis = 0; uint32_t miv2_mis = 0; uint32_t miv2_mis1 = 0; uint32_t miv2_mis2 = 0; @@ -159,7 +161,7 @@ irqreturn_t vvcam_isp_mi_irq_process(struct vvcam_isp_dev *isp_dev) uint32_t mi_mis_hdr1 = 0; uint32_t isp_fe_ctrl = 0; uint64_t timestamp; - + uint64_t rdcd_mi_mis = 0; vvcam_event_t event; bool irq = false; @@ -202,6 +204,12 @@ irqreturn_t vvcam_isp_mi_irq_process(struct vvcam_isp_dev *isp_dev) irq = true; } + rdcd_mi_mis = vvcam_isp_hal_read_reg(isp_dev->base, RDCD_MI_MIS); + if (rdcd_mi_mis) { + vvcam_isp_hal_write_reg(isp_dev->base, RDCD_MI_ICR, rdcd_mi_mis); + irq = true; + } + timestamp = ktime_get_ns(); if (miv2_mis & (MIV2_MIS_MCM_RAW_RADY_MASK | MIV2_MIS_FRAME_END_MASK)) { @@ -266,6 +274,15 @@ irqreturn_t vvcam_isp_mi_irq_process(struct vvcam_isp_dev *isp_dev) isp_dev->irq_mis[VVCAM_EID_MCM_WR_G2_RAW1_MIS] = event.irqevent.irq_value; } + if (miv1_mis) { + event.type = VVCAM_EVENT_IRQ_TYPE; + event.id = VVCAM_EID_MIV2_MIS; + event.timestamp = timestamp; + event.irqevent.irq_value = miv1_mis; + vvcam_event_queue(&isp_dev->event_dev, &event); + // printk("MI V1 mi_irq_process.\n"); + } + if (miv2_mis) { event.type = VVCAM_EVENT_IRQ_TYPE; event.id = VVCAM_EID_MIV2_MIS; @@ -283,13 +300,15 @@ irqreturn_t vvcam_isp_mi_irq_process(struct vvcam_isp_dev *isp_dev) } if ((miv2_mis2 & MIV2_MIS2_HDR_RDMA_READY_MASK) - || (miv2_mis & MIV2_MIS_FRAME_END_MASK)) { + || (miv2_mis2 & MIV2_MIS2_HDR_FRAME_END_MASK)) { + event.type = VVCAM_EVENT_IRQ_TYPE; event.id = VVCAM_EID_MIV2_MIS2_HDR; event.timestamp = timestamp; - event.irqevent.irq_value = (miv2_mis2 & MIV2_MIS2_HDR_RDMA_READY_MASK) - | (miv2_mis & MIV2_MIS_FRAME_END_MASK); + event.irqevent.irq_value = ((miv2_mis2 & MIV2_MIS2_HDR_RDMA_READY_MASK) + | (miv2_mis2 & MIV2_MIS2_HDR_FRAME_END_MASK)); miv2_mis2 &= ~MIV2_MIS2_HDR_RDMA_READY_MASK; + miv2_mis2 &= ~MIV2_MIS2_HDR_FRAME_END_MASK; vvcam_event_queue(&isp_dev->event_dev, &event); } @@ -317,6 +336,14 @@ irqreturn_t vvcam_isp_mi_irq_process(struct vvcam_isp_dev *isp_dev) vvcam_event_queue(&isp_dev->event_dev, &event); } + if (rdcd_mi_mis) { + event.type = VVCAM_EVENT_IRQ_TYPE; + event.id = VVCAM_EID_RDCD_MI_MIS; + event.timestamp = timestamp; + event.irqevent.irq_value = rdcd_mi_mis; + vvcam_event_queue(&isp_dev->event_dev, &event); + } + if (irq) { tasklet_schedule(&isp_dev->stat_tasklet); return IRQ_HANDLED; @@ -328,9 +355,11 @@ irqreturn_t vvcam_isp_mi_irq_process(struct vvcam_isp_dev *isp_dev) irqreturn_t vvcam_isp_fe_irq_process(struct vvcam_isp_dev *isp_dev) { uint32_t isp_fe_mis = 0; + uint32_t isp_fe_batch_mode_mis = 0; uint32_t isp_fe_ctrl = 0; vvcam_event_t event; uint64_t timestamp; + bool irq = false; if (!isp_dev->refcnt) return IRQ_NONE; @@ -338,17 +367,22 @@ irqreturn_t vvcam_isp_fe_irq_process(struct vvcam_isp_dev *isp_dev) isp_fe_mis = vvcam_isp_hal_read_reg(isp_dev->base, ISP_FE_MIS); if (isp_fe_mis) { vvcam_isp_hal_write_reg(isp_dev->base, ISP_FE_ICR, isp_fe_mis); - } else { - return IRQ_NONE; - } - isp_fe_ctrl = vvcam_isp_hal_read_reg(isp_dev->base, ISP_FE_CTL); - if ((isp_fe_ctrl & ISP_FE_CFG_SEL_MASK) == ISP_FE_SEL_CMDBUF) { - isp_fe_ctrl &= ~(ISP_FE_CFG_SEL_MASK | ISP_FE_AHB_WRITE_MASK); - isp_fe_ctrl |= (ISP_FE_SEL_AHBBUF) << ISP_FE_CFG_SEL_SHIFT; - isp_fe_ctrl |= (ISP_FE_AHB_WR_ENABLE) << ISP_FE_AHB_WRITE_SHIFT; - vvcam_isp_hal_write_reg(isp_dev->base, ISP_FE_CTL, isp_fe_ctrl); + isp_fe_ctrl = vvcam_isp_hal_read_reg(isp_dev->base, ISP_FE_CTL); + if ((isp_fe_ctrl & ISP_FE_CFG_SEL_MASK) == ISP_FE_SEL_CMDBUF) { + isp_fe_ctrl &= ~(ISP_FE_CFG_SEL_MASK | ISP_FE_AHB_WRITE_MASK); + isp_fe_ctrl |= (ISP_FE_SEL_AHBBUF) << ISP_FE_CFG_SEL_SHIFT; + isp_fe_ctrl |= (ISP_FE_AHB_WR_ENABLE) << ISP_FE_AHB_WRITE_SHIFT; + vvcam_isp_hal_write_reg(isp_dev->base, ISP_FE_CTL, isp_fe_ctrl); + + } + irq = true; + } + isp_fe_batch_mode_mis = vvcam_isp_hal_read_reg(isp_dev->base, ISP_FE_BATCH_MODE_MIS); + if (isp_fe_batch_mode_mis) { + vvcam_isp_hal_write_reg(isp_dev->base, ISP_FE_BATCH_MODE_ICR, isp_fe_batch_mode_mis); + irq = true; } timestamp = ktime_get_ns(); @@ -360,10 +394,23 @@ irqreturn_t vvcam_isp_fe_irq_process(struct vvcam_isp_dev *isp_dev) event.irqevent.irq_value = isp_fe_mis; vvcam_event_queue(&isp_dev->event_dev, &event); isp_dev->irq_mis[VVCAM_EID_FE_MIS] = isp_fe_mis; + } + + if (isp_fe_batch_mode_mis) { + event.type = VVCAM_EVENT_IRQ_TYPE; + event.id = VVCAM_EID_FE_BATCH_MODE_MIS; + event.timestamp = timestamp; + event.irqevent.irq_value = isp_fe_batch_mode_mis; + vvcam_event_queue(&isp_dev->event_dev, &event); + isp_dev->irq_mis[VVCAM_EID_FE_BATCH_MODE_MIS] = isp_fe_batch_mode_mis; + } + + if (irq) { tasklet_schedule(&isp_dev->stat_tasklet); + return IRQ_HANDLED; } - return IRQ_HANDLED; + return IRQ_NONE; } irqreturn_t vvcam_isp_fusa_irq_process(struct vvcam_isp_dev *isp_dev) @@ -381,70 +428,70 @@ irqreturn_t vvcam_isp_fusa_irq_process(struct vvcam_isp_dev *isp_dev) vvcam_event_t event; bool irq = false; - + if (!isp_dev->refcnt) return IRQ_NONE; - printk("enter fusa_irq_process\n"); - + // printk("enter fusa_irq_process\n"); + fusa_ecc_mis1 = vvcam_isp_hal_read_reg(isp_dev->base, FUSA_ECC_MIS1); - printk("FUSA_ECC_MIS1 : 0x%08x \n", fusa_ecc_mis1); + // printk("FUSA_ECC_MIS1 : 0x%08x \n", fusa_ecc_mis1); if (fusa_ecc_mis1) { vvcam_isp_hal_write_reg(isp_dev->base, FUSA_ECC_ICR1, fusa_ecc_mis1); irq = true; } fusa_ecc_mis2 = vvcam_isp_hal_read_reg(isp_dev->base, FUSA_ECC_MIS2); - printk("FUSA_ECC_MIS2 : 0x%08x \n", fusa_ecc_mis2); + // printk("FUSA_ECC_MIS2 : 0x%08x \n", fusa_ecc_mis2); if (fusa_ecc_mis2) { vvcam_isp_hal_write_reg(isp_dev->base, FUSA_ECC_ICR2, fusa_ecc_mis2); irq = true; } fusa_ecc_mis3 = vvcam_isp_hal_read_reg(isp_dev->base, FUSA_ECC_MIS3); - printk("FUSA_ECC_MIS3 : 0x%08x \n", fusa_ecc_mis3); + // printk("FUSA_ECC_MIS3 : 0x%08x \n", fusa_ecc_mis3); if (fusa_ecc_mis3) { vvcam_isp_hal_write_reg(isp_dev->base, FUSA_ECC_ICR3, fusa_ecc_mis3); irq = true; } fusa_ecc_mis4 = vvcam_isp_hal_read_reg(isp_dev->base, FUSA_ECC_MIS4); - printk("FUSA_ECC_MIS4 : 0x%08x \n", fusa_ecc_mis4); + // printk("FUSA_ECC_MIS4 : 0x%08x \n", fusa_ecc_mis4); if (fusa_ecc_mis4) { vvcam_isp_hal_write_reg(isp_dev->base, FUSA_ECC_ICR4, fusa_ecc_mis4); irq = true; } fusa_ecc_mis5 = vvcam_isp_hal_read_reg(isp_dev->base, FUSA_ECC_MIS5); - printk("FUSA_ECC_MIS5 : 0x%08x \n", fusa_ecc_mis5); + // printk("FUSA_ECC_MIS5 : 0x%08x \n", fusa_ecc_mis5); if (fusa_ecc_mis5) { vvcam_isp_hal_write_reg(isp_dev->base, FUSA_ECC_ICR5, fusa_ecc_mis5); irq = true; } fusa_ecc_mis6 = vvcam_isp_hal_read_reg(isp_dev->base, FUSA_ECC_MIS6); - printk("FUSA_ECC_MIS6 : 0x%08x \n", fusa_ecc_mis6); + // printk("FUSA_ECC_MIS6 : 0x%08x \n", fusa_ecc_mis6); if (fusa_ecc_mis6) { vvcam_isp_hal_write_reg(isp_dev->base, FUSA_ECC_ICR6, fusa_ecc_mis6); irq = true; } fusa_dup_mis = vvcam_isp_hal_read_reg(isp_dev->base, FUSA_DUP_MIS); - printk("FUSA_DUP_MIS : 0x%08x \n", fusa_dup_mis); + // printk("FUSA_DUP_MIS : 0x%08x \n", fusa_dup_mis); if (fusa_dup_mis) { vvcam_isp_hal_write_reg(isp_dev->base, FUSA_DUP_ICR, fusa_dup_mis); irq = true; } fusa_parity_mis = vvcam_isp_hal_read_reg(isp_dev->base, FUSA_PARITY_MIS); - printk("FUSA_PARITY_MIS : 0x%08x \n", fusa_parity_mis); + // printk("FUSA_PARITY_MIS : 0x%08x \n", fusa_parity_mis); if (fusa_parity_mis) { vvcam_isp_hal_write_reg(isp_dev->base, FUSA_PARITY_ICR, fusa_parity_mis); irq = true; } fusa_lv1_mis1 = vvcam_isp_hal_read_reg(isp_dev->base, FUSA_LV1_MIS1); - printk("FUSA_LV1_MIS1 : 0x%08x \n", fusa_lv1_mis1); + // printk("FUSA_LV1_MIS1 : 0x%08x \n", fusa_lv1_mis1); if (fusa_lv1_mis1) { vvcam_isp_hal_write_reg(isp_dev->base, FUSA_LV1_ICR1, fusa_lv1_mis1); irq = true; @@ -461,7 +508,7 @@ irqreturn_t vvcam_isp_fusa_irq_process(struct vvcam_isp_dev *isp_dev) vvcam_event_queue(&isp_dev->event_dev, &event); isp_dev->irq_mis[VVCAM_EID_FUSA_ECC_IMSC1] = event.irqevent.irq_value; } - + if (fusa_ecc_mis2) { event.type = VVCAM_EVENT_IRQ_TYPE; event.id = VVCAM_EID_FUSA_ECC_IMSC2; @@ -548,4 +595,4 @@ irqreturn_t vvcam_isp_fusa_irq_process(struct vvcam_isp_dev *isp_dev) } return IRQ_HANDLED; -} \ No newline at end of file +} diff --git a/buildroot-overlay/package/vvcam/isp/vvcam_isp_hal.h b/buildroot-overlay/package/vvcam/isp/vvcam_isp_hal.h index 2b081db..c6a1500 100644 --- a/buildroot-overlay/package/vvcam/isp/vvcam_isp_hal.h +++ b/buildroot-overlay/package/vvcam/isp/vvcam_isp_hal.h @@ -60,6 +60,10 @@ #define ISP_MIS 0x000005c4 #define ISP_ICR 0x000005c8 +#define MIV1_CTRL 0x00001400 +#define MIV1_MIS 0x00001500 +#define MIV1_ICR 0x00001504 + #define MIV2_CTRL 0x00001300 #define MIV2_MIS 0x000016d0 #define MIV2_MIS1 0x000016d4 @@ -75,7 +79,11 @@ #define ISP_FE_MIS 0x00003D74 #define ISP_FE_ICR 0x00003D78 #define ISP_FE_CTL 0x00003D60 +#define ISP_FE_BATCH_MODE_ICR 0x00003DAC +#define ISP_FE_BATCH_MODE_MIS 0x00003DB8 + +#define MIV1_MIS_FRAME_END_MASK 0x00000001 #define MIV2_CTRL_MCM_RAW_RDMA_START_MASK 0x00008000 @@ -143,6 +151,10 @@ #define FUSA_LV1_MIS1 0x00005b48 #define FUSA_LV1_ICR1 0x00005b50 + +#define RDCD_MI_MIS 0x000080c0 +#define RDCD_MI_ICR 0x000080c4 + enum isp_fe_cfg_sel_e { ISP_FE_SEL_AHBBUF = 0, ISP_FE_SEL_CMDBUF = 1, diff --git a/buildroot-overlay/package/vvcam/isp/vvcam_isp_procfs.c b/buildroot-overlay/package/vvcam/isp/vvcam_isp_procfs.c index 18923af..d691809 100644 --- a/buildroot-overlay/package/vvcam/isp/vvcam_isp_procfs.c +++ b/buildroot-overlay/package/vvcam/isp/vvcam_isp_procfs.c @@ -636,8 +636,6 @@ static int find_proc_dir_by_name(const char *root, pfile = filp_open(root, O_RDONLY | O_DIRECTORY, 0); if (pfile->f_op->iterate_shared) { ret = pfile->f_op->iterate_shared(pfile, &fc.ctx); - } else { - // ret = pfile->f_op->iterate(pfile, &fc.ctx); } if (ret == 0) { diff --git a/buildroot-overlay/package/vvcam/isp_media_server b/buildroot-overlay/package/vvcam/isp_media_server index 6437c86..b785336 100755 Binary files a/buildroot-overlay/package/vvcam/isp_media_server and b/buildroot-overlay/package/vvcam/isp_media_server differ diff --git a/buildroot-overlay/package/vvcam/mipi/vvcam_mipi.h b/buildroot-overlay/package/vvcam/mipi/vvcam_mipi.h index 3a99f5a..342ebcd 100644 --- a/buildroot-overlay/package/vvcam/mipi/vvcam_mipi.h +++ b/buildroot-overlay/package/vvcam/mipi/vvcam_mipi.h @@ -61,6 +61,7 @@ typedef enum { VVCAM_INPUT_MODE_MIPI = 0x00, VVCAM_INPUT_MODE_LVDS = 0x01, VVCAM_INPUT_MODE_BT1120 = 0x02, + VVCAM_INPUT_MODE_DVP = 0x03 } vvcam_input_mode_t; typedef struct { @@ -109,6 +110,11 @@ typedef enum { VVCAM_ITF_BIT_MODE_16BIT, } vvcam_itf_bit_mode_t; +typedef enum { + VVCAM_SYNC_POL_HIGH_ACIVE = 0, + VVCAM_SYNC_POL_LOW_ACIVE +}vvcam_sync_pol_t; + typedef struct { uint32_t hsa; /* horizontal synchronism activate (pixel cycle) */ uint32_t hbp; /* horizontal back porch (pixel cycle) */ @@ -123,6 +129,18 @@ typedef struct { uint32_t vactivate_lines; /* vertical resolution of video */ } vvcam_itf_vertical_time_t; +typedef struct { + + vvcam_sync_pol_t pwdn; + vvcam_sync_pol_t rst; + vvcam_sync_pol_t fsin; +}vvcam_power_attr_t; + +typedef struct { + vvcam_power_attr_t powerPin; + bool isPower; +}vvcam_dvp_dev_attr_t; + typedef struct { bool enable; bool embedded_data_en; @@ -145,6 +163,7 @@ typedef struct { union { vvcam_mipi_dev_attr_t mipi_attr; + vvcam_dvp_dev_attr_t dvp_attr; //vvcam_lvds_dev_attr_t lvds_attr; }; } vvcam_input_dev_attr_t; diff --git a/buildroot-overlay/package/vvcam/src/lib.c b/buildroot-overlay/package/vvcam/src/lib.c index 82e1f4a..e17983c 100644 --- a/buildroot-overlay/package/vvcam/src/lib.c +++ b/buildroot-overlay/package/vvcam/src/lib.c @@ -6,7 +6,7 @@ extern struct vvcam_sensor vvcam_imx335; void vvcam_sensor_init(void) { // get /dev/media0 - printf("k230 builtin sensor driver, version %s %s\n", __DATE__, __TIME__); + printf("k230 builtin sensor driver, built %s %s, API version %lu\n", __DATE__, __TIME__, VVCAM_API_VERSION); vvcam_sensor_add(&vvcam_ov5647); vvcam_sensor_add(&vvcam_imx335); } diff --git a/buildroot-overlay/package/vvcam/src/ov5647.c b/buildroot-overlay/package/vvcam/src/ov5647.c index 480328d..b05970d 100644 --- a/buildroot-overlay/package/vvcam/src/ov5647.c +++ b/buildroot-overlay/package/vvcam/src/ov5647.c @@ -1,4 +1,5 @@ #include "common.h" +#include #include #include #include @@ -8,20 +9,81 @@ #include #include #include +#include + +#define I2C_SLAVE_ADDRESS 0x36 +#define CHECK_ERROR(x) if(x)return -1 + +#define OV5647_REG_CHIP_ID_H 0x300a +#define OV5647_REG_CHIP_ID_L 0x300b +#define OV5647_REG_MIPI_CTRL00 0x4800 +#define OV5647_REG_FRAME_OFF_NUMBER 0x4202 +#define OV5647_REG_PAD_OUT 0x300d + +#define OV5647_REG_VTS_H 0x380e +#define OV5647_REG_VTS_L 0x380f + +#define OV5647_REG_MIPI_CTRL14 0x4814 + +#define OV5647_SW_STANDBY 0x0100 + + +#define OV5647_REG_LONG_AGAIN_H 0x350a +#define OV5647_REG_LONG_AGAIN_L 0x350b + +#define OV5647_REG_LONG_EXP_TIME_H 0x3501 +#define OV5647_REG_LONG_EXP_TIME_L 0x3502 + +#define OV5647_MIN_GAIN_STEP (1.0f/16.0f) +#define OV5647_SW_RESET 0x0103 +#define MIPI_CTRL00_CLOCK_LANE_GATE (1 << 5) +#define MIPI_CTRL00_LINE_SYNC_ENABLE (1 << 4) +#define MIPI_CTRL00_BUS_IDLE (1 << 1) +#define MIPI_CTRL00_CLOCK_LANE_DISABLE (1 << 0) + struct ov5647_ctx { int i2c; }; +static int read_reg(struct ov5647_ctx* ctx, uint16_t addr, uint8_t* value) { + struct i2c_msg msg[2]; + struct i2c_rdwr_ioctl_data data; + + addr = htobe16(addr); + msg[0].addr = I2C_SLAVE_ADDRESS; + msg[0].buf = (uint8_t*)&addr; + msg[0].len = 2; + msg[0].flags = 0; + + msg[1].addr = I2C_SLAVE_ADDRESS; + msg[1].buf = value; + msg[1].len = 1; + msg[1].flags = I2C_M_RD; + + data.msgs = msg; + data.nmsgs = 2; + + int ret = ioctl(ctx->i2c, I2C_RDWR, &data); + if (ret != 2) { + fprintf(stderr, "ov5647: i2c read reg %04x error %d(%s)\n", be16toh(addr), errno, strerror(errno)); + return -1; + } + + return 0; +} + static int write_reg(struct ov5647_ctx* ctx, uint16_t addr, uint8_t value) { uint8_t buffer[3]; + buffer[0] = (addr >> 8) & 0xff; buffer[1] = (addr >> 0) & 0xff; buffer[2] = value; if (write(ctx->i2c, buffer, 3) != 3) { + fprintf(stderr, "ov5647: i2c write reg %04x error %d(%s)\n", addr, errno, strerror(errno)); return -1; } - printf("ov5647 w %04x %02x\n", addr, value); + // printf("ov5647 w %04x %02x\n", addr, value); return 0; } @@ -33,7 +95,7 @@ static int open_i2c(struct ov5647_ctx* sensor) { perror("open /dev/i2c-0"); return -1; } - if (ioctl(sensor->i2c, I2C_SLAVE_FORCE, 0x36) < 0) { + if (ioctl(sensor->i2c, I2C_SLAVE_FORCE, I2C_SLAVE_ADDRESS) < 0) { perror("i2c ctrl 0x36"); return -1; } @@ -151,13 +213,17 @@ static struct reg_list ov5647_1920x1080_30fps[] = { {0x4800, 0x34}, {0x3503, 0x07}, //0x0f {0x350b, 0x10}, + {0x3500, 0x3}, + {0x350a, 0x00}, + {0x350b, 0x30}, {0, 0} }; -static struct ov5647_mode { +struct ov5647_mode { struct vvcam_sensor_mode mode; struct reg_list* regs; -} modes[] = { +}; +static struct ov5647_mode modes[] = { { .mode = { .clk = 25000000, @@ -166,11 +232,52 @@ static struct ov5647_mode { .lanes = VVCAM_SENSOR_2LANE, .freq = VVCAM_SENSOR_800M, .bayer = VVCAM_BAYER_PAT_GBRG, - .bit_width = 10 + .bit_width = 10, + .ae_info = { + .frame_length = 1199, + .cur_frame_length = 1199, + .one_line_exp_time = 0.000027808, + .gain_accuracy = 1024, + .min_gain = 1.0, + .max_gain = 8.0, + .int_time_delay_frame = 2, + .gain_delay_frame = 2, + .color_type = 0, + .integration_time_increment = 0.000027808, + .gain_increment = (1.0f/16.0f), + .max_long_integraion_line = 1199 - 12, + .min_long_integraion_line = 2, + .max_integraion_line = 1199 - 12, + .min_integraion_line = 2, + .max_long_integraion_time = 1199 * (1199 - 12), + .min_long_integraion_time = 1199 * (1199 - 12), + .max_integraion_time = 1199 * (1199 - 12), + .min_integraion_time = 1199 * (1199 - 12), + .cur_long_integration_time = 0.0, + .cur_integration_time = 0.0, + .cur_long_again = 0.0, + .cur_long_dgain = 0.0, + .cur_again = 0.0, + .cur_dgain = 0.0, + .a_long_gain.min = 1.0, + .a_long_gain.max = 8.0, + .a_long_gain.step = (1.0f/16.0f), + .a_gain.min = 1.0, + .a_gain.max = 8.0, + .a_gain.step = (1.0f/16.0f), + .d_long_gain.max = 1.0, + .d_long_gain.min = 1.0, + .d_long_gain.step = (1.0f/1024.0f), + .d_gain.max = 1.0, + .d_gain.min = 1.0, + .d_gain.step = (1.0f/1024.0f), + .cur_fps = 30, + } }, .regs = ov5647_1920x1080_30fps } }; +static unsigned modes_len = sizeof(modes) / sizeof(struct ov5647_mode); static int enum_mode(void* ctx, uint32_t index, struct vvcam_sensor_mode* mode) { if (index == 0) { @@ -182,23 +289,44 @@ static int enum_mode(void* ctx, uint32_t index, struct vvcam_sensor_mode* mode) } static int get_mode(void* ctx, struct vvcam_sensor_mode* mode) { - memcpy(mode, &modes[0], sizeof(struct vvcam_sensor_mode)); + memcpy(mode, &modes[0].mode, sizeof(struct vvcam_sensor_mode)); return 0; } -static int set_mode(void* ctx, struct vvcam_sensor_mode* mode) { +static int set_mode(void* ctx, uint32_t index) { struct ov5647_ctx* sensor = ctx; + if (index > modes_len) { + // out of range + return -1; + } + struct vvcam_sensor_mode* mode = &modes[index].mode; printf("ov5647: %s %ux%u\n", __func__, mode->width, mode->height); if (open_i2c(sensor)) { return -1; } - // FIXME: find nearest mode + uint8_t channel_id; + CHECK_ERROR(read_reg(ctx, OV5647_REG_MIPI_CTRL14, &channel_id)); + channel_id &= ~(3 << 6); + CHECK_ERROR(write_reg(ctx, OV5647_REG_MIPI_CTRL14, channel_id)); for(unsigned i = 0;; i++) { if ((modes[0].regs[i].addr == 0) && (modes[0].regs[i].value == 0)) { break; } - write_reg(sensor, modes[0].regs[i].addr, modes[0].regs[i].value); + CHECK_ERROR(write_reg(sensor, modes[0].regs[i].addr, modes[0].regs[i].value)); } + uint8_t again_h, again_l; + uint8_t exp_time_h, exp_time_l; + uint8_t exp_time; + float again = 0, dgain = 0; + + CHECK_ERROR(read_reg(ctx, OV5647_REG_LONG_AGAIN_H, &again_h)); + CHECK_ERROR(read_reg(ctx, OV5647_REG_LONG_AGAIN_L, &again_l)); + again = (float)(((again_h & 0x03) << 8) + again_l) / 16.0f; + dgain = 1.0; + mode->ae_info.cur_gain = again * dgain; + mode->ae_info.cur_long_gain = mode->ae_info.cur_gain; + mode->ae_info.cur_vs_gain = mode->ae_info.cur_gain; + return 0; } diff --git a/buildroot-overlay/package/vvcam/src/version.c b/buildroot-overlay/package/vvcam/src/version.c new file mode 100644 index 0000000..f4090ed --- /dev/null +++ b/buildroot-overlay/package/vvcam/src/version.c @@ -0,0 +1,3 @@ +#include + +uint64_t vvcam_api_version = VVCAM_API_VERSION; diff --git a/buildroot-overlay/package/vvcam/v4l2-drm/CMakeLists.txt b/buildroot-overlay/package/vvcam/v4l2-drm/CMakeLists.txt new file mode 100644 index 0000000..e51a57d --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2-drm/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.5) + +set(CMAKE_BUILD_TYPE Debug) + +project(v4l2-drm) + +include(FindPkgConfig) +find_package(PkgConfig REQUIRED) +pkg_check_modules(DISPLAY REQUIRED display) + +include_directories(include ${DISPLAY_INCLUDE_DIRS}) + +add_library(${PROJECT_NAME} src/lib.c) +target_link_libraries(${PROJECT_NAME} ${DISPLAY_LIBRARIES}) + +add_executable(${PROJECT_NAME}-test src/main.c) +target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) +set_target_properties(${PROJECT_NAME}-test PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) + +install(TARGETS ${PROJECT_NAME} DESTINATION /usr/lib) +install(TARGETS ${PROJECT_NAME}-test DESTINATION /usr/bin) +install(DIRECTORY include/ DESTINATION include) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc + @ONLY +) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig) diff --git a/buildroot-overlay/package/vvcam/v4l2-drm/include/v4l2-drm.h b/buildroot-overlay/package/vvcam/v4l2-drm/include/v4l2-drm.h new file mode 100644 index 0000000..4f7bb1e --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2-drm/include/v4l2-drm.h @@ -0,0 +1,55 @@ +#pragma once +#ifndef __V4L2_DRM_H__ +#define __V4L2_DRM_H__ + +#define DRM_BUFFERING 2 + +#ifdef __cplusplus +extern "C" { +#endif + +#include "display.h" +#include +#include +#include + +struct v4l2_drm_context { + unsigned width; + unsigned height; + unsigned device; + int video_fd; + unsigned frame_count; + uint32_t video_format; + uint32_t display_format; + bool display; + unsigned buffer_num; + struct display_plane* plane; + struct display_buffer** buffers; + unsigned offset_x; + unsigned offset_y; + bool flag_dqbuf; + uint8_t wp; + struct v4l2_buffer vbuffer; + int buffer_hold[DRM_BUFFERING]; + bool flag_dump; + void** mmap; +}; + +typedef int(*v4l2_drm_handler)(struct v4l2_drm_context* ctx, bool displayed); + +void v4l2_drm_default_context(struct v4l2_drm_context* ctx); +// use /dev/dri/card0 as default +int v4l2_drm_setup(struct v4l2_drm_context context[], unsigned num, struct display** display); +/** + * + * @param fps Array of FPS output, NULL if not used + */ +int v4l2_drm_run(struct v4l2_drm_context ctx[], unsigned num, v4l2_drm_handler handler); +int v4l2_drm_dump(struct v4l2_drm_context* context, struct v4l2_buffer* buffer, unsigned timeout); +int v4l2_drm_dump_release(struct v4l2_drm_context* context, struct v4l2_buffer* buffer); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2-drm/src/common.h b/buildroot-overlay/package/vvcam/v4l2-drm/src/common.h new file mode 100644 index 0000000..74c4a1f --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2-drm/src/common.h @@ -0,0 +1,8 @@ +#pragma once +#ifndef __COMMON_H__ +#define __COMMON_H__ + +#define pr(fmt,...) fprintf(stderr,"[v4l2_drm] "fmt"\n", ##__VA_ARGS__) +#define CKE(x,go) do{int e=(x);if(e){pr(""#x" error %d(%s) at line %d",errno,strerror(errno),__LINE__);goto go;}}while(0) + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2-drm/src/lib.c b/buildroot-overlay/package/vvcam/v4l2-drm/src/lib.c new file mode 100644 index 0000000..dac93db --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2-drm/src/lib.c @@ -0,0 +1,344 @@ +#include "common.h" +#include "display.h" +#include "v4l2-drm.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void v4l2_drm_default_context(struct v4l2_drm_context* ctx) { + ctx->width = 640; + ctx->height = 480; + ctx->device = 0; + ctx->video_fd = -1; + ctx->video_format = V4L2_PIX_FMT_NV12; + ctx->display_format = DRM_FORMAT_NV12; + ctx->display = true; + ctx->buffer_num = DRM_BUFFERING + 3; + ctx->plane = NULL; + ctx->flag_dqbuf = true; + ctx->offset_x = 0; + ctx->offset_y = 0; + ctx->frame_count = 0; + ctx->flag_dqbuf = false; + for (unsigned i = 0; i < DRM_BUFFERING; i++) { + ctx->buffer_hold[i] = -1; + } + ctx->wp = 0; + ctx->flag_dump = false; +} + +static uint32_t v4l2_to_drm(uint32_t fourcc) { + switch (fourcc) { + case V4L2_PIX_FMT_NV12: return DRM_FORMAT_NV12; + case V4L2_PIX_FMT_NV21: return DRM_FORMAT_NV21; + case V4L2_PIX_FMT_NV16: return DRM_FORMAT_NV16; + case V4L2_PIX_FMT_NV61: return DRM_FORMAT_NV61; + case V4L2_PIX_FMT_BGR24: return DRM_FORMAT_BGR888; + case V4L2_PIX_FMT_RGB24: return DRM_FORMAT_RGB888; + case V4L2_PIX_FMT_YUYV: return DRM_FORMAT_YUYV; + default: + pr( + "no plane for video format %c%c%c%c", + (fourcc >> 0) & 0xff, + (fourcc >> 8) & 0xff, + (fourcc >> 16) & 0xff, + (fourcc >> 24) & 0xff + ); + return 0; + } +} + +int v4l2_drm_setup(struct v4l2_drm_context context[], unsigned num, struct display** display) { + struct display* d = NULL; + if (display && *display) { + d = *display; + } + for (unsigned i = 0; i < num; i++) { + if (context[i].display && context[i].plane == NULL) { + if (d == NULL) { + d = display_init(0); + CKE(d == NULL, close); + } + if (context[i].display_format == 0) { + context[i].display_format = v4l2_to_drm(context[i].video_format); + CKE(context[i].display_format == 0, close); + } + context[i].plane = display_get_plane(d, context[i].display_format); + CKE(context[i].plane == NULL, close); + context[i].buffers = malloc(sizeof(struct display_buffer*) * context[i].buffer_num); + for (unsigned j = 0; j < context[i].buffer_num; j++) { + CKE(display_allocate_buffer(context[i].plane, context[i].width, context[i].height) == NULL, close); + } + } + char cam_device_path[64]; + snprintf(cam_device_path, sizeof(cam_device_path) - 1, "/dev/video%u", context[i].device); + context[i].video_fd = open(cam_device_path, O_RDWR | O_NONBLOCK); + CKE(context[i].video_fd < 0, close); + + struct v4l2_capability capbility; + CKE(ioctl(context[i].video_fd, VIDIOC_QUERYCAP, &capbility), close); + + struct v4l2_fmtdesc fmtdesc; + memset(&fmtdesc, 0, sizeof(fmtdesc)); + fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + while (ioctl(context[i].video_fd, VIDIOC_ENUM_FMT, &fmtdesc) == 0) { + pr( + "/dev/video%u support format %c%c%c%c", + context[i].device, + (fmtdesc.pixelformat >> 0) & 0xff, + (fmtdesc.pixelformat >> 8) & 0xff, + (fmtdesc.pixelformat >> 16) & 0xff, + (fmtdesc.pixelformat >> 24) & 0xff + ); + fmtdesc.index += 1; + } + + struct v4l2_format format; + format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + CKE(ioctl(context[i].video_fd, VIDIOC_G_FMT, &format), close); + format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + format.fmt.pix.pixelformat = context[i].video_format; + format.fmt.pix.width = context[i].width; + format.fmt.pix.height = context[i].height; + CKE(ioctl(context[i].video_fd, VIDIOC_S_FMT, &format), close); + + struct v4l2_requestbuffers request_buffer; + memset(&request_buffer, 0, sizeof(request_buffer)); + request_buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + if (context[i].display) { + request_buffer.memory = V4L2_MEMORY_DMABUF; + } else { + request_buffer.memory = V4L2_MEMORY_MMAP; + } + request_buffer.count = context[i].buffer_num; + CKE(ioctl(context[i].video_fd, VIDIOC_REQBUFS, &request_buffer), close); + context[i].mmap = malloc(sizeof(void*) * context[i].buffer_num); + if (context[i].display) { + struct display_buffer* db = context[i].plane->buffers; + for (unsigned j = 0; j < context[i].buffer_num; j++) { + memset(&context[i].vbuffer, 0, sizeof(context[i].vbuffer)); + context[i].vbuffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + context[i].vbuffer.memory = V4L2_MEMORY_DMABUF; + context[i].vbuffer.index = j; + context[i].vbuffer.m.fd = db->dmabuf_fd; + context[i].vbuffer.length = db->size; + CKE(ioctl(context[i].video_fd, VIDIOC_QBUF, &context[i].vbuffer), close); + context[i].buffers[j] = db; + context[i].mmap[j] = db->map; + db = db->next; + } + } else { + for (unsigned j = 0; j < context[i].buffer_num; j++) { + memset(&context[i].vbuffer, 0, sizeof(context[i].vbuffer)); + context[i].vbuffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + context[i].vbuffer.memory = V4L2_MEMORY_MMAP; + context[i].vbuffer.index = j; + CKE(ioctl(context[i].video_fd, VIDIOC_QUERYBUF, &context[i].vbuffer), close); + CKE(ioctl(context[i].video_fd, VIDIOC_QBUF, &context[i].vbuffer), close); + context[i].mmap[j] = mmap( + NULL, + context[i].vbuffer.length, + PROT_READ | PROT_WRITE, + MAP_SHARED, + context[i].video_fd, + context[i].vbuffer.m.offset + ); + CKE(context[i].mmap[j] == MAP_FAILED, close); + } + } + continue; + + close: + for (unsigned j = 0; j <= i; j++) { + close(context[i].video_fd); + context[i].video_fd = -1; + } + if (d) { + display_exit(d); + } + return -1; + } + if (display) { + *display = d; + } + return 0; +} + +static unsigned dump_count = 0; + +static void dump_file(const struct v4l2_drm_context* ctx, unsigned channel) { + char filename[128]; + snprintf( + filename, + sizeof(filename), + "Image_%u_%u_%ux%u.%c%c%c%c", + channel, dump_count, + ctx->width, ctx->height, + (ctx->video_format >> 0) & 0xff, + (ctx->video_format >> 8) & 0xff, + (ctx->video_format >> 16) & 0xff, + (ctx->video_format >> 24) & 0xff + ); + FILE* f = fopen(filename, "w"); + if (f == NULL) { + pr("open %s error %d(%s)", filename, errno, strerror(errno)); + return; + } + fwrite(ctx->mmap[ctx->vbuffer.index], 1, ctx->vbuffer.length, f); + fclose(f); + pr("dump file to %s", filename); +} + +int v4l2_drm_run(struct v4l2_drm_context context[], unsigned num, v4l2_drm_handler handler) { + int flag_enable_display = 0; + int display_fd; + struct display* d = NULL; + for (unsigned i = 0; i < num; i++) { + int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + CKE(ioctl(context[i].video_fd, VIDIOC_STREAMON, &type), streamerr); + if (context[i].display) { + if (flag_enable_display == 0) { + // trig vsync + display_commit_buffer(context[i].buffers[0], context[i].offset_x, context[i].offset_y); + } + flag_enable_display = 1; + d = context[i].plane->display; + display_fd = d->fd; + } + continue; + streamerr: + for (unsigned j = 0; j < i; j++) { + ioctl(context[i].video_fd, VIDIOC_STREAMOFF, &type); + } + return -1; + } + uint32_t display_frame_count = 0; + uint32_t frame_count_fps[num]; + memset(frame_count_fps, 0, sizeof(uint32_t) * num); + struct pollfd fds[num + flag_enable_display]; + struct timeval tv, tv2; + gettimeofday(&tv, NULL); + while (1) { + for (unsigned i = 0; i < num; i++) { + fds[i].fd = context[i].video_fd; + fds[i].events = POLLIN | POLLPRI; + fds[i].revents = 0; + } + if (flag_enable_display) { + fds[num].fd = display_fd; + fds[num].events = POLLIN | POLLPRI; + fds[num].revents = 0; + } + int ret = poll(fds, num + flag_enable_display, 1000); + if (((ret < 0) && (errno == EINTR)) || (ret == 0)) { + continue; + } else if (ret < 0) { + pr("poll error %d(%s)", errno, strerror(errno)); + break; + } + + for (unsigned i = 0; i < num; i++) { + context[i].vbuffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + if (context[i].display) { + context[i].vbuffer.memory = V4L2_MEMORY_DMABUF; + } else { + context[i].vbuffer.memory = V4L2_MEMORY_MMAP; + } + if (fds[i].revents) { + if (context[i].flag_dqbuf) { + // drop frame + if (ioctl(context[i].video_fd, VIDIOC_DQBUF, &context[i].vbuffer)) { + continue; + } + context[i].frame_count += 1; + if (context[i].flag_dump) { + dump_file(&context[i], i); + context[i].flag_dump = false; + } + ioctl(context[i].video_fd, VIDIOC_QBUF, &context[i].vbuffer); + continue; + } + context[i].wp = (context[i].wp + 1) % DRM_BUFFERING; + if (context[i].buffer_hold[context[i].wp] >= 0) { + // QBUF displayed frame + context[i].vbuffer.index = context[i].buffer_hold[context[i].wp]; + ioctl(context[i].video_fd, VIDIOC_QBUF, &context[i].vbuffer); + } + // DQBUF + if (ioctl(context[i].video_fd, VIDIOC_DQBUF, &context[i].vbuffer) < 0) { + // error, skip this frame + continue; + } + if (context[i].flag_dump) { + dump_file(&context[i], i); + context[i].flag_dump = false; + } + context[i].frame_count += 1; + context[i].buffer_hold[context[i].wp] = context[i].vbuffer.index; + context[i].flag_dqbuf = true; + } + } + + int ch = 0; + if (handler) { + ch = handler(context, flag_enable_display && fds[num].revents); + switch (ch) { + case -1: + case 'q': goto streamoff; + case 'd': + dump_count += 1; + for (unsigned i = 0; i < num; i++) { + context[i].flag_dump = true; + } + break; + default: + break; + } + } + + if (flag_enable_display && fds[num].revents) { + // display + bool flag_check_source = false; + for (unsigned i = 0; i < num; i++) { + if ((context[i].buffer_hold[context[i].wp] >= 0) && (context[i].display)) { + flag_check_source = true; + break; + } + } + if (!flag_check_source) { + // skip + continue; + } + display_handle_vsync(d); + for (unsigned i = 0; i < num; i++) { + if ((!context[i].display) || (context[i].buffer_hold[context[i].wp] < 0)) { + continue; + } + CKE(display_update_buffer( + context[i].buffers[context[i].buffer_hold[context[i].wp]], + context[i].offset_x, context[i].offset_y + ), streamoff); + context[i].flag_dqbuf = false; + } + CKE(display_commit(d), streamoff); + display_frame_count += 1; + } + } + streamoff: + for (unsigned i = 0; i < num; i++) { + int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + ioctl(context[i].video_fd, VIDIOC_STREAMOFF, &type); + close(context[i].video_fd); + } + return 0; +} diff --git a/buildroot-overlay/package/vvcam/v4l2-drm/src/main.c b/buildroot-overlay/package/vvcam/v4l2-drm/src/main.c new file mode 100644 index 0000000..806af5e --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2-drm/src/main.c @@ -0,0 +1,177 @@ +#include "display.h" +#include "v4l2-drm.h" +#include "common.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void help(const char* argv0) { + printf("Usage: %s -d 1 -w 480 -h 320\n", argv0); + printf( + "Options:\n" + "\t-d Video device number\n" + "\t-w Width\n" + "\t-h Height\n" + "\t-n Buffer number\n" + "\t-f Format, NV12/NV16\n" + "\t-s Disable display\n" + "\t-x | --crop-x Crop offset X\n" + "\t-y | --crop-y Crop offset Y\n" + "\t--crop-width Crop width\n" + "\t--crop-height Crop height\n" + ); +} + +static uint32_t to_v4l2_fourcc(const char* fourcc) { + return v4l2_fourcc(fourcc[0], fourcc[1], fourcc[2], fourcc[3]); +} + +static int parse_cmd(int argc, char* argv[], struct v4l2_drm_context* context) { + int ch; + int option_index = 0; + int context_idx = -1; + + struct option longopt[] = { + { + "crop-x", + required_argument, + NULL, + 'x' + }, + { + "crop-y", + required_argument, + NULL, + 'y' + }, + { + "crop-width", + required_argument, + NULL, + 257, + }, + { + "crop-height", + required_argument, + NULL, + 258 + }, + {0, 0, 0, 0} + }; + + while((ch = getopt_long_only(argc, argv, "w:h:d:n:f:sx:y:", longopt, &option_index)) != -1) { + if ((context_idx < 0) && (ch != 'd')) { + help(argv[0]); + return -1; + } + switch (ch) { + case 'w': + context[context_idx].width = atoi(optarg); + break; + case 'h': + context[context_idx].height = atoi(optarg); + break; + case 'd': + context_idx += 1; + v4l2_drm_default_context(&context[context_idx]); + context[context_idx].device = atoi(optarg); + break; + case 'n': + context[context_idx].buffer_num = atoi(optarg); + break; + case 'f': + context[context_idx].video_format = to_v4l2_fourcc(optarg); + if (context[context_idx].display_format == 0) { + context[context_idx].display = false; + } + break; + case 's': + // disable display + context[context_idx].display = false; + break; + default: + help(argv[0]); + return -1; + } + } + + return context_idx + 1; +} + +static struct timeval tv, tv2; +static struct display* display = NULL; +static int num = 0; + +int handler(struct v4l2_drm_context* context, bool displayed) { + // FPS + static unsigned response = 0, display_frame_count = 0; + response += 1; + if (displayed) { + display_frame_count += 1; + } + gettimeofday(&tv2, NULL); + uint64_t duration = 1000000 * (tv2.tv_sec - tv.tv_sec) + tv2.tv_usec - tv.tv_usec; + if (duration >= 1000000) { + fprintf(stderr, " poll: %.2f, ", response * 1000000. / duration); + response = 0; + if (display) { + fprintf(stderr, "display: %.2f, ", display_frame_count * 1000000. / duration); + display_frame_count = 0; + } + for (unsigned i = 0; i < num; i++) { + fprintf(stderr, "[%u]: %.2f, ", i, context[i].frame_count * 1000000. / duration); + context[i].frame_count = 0; + } + fprintf(stderr, " \r"); + fflush(stderr); + gettimeofday(&tv, NULL); + } + // key + char c; + ssize_t n = read(STDIN_FILENO, &c, 1); + if ((n > 0) && (c != '\n')) { + return c; + } + if ((n < 0) && (errno != EAGAIN)) { + return -1; + } + return 0; +} + +int main(int argc, char* argv[]) { + struct v4l2_drm_context context[9]; + int flag_display = 0; + + int ret = parse_cmd(argc, argv, context); + if (ret < 0) { + return -1; + } + num = ret; + ret = v4l2_drm_setup(context, num, &display); + if (ret < 0) { + return -1; + } + if (display) { + flag_display = 1; + } + int flag = fcntl(STDIN_FILENO, F_GETFL); + flag |= O_NONBLOCK; + if (fcntl(STDIN_FILENO, F_SETFL, flag)) { + pr("can't set stdin non-block"); + goto streamoff; + } + gettimeofday(&tv, NULL); + + ret = v4l2_drm_run(context, num, handler); + + streamoff: + if (display) { + display_exit(display); + } + return 0; +} diff --git a/buildroot-overlay/package/vvcam/v4l2-drm/v4l2-drm.pc.in b/buildroot-overlay/package/vvcam/v4l2-drm/v4l2-drm.pc.in new file mode 100644 index 0000000..33ac126 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2-drm/v4l2-drm.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +includedir=${prefix}/include +libdir=${prefix}/lib + +Name: @PROJECT_NAME@ +Description: @PROJECT_DESCRIPTION@ +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -l@PROJECT_NAME@ +Libs.private: -ldisplay +Cflags: -I${includedir} \ No newline at end of file diff --git a/buildroot-overlay/package/vvcam/v4l2/Makefile b/buildroot-overlay/package/vvcam/v4l2/Makefile new file mode 100644 index 0000000..1596633 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/Makefile @@ -0,0 +1,61 @@ +############################################################################## +# +# The MIT License (MIT) +# +# Copyright (c) 2014 - 2024 Vivante Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +############################################################################## +# +# The GPL License (GPL) +# +# Copyright (C) 2014 - 2024 Vivante Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################## +# +# Note: This software is released under dual MIT and GPL licenses. A +# recipient may use this file under the terms of either the MIT license or +# GPL License. If you wish to use only one license not the other, you can +# indicate your decision by deleting one of the above license notices in your +# version of this file. +# +############################################################################## + + +all: + @cd isp; make || exit $$?; + @cd video; make || exit $$?; +clean: + @cd isp; make clean; + @cd video; make clean; diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v3/vvcam_isp_2dnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v3/vvcam_isp_2dnr.c index 0d40b57..e93cc05 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v3/vvcam_isp_2dnr.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v3/vvcam_isp_2dnr.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -106,6 +108,9 @@ static int vvcam_isp_2dnr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_2DNR_MANU_PRE_GC_ENABLE: case VVCAM_ISP_CID_2DNR_MANU_STRENGTH: case VVCAM_ISP_CID_2DNR_MANU_SIGMA: + case VVCAM_ISP_CID_2DNR_STAT_PRE_GC_ENABLE: + case VVCAM_ISP_CID_2DNR_STAT_STRENGTH: + case VVCAM_ISP_CID_2DNR_STAT_SIGMA: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -236,7 +241,7 @@ const struct v4l2_ctrl_config vvcam_isp_2dnr_ctrls[] = { .dims = {1}, }, { - /* float 0.1~120. */ + /* float 0.1~12. */ .ops = &vvcam_isp_2dnr_ctrl_ops, .id = VVCAM_ISP_CID_2DNR_MANU_SIGMA, .type = V4L2_CTRL_TYPE_INTEGER, @@ -244,7 +249,40 @@ const struct v4l2_ctrl_config vvcam_isp_2dnr_ctrls[] = { .name = "isp_2dnr_manu_sigma", .step = 1, .min = 1, - .max = 1200, + .max = 120, + .def = 50, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_PRE_GC_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_pre_gc_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_strength", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + /* float 0.1~12. */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_SIGMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_sigma", + .step = 1, + .min = 1, + .max = 120, .def = 50, }, }; @@ -270,4 +308,3 @@ int vvcam_isp_2dnr_ctrl_create(struct vvcam_isp_dev *isp_dev) return 0; } - diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v3/vvcam_isp_2dnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v3/vvcam_isp_2dnr.h index 73c858f..19001d2 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v3/vvcam_isp_2dnr.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v3/vvcam_isp_2dnr.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_2DNR_H__ #define __VVCAM_ISP_2DNR_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_2DNR_ENABLE (VVCAM_ISP_CID_2DNR_BASE + 0x0000) #define VVCAM_ISP_CID_2DNR_RESET (VVCAM_ISP_CID_2DNR_BASE + 0x0001) #define VVCAM_ISP_CID_2DNR_MODE (VVCAM_ISP_CID_2DNR_BASE + 0x0002) @@ -67,8 +71,14 @@ (VVCAM_ISP_CID_2DNR_BASE + 0x0008) #define VVCAM_ISP_CID_2DNR_MANU_STRENGTH (VVCAM_ISP_CID_2DNR_BASE + 0x0009) #define VVCAM_ISP_CID_2DNR_MANU_SIGMA (VVCAM_ISP_CID_2DNR_BASE + 0x000A) +#define VVCAM_ISP_CID_2DNR_STAT_PRE_GC_ENABLE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x000B) +#define VVCAM_ISP_CID_2DNR_STAT_STRENGTH (VVCAM_ISP_CID_2DNR_BASE + 0x000C) +#define VVCAM_ISP_CID_2DNR_STAT_SIGMA (VVCAM_ISP_CID_2DNR_BASE + 0x000D) +#ifdef __KERNEL__ int vvcam_isp_2dnr_ctrl_count(void); int vvcam_isp_2dnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v5_2/vvcam_isp_2dnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v5_2/vvcam_isp_2dnr.c index d08fd50..c25958e 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v5_2/vvcam_isp_2dnr.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v5_2/vvcam_isp_2dnr.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -79,6 +81,7 @@ static int vvcam_isp_2dnr_s_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_2DNR_MANU_PRE_GC_STRENGTH: case VVCAM_ISP_CID_2DNR_MANU_STRENGTH: case VVCAM_ISP_CID_2DNR_MANU_SIGMA: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_RANGE: case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_X: case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_Y: ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); @@ -114,8 +117,15 @@ static int vvcam_isp_2dnr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_2DNR_MANU_PRE_GC_STRENGTH: case VVCAM_ISP_CID_2DNR_MANU_STRENGTH: case VVCAM_ISP_CID_2DNR_MANU_SIGMA: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_RANGE: case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_X: case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_Y: + case VVCAM_ISP_CID_2DNR_STAT_PRE_GC_STRENGTH: + case VVCAM_ISP_CID_2DNR_STAT_STRENGTH: + case VVCAM_ISP_CID_2DNR_STAT_SIGMA: + case VVCAM_ISP_CID_2DNR_STAT_SIGMA_RANGE: + case VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_X: + case VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_Y: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -219,7 +229,7 @@ const struct v4l2_ctrl_config vvcam_isp_2dnr_ctrls[] = { .name = "isp_2dnr_auto_strength", .step = 1, .min = 0, - .max = 0xFF, + .max = 127, .dims = {20}, }, { @@ -231,7 +241,7 @@ const struct v4l2_ctrl_config vvcam_isp_2dnr_ctrls[] = { .name = "isp_2dnr_auto_pre_gc_strength", .step = 1, .min = 0, - .max = 0xFF, + .max = 1, .dims = {20}, }, { @@ -243,7 +253,7 @@ const struct v4l2_ctrl_config vvcam_isp_2dnr_ctrls[] = { .name = "isp_2dnr_auto_luma_curve_x", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 4095, .dims = {20, 12}, }, { @@ -255,7 +265,7 @@ const struct v4l2_ctrl_config vvcam_isp_2dnr_ctrls[] = { .name = "isp_2dnr_auto_luma_curve_y", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 256, .dims = {20, 12}, }, { @@ -292,6 +302,17 @@ const struct v4l2_ctrl_config vvcam_isp_2dnr_ctrls[] = { .max = 1000, .def = 50, }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_SIGMA_RANGE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_sigma_range", + .step = 1, + .min = 0, + .max = 1, + .dims = {1}, + }, { /* uint16_t array 12x16bit */ .ops = &vvcam_isp_2dnr_ctrl_ops, @@ -313,7 +334,76 @@ const struct v4l2_ctrl_config vvcam_isp_2dnr_ctrls[] = { .name = "isp_2dnr_manu_luma_curve_y", .step = 1, .min = 0, - .max = 256, + .max = 16383, + .dims = {12}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_PRE_GC_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_pre_gc_strength", + .step = 1, + .min = 0, + .max = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_strength", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + /* float 0.1~100. */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_SIGMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_sigma", + .step = 1, + .min = 1, + .max = 1000, + .def = 50, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_SIGMA_RANGE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_sigma_range", + .step = 1, + .min = 0, + .max = 1, + .dims = {1}, + }, + { + /* uint16_t array 12x16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_luma_curve_x", + .step = 1, + .min = 0, + .max = 4095, + .dims = {12}, + }, + { + /* uint16_t array 12x16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_luma_curve_y", + .step = 1, + .min = 0, + .max = 16383, .dims = {12}, }, }; diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v5_2/vvcam_isp_2dnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v5_2/vvcam_isp_2dnr.h index 832bf0f..ac422e9 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v5_2/vvcam_isp_2dnr.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v5_2/vvcam_isp_2dnr.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_2DNR_H__ #define __VVCAM_ISP_2DNR_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_2DNR_ENABLE (VVCAM_ISP_CID_2DNR_BASE + 0x0000) #define VVCAM_ISP_CID_2DNR_RESET (VVCAM_ISP_CID_2DNR_BASE + 0x0001) #define VVCAM_ISP_CID_2DNR_ENABLE_LUMA (VVCAM_ISP_CID_2DNR_BASE + 0x0002) @@ -73,12 +77,24 @@ (VVCAM_ISP_CID_2DNR_BASE + 0x000C) #define VVCAM_ISP_CID_2DNR_MANU_STRENGTH (VVCAM_ISP_CID_2DNR_BASE + 0x000D) #define VVCAM_ISP_CID_2DNR_MANU_SIGMA (VVCAM_ISP_CID_2DNR_BASE + 0x000E) +#define VVCAM_ISP_CID_2DNR_MANU_SIGMA_RANGE (VVCAM_ISP_CID_2DNR_BASE + 0x000F) #define VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_X \ - (VVCAM_ISP_CID_2DNR_BASE + 0x000F) -#define VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_Y \ (VVCAM_ISP_CID_2DNR_BASE + 0x0010) +#define VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0011) +#define VVCAM_ISP_CID_2DNR_STAT_PRE_GC_STRENGTH \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0012) +#define VVCAM_ISP_CID_2DNR_STAT_STRENGTH (VVCAM_ISP_CID_2DNR_BASE + 0x0013) +#define VVCAM_ISP_CID_2DNR_STAT_SIGMA (VVCAM_ISP_CID_2DNR_BASE + 0x0014) +#define VVCAM_ISP_CID_2DNR_STAT_SIGMA_RANGE (VVCAM_ISP_CID_2DNR_BASE + 0x0015) +#define VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_X \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0016) +#define VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0017) +#ifdef __KERNEL__ int vvcam_isp_2dnr_ctrl_count(void); int vvcam_isp_2dnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v6/vvcam_isp_2dnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v6/vvcam_isp_2dnr.c new file mode 100644 index 0000000..e7acb6e --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v6/vvcam_isp_2dnr.c @@ -0,0 +1,1340 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_2dnr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_2dnr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_2DNR_ENABLE: + case VVCAM_ISP_CID_2DNR_LSC_COMP_ENABLE: + case VVCAM_ISP_CID_2DNR_MOTION_FAC_ENABLE: + case VVCAM_ISP_CID_2DNR_LUMA_ENABLE: + case VVCAM_ISP_CID_2DNR_RESET: + case VVCAM_ISP_CID_2DNR_MODE: + case VVCAM_ISP_CID_2DNR_AUTO_LEVEL: + case VVCAM_ISP_CID_2DNR_AUTO_GAIN: + case VVCAM_ISP_CID_2DNR_AUTO_VST_FAC: + case VVCAM_ISP_CID_2DNR_AUTO_BLEND_STATIC: + case VVCAM_ISP_CID_2DNR_AUTO_BLEND_MOTION: + case VVCAM_ISP_CID_2DNR_AUTO_BLEND_SLOPE: + case VVCAM_ISP_CID_2DNR_AUTO_SIGMA_OFFSET: + case VVCAM_ISP_CID_2DNR_AUTO_LUMA_CURVE_Y: + case VVCAM_ISP_CID_2DNR_AUTO_LSC_COMP_CURVE_Y: + case VVCAM_ISP_CID_2DNR_AUTO_MOTION_FAC_CURVE_Y: + case VVCAM_ISP_CID_2DNR_AUTO_MOTION_ANCHOR_X: + case VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_THR: + case VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_BOOST_THR: + case VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_BOOST: + case VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_CLIP_THR: + case VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_THR: + case VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_BOOST_THR: + case VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_BOOST: + case VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_CLIP_THR: + case VVCAM_ISP_CID_2DNR_AUTO_SIGMA_SCALE: + case VVCAM_ISP_CID_2DNR_AUTO_STATIC_FAC: + case VVCAM_ISP_CID_2DNR_AUTO_SIGMA_FAC_MUL: + case VVCAM_ISP_CID_2DNR_AUTO_SIGMA_FAC_MOTION_MAX: + case VVCAM_ISP_CID_2DNR_MANU_BLEND_STATIC: + case VVCAM_ISP_CID_2DNR_MANU_BLEND_MOTION: + case VVCAM_ISP_CID_2DNR_MANU_BLEND_SLOPE: + case VVCAM_ISP_CID_2DNR_MANU_VST_FAC: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_SCALE: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MUL: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MOTION_MAX: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MOTION_MIN: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_OFFSET: + case VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_THR: + case VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_BOOST_THR: + case VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_BOOST: + case VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_CLIP_THR: + case VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_THR: + case VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_BOOST_THR: + case VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_BOOST: + case VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_CLIP_THR: + case VVCAM_ISP_CID_2DNR_MANU_STATIC_FAC: + case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_X: + case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_Y: + case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_PX: + case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_INT_MODE: + case VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_X: + case VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_Y: + case VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_PX: + case VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_INT_MODE: + case VVCAM_ISP_CID_2DNR_MANU_MOTION_ANCHOR_X: + case VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_X: + case VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_Y: + case VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_PX: + case VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_INT_MODE: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_2dnr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_2DNR_ENABLE: + case VVCAM_ISP_CID_2DNR_LSC_COMP_ENABLE: + case VVCAM_ISP_CID_2DNR_MOTION_FAC_ENABLE: + case VVCAM_ISP_CID_2DNR_LUMA_ENABLE: + case VVCAM_ISP_CID_2DNR_RESET: + case VVCAM_ISP_CID_2DNR_MODE: + case VVCAM_ISP_CID_2DNR_AUTO_LEVEL: + case VVCAM_ISP_CID_2DNR_AUTO_GAIN: + case VVCAM_ISP_CID_2DNR_AUTO_VST_FAC: + case VVCAM_ISP_CID_2DNR_AUTO_BLEND_STATIC: + case VVCAM_ISP_CID_2DNR_AUTO_BLEND_MOTION: + case VVCAM_ISP_CID_2DNR_AUTO_BLEND_SLOPE: + case VVCAM_ISP_CID_2DNR_AUTO_SIGMA_OFFSET: + case VVCAM_ISP_CID_2DNR_AUTO_LUMA_CURVE_Y: + case VVCAM_ISP_CID_2DNR_AUTO_LSC_COMP_CURVE_Y: + case VVCAM_ISP_CID_2DNR_AUTO_MOTION_FAC_CURVE_Y: + case VVCAM_ISP_CID_2DNR_AUTO_MOTION_ANCHOR_X: + case VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_THR: + case VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_BOOST_THR: + case VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_BOOST: + case VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_CLIP_THR: + case VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_THR: + case VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_BOOST_THR: + case VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_BOOST: + case VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_CLIP_THR: + case VVCAM_ISP_CID_2DNR_AUTO_SIGMA_SCALE: + case VVCAM_ISP_CID_2DNR_AUTO_STATIC_FAC: + case VVCAM_ISP_CID_2DNR_AUTO_SIGMA_FAC_MUL: + case VVCAM_ISP_CID_2DNR_AUTO_SIGMA_FAC_MOTION_MAX: + case VVCAM_ISP_CID_2DNR_MANU_BLEND_STATIC: + case VVCAM_ISP_CID_2DNR_MANU_BLEND_MOTION: + case VVCAM_ISP_CID_2DNR_MANU_BLEND_SLOPE: + case VVCAM_ISP_CID_2DNR_MANU_VST_FAC: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_SCALE: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MUL: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MOTION_MAX: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MOTION_MIN: + case VVCAM_ISP_CID_2DNR_MANU_SIGMA_OFFSET: + case VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_THR: + case VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_BOOST_THR: + case VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_BOOST: + case VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_CLIP_THR: + case VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_THR: + case VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_BOOST_THR: + case VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_BOOST: + case VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_CLIP_THR: + case VVCAM_ISP_CID_2DNR_MANU_STATIC_FAC: + case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_X: + case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_Y: + case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_PX: + case VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_INT_MODE: + case VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_X: + case VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_Y: + case VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_PX: + case VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_INT_MODE: + case VVCAM_ISP_CID_2DNR_MANU_MOTION_ANCHOR_X: + case VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_X: + case VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_Y: + case VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_PX: + case VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_INT_MODE: + case VVCAM_ISP_CID_2DNR_STAT_BLEND_STATIC: + case VVCAM_ISP_CID_2DNR_STAT_BLEND_MOTION: + case VVCAM_ISP_CID_2DNR_STAT_BLEND_SLOPE: + case VVCAM_ISP_CID_2DNR_STAT_VST_FAC: + case VVCAM_ISP_CID_2DNR_STAT_SIGMA_SCALE: + case VVCAM_ISP_CID_2DNR_STAT_SIGMA_FAC_MUL: + case VVCAM_ISP_CID_2DNR_STAT_SIGMA_FAC_MOTION_MAX: + case VVCAM_ISP_CID_2DNR_STAT_SIGMA_FAC_MOTION_MIN: + case VVCAM_ISP_CID_2DNR_STAT_SIGMA_OFFSET: + case VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_THR: + case VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_BOOST_THR: + case VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_BOOST: + case VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_CLIP_THR: + case VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_THR: + case VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_BOOST_THR: + case VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_BOOST: + case VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_CLIP_THR: + case VVCAM_ISP_CID_2DNR_STAT_STATIC_FAC: + case VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_X: + case VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_Y: + case VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_PX: + case VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_INT_MODE: + case VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_X: + case VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_Y: + case VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_PX: + case VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_INT_MODE: + case VVCAM_ISP_CID_2DNR_STAT_MOTION_ANCHOR_X: + case VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_X: + case VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_Y: + case VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_PX: + case VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_INT_MODE: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_2dnr_ctrl_ops = { + .s_ctrl = vvcam_isp_2dnr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_2dnr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_2dnr_ctrls[] = { + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_LSC_COMP_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_lsc_comp_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MOTION_FAC_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_mot_fac_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_LUMA_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_luma_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* manual/auto */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float array 20*32bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20*32bit 1.0~1000.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_VST_FAC, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_vst_fac", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20*32bit 0~100.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_BLEND_STATIC, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_blend_stc", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20*32bit 0~100.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_BLEND_MOTION, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_blend_mot", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20*32bit 0~32.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_BLEND_SLOPE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_blend_slope", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_SIGMA_OFFSET, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_sigma_offset", + .step = 1, + .min = 0, + .max = 4095, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_LUMA_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_luma_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {20, 12, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_LSC_COMP_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_lsc_comp_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {20, 12, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_MOTION_FAC_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_mot_fac_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {20, 12, 0, 0}, + }, + { + /* uint16_t array 20*2*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_MOTION_ANCHOR_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_mot_anchor_x", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 2, 0, 0}, + }, + { + /* uint16_t array 20*2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_stc_dtl_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {20, 2, 3, 0}, + }, + { + /* uint16_t array 20*2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_BOOST_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_stc_dtl_boost_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {20, 2, 3, 0}, + }, + { + /* float array 20*2*3*16bit 1.0~4.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_BOOST, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_stc_dtl_boost", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 2, 3, 0}, + }, + { + /* uint16_t array 20*2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_CLIP_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_stc_dtl_clip_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {20, 2, 3, 0}, + }, + { + /* uint16_t array 20*2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_mov_dtl_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {20, 2, 3, 0}, + }, + { + /* uint16_t array 20*2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_BOOST_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_mov_dtl_boost_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {20, 2, 3, 0}, + }, + { + /* float array 20*2*3*32bit 1.0~4.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_BOOST, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_mov_dtl_boost", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 2, 3, 0}, + }, + { + /* uint16_t array 20*2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_CLIP_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_mov_dtl_clip_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {20, 2, 3, 0}, + }, + { + /* float array 20*3*32bit 0.001~100.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_SIGMA_SCALE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_sigma_scale", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 3, 0, 0}, + }, + { + /* float array 20*3*32bit 0.01~1.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_STATIC_FAC, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_stc_fac", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 3, 0, 0}, + }, + { + /* float array 20*3*32bit 0.1~10.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_SIGMA_FAC_MUL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_sigma_fac_mul", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 3, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_AUTO_SIGMA_FAC_MOTION_MAX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_auto_sigma_fac_mot_max", + .step = 1, + .min = 1, + .max = 1024, + .def = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* float 0.0~100.0 */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_BLEND_STATIC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_blend_stc", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.0~100.0 */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_BLEND_MOTION, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_blend_mot", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.0~32.0 */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_BLEND_SLOPE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_blend_slope", + .step = 1, + .min = 0, + .max = 320, + }, + { + /* float 1.0~1000.0 */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_VST_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_vst_fac", + .step = 1, + .def = 10, + .min = 10, + .max = 10000, + }, + { + /* float array 3*32bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_SIGMA_SCALE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_sigma_scale", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* float array 3*32bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MUL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_sigma_fac_mul", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MOTION_MAX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_sigma_fac_mot_max", + .step = 1, + .def = 1, + .min = 1, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MOTION_MIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_sigma_fac_mot_min", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_SIGMA_OFFSET, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_sigma_offset", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_stc_dtl_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_BOOST_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_stc_dtl_boost_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* float array 2*3*32bit 1.0~4.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_BOOST, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_stc_dtl_boost", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 3, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_CLIP_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_stc_dtl_clip_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_mov_dtl_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_BOOST_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_mov_dtl_boost_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* float array 2*3*32bit 1.0~4.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_BOOST, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_mov_dtl_boost", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 3, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_CLIP_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_mov_dtl_clip_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* float array 3*32bit 0.01~1.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_STATIC_FAC, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_stc_fac", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_luma_curve_x", + .step = 1, + .min = 0, + .max = 4095, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_luma_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_PX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_luma_curve_px", + .step = 1, + .min = 0, + .max = 12, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_INT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_luma_curve_im", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_lsc_comp_curve_x", + .step = 1, + .min = 0, + .max = 4095, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_lsc_comp_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_PX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_lsc_comp_curve_px", + .step = 1, + .min = 0, + .max = 12, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_INT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_lsc_comp_curve_im", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint16_t array 2*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_MOTION_ANCHOR_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_mot_anchor_x", + .step = 1, + .min = 0, + .max = 1024, + .dims = {2, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_mot_curve_x", + .step = 1, + .min = 0, + .max = 1024, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_mot_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_PX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_mot_curve_px", + .step = 1, + .min = 0, + .max = 10, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_INT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_manu_mot_curve_im", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float 0.0~100.0 */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_BLEND_STATIC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_blend_stc", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.0~100.0 */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_BLEND_MOTION, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_blend_mot", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.0~32.0 */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_BLEND_SLOPE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_blend_slope", + .step = 1, + .min = 0, + .max = 320, + }, + { + /* float 1.0~1000.0 */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_VST_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_vst_fac", + .step = 1, + .def = 10, + .min = 10, + .max = 10000, + }, + { + /* float array 3*32bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_SIGMA_SCALE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_sigma_scale", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* float array 3*32bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_SIGMA_FAC_MUL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_sigma_fac_mul", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_SIGMA_FAC_MOTION_MAX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_sigma_fac_mot_max", + .step = 1, + .def = 1, + .min = 1, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_SIGMA_FAC_MOTION_MIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_sigma_fac_mot_min", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_SIGMA_OFFSET, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_sigma_offset", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_stc_dtl_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_BOOST_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_stc_dtl_boost_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* float array 2*3*32bit 1.0~4.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_BOOST, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_stc_dtl_boost", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 3, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_CLIP_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_stc_dtl_clip_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_mov_dtl_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_BOOST_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_mov_dtl_boost_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* float array 2*3*32bit 1.0~4.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_BOOST, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_mov_dtl_boost", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* uint16_t array 2*3*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_CLIP_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_mov_dtl_clip_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {2, 3, 0, 0}, + }, + { + /* float array 3*32bit 0.01~1.0*/ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_STATIC_FAC, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_stc_fac", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_luma_curve_x", + .step = 1, + .min = 0, + .max = 4095, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_luma_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_PX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_luma_curve_px", + .step = 1, + .min = 0, + .max = 12, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_INT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_luma_curve_im", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_lsc_comp_curve_x", + .step = 1, + .min = 0, + .max = 4095, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_lsc_comp_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_PX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_lsc_comp_curve_px", + .step = 1, + .min = 0, + .max = 12, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_INT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_lsc_comp_curve_im", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint16_t array 2*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_MOTION_ANCHOR_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_mot_anchor_x", + .step = 1, + .min = 0, + .max = 1024, + .dims = {2, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_mot_curve_x", + .step = 1, + .min = 0, + .max = 1024, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_mot_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t array 12*16bit */ + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_PX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_mot_curve_px", + .step = 1, + .min = 0, + .max = 10, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_2dnr_ctrl_ops, + .id = VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_INT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_2dnr_stat_mot_curve_im", + .step = 1, + .min = 0, + .max = 1, + }, +}; + +int vvcam_isp_2dnr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_2dnr_ctrls); +} + +int vvcam_isp_2dnr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_2dnr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_2dnr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp 2dnr ctrl %s failed %d.\n", + vvcam_isp_2dnr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v6/vvcam_isp_2dnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v6/vvcam_isp_2dnr.h new file mode 100644 index 0000000..8bc6d11 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/2dnr/2dnr_v6/vvcam_isp_2dnr.h @@ -0,0 +1,233 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_2DNR_H__ +#define __VVCAM_ISP_2DNR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_2DNR_ENABLE (VVCAM_ISP_CID_2DNR_BASE + 0x0000) +#define VVCAM_ISP_CID_2DNR_LSC_COMP_ENABLE (VVCAM_ISP_CID_2DNR_BASE + 0x0001) +#define VVCAM_ISP_CID_2DNR_MOTION_FAC_ENABLE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0002) +#define VVCAM_ISP_CID_2DNR_LUMA_ENABLE (VVCAM_ISP_CID_2DNR_BASE + 0x0003) +#define VVCAM_ISP_CID_2DNR_RESET (VVCAM_ISP_CID_2DNR_BASE + 0x0004) +#define VVCAM_ISP_CID_2DNR_MODE (VVCAM_ISP_CID_2DNR_BASE + 0x0005) +#define VVCAM_ISP_CID_2DNR_AUTO_LEVEL (VVCAM_ISP_CID_2DNR_BASE + 0x0006) +#define VVCAM_ISP_CID_2DNR_AUTO_GAIN (VVCAM_ISP_CID_2DNR_BASE + 0x0007) +#define VVCAM_ISP_CID_2DNR_AUTO_VST_FAC (VVCAM_ISP_CID_2DNR_BASE + 0x0008) +#define VVCAM_ISP_CID_2DNR_AUTO_BLEND_STATIC \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0009) +#define VVCAM_ISP_CID_2DNR_AUTO_BLEND_MOTION \ + (VVCAM_ISP_CID_2DNR_BASE + 0x000A) +#define VVCAM_ISP_CID_2DNR_AUTO_BLEND_SLOPE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x000B) +#define VVCAM_ISP_CID_2DNR_AUTO_SIGMA_OFFSET \ + (VVCAM_ISP_CID_2DNR_BASE + 0x000C) +#define VVCAM_ISP_CID_2DNR_AUTO_LUMA_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x000D) +#define VVCAM_ISP_CID_2DNR_AUTO_LSC_COMP_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x000E) +#define VVCAM_ISP_CID_2DNR_AUTO_MOTION_FAC_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x000F) +#define VVCAM_ISP_CID_2DNR_AUTO_MOTION_ANCHOR_X \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0010) +#define VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0011) +#define VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_BOOST_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0012) +#define VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_BOOST \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0013) +#define VVCAM_ISP_CID_2DNR_AUTO_STATIC_DETAIL_CLIP_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0014) +#define VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0015) +#define VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_BOOST_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0016) +#define VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_BOOST \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0017) +#define VVCAM_ISP_CID_2DNR_AUTO_MOVING_DETAIL_CLIP_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0018) +#define VVCAM_ISP_CID_2DNR_AUTO_SIGMA_SCALE (VVCAM_ISP_CID_2DNR_BASE + 0x0019) +#define VVCAM_ISP_CID_2DNR_AUTO_STATIC_FAC (VVCAM_ISP_CID_2DNR_BASE + 0x001A) +#define VVCAM_ISP_CID_2DNR_AUTO_SIGMA_FAC_MUL \ + (VVCAM_ISP_CID_2DNR_BASE + 0x001B) +#define VVCAM_ISP_CID_2DNR_AUTO_SIGMA_FAC_MOTION_MAX \ + (VVCAM_ISP_CID_2DNR_BASE + 0x001C) +#define VVCAM_ISP_CID_2DNR_MANU_BLEND_STATIC \ + (VVCAM_ISP_CID_2DNR_BASE + 0x001D) +#define VVCAM_ISP_CID_2DNR_MANU_BLEND_MOTION \ + (VVCAM_ISP_CID_2DNR_BASE + 0x001E) +#define VVCAM_ISP_CID_2DNR_MANU_BLEND_SLOPE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x001F) +#define VVCAM_ISP_CID_2DNR_MANU_VST_FAC (VVCAM_ISP_CID_2DNR_BASE + 0x0020) +#define VVCAM_ISP_CID_2DNR_MANU_SIGMA_SCALE (VVCAM_ISP_CID_2DNR_BASE + 0x0021) +#define VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MUL \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0022) +#define VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MOTION_MAX \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0023) +#define VVCAM_ISP_CID_2DNR_MANU_SIGMA_FAC_MOTION_MIN \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0024) +#define VVCAM_ISP_CID_2DNR_MANU_SIGMA_OFFSET \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0025) +#define VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0026) +#define VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_BOOST_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0027) +#define VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_BOOST \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0028) +#define VVCAM_ISP_CID_2DNR_MANU_STATIC_DETAIL_CLIP_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0029) +#define VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x002A) +#define VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_BOOST_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x002B) +#define VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_BOOST \ + (VVCAM_ISP_CID_2DNR_BASE + 0x002C) +#define VVCAM_ISP_CID_2DNR_MANU_MOVING_DETAIL_CLIP_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x002D) +#define VVCAM_ISP_CID_2DNR_MANU_STATIC_FAC (VVCAM_ISP_CID_2DNR_BASE + 0x002E) +#define VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_X \ + (VVCAM_ISP_CID_2DNR_BASE + 0x002F) +#define VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0030) +#define VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_PX \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0031) +#define VVCAM_ISP_CID_2DNR_MANU_LUMA_CURVE_INT_MODE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0032) +#define VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_X \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0033) +#define VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0034) +#define VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_PX \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0035) +#define VVCAM_ISP_CID_2DNR_MANU_LSC_COMP_CURVE_INT_MODE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0036) +#define VVCAM_ISP_CID_2DNR_MANU_MOTION_ANCHOR_X \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0037) +#define VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_X \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0038) +#define VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0039) +#define VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_PX \ + (VVCAM_ISP_CID_2DNR_BASE + 0x003A) +#define VVCAM_ISP_CID_2DNR_MANU_MOTION_CURVE_INT_MODE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x003B) +#define VVCAM_ISP_CID_2DNR_STAT_BLEND_STATIC \ + (VVCAM_ISP_CID_2DNR_BASE + 0x003C) +#define VVCAM_ISP_CID_2DNR_STAT_BLEND_MOTION \ + (VVCAM_ISP_CID_2DNR_BASE + 0x003D) +#define VVCAM_ISP_CID_2DNR_STAT_BLEND_SLOPE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x003E) +#define VVCAM_ISP_CID_2DNR_STAT_VST_FAC (VVCAM_ISP_CID_2DNR_BASE + 0x003F) +#define VVCAM_ISP_CID_2DNR_STAT_SIGMA_SCALE (VVCAM_ISP_CID_2DNR_BASE + 0x0040) +#define VVCAM_ISP_CID_2DNR_STAT_SIGMA_FAC_MUL \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0041) +#define VVCAM_ISP_CID_2DNR_STAT_SIGMA_FAC_MOTION_MAX \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0042) +#define VVCAM_ISP_CID_2DNR_STAT_SIGMA_FAC_MOTION_MIN \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0043) +#define VVCAM_ISP_CID_2DNR_STAT_SIGMA_OFFSET \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0044) +#define VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0045) +#define VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_BOOST_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0046) +#define VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_BOOST \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0047) +#define VVCAM_ISP_CID_2DNR_STAT_STATIC_DETAIL_CLIP_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0048) +#define VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0049) +#define VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_BOOST_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x004A) +#define VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_BOOST \ + (VVCAM_ISP_CID_2DNR_BASE + 0x004B) +#define VVCAM_ISP_CID_2DNR_STAT_MOVING_DETAIL_CLIP_THR \ + (VVCAM_ISP_CID_2DNR_BASE + 0x004C) +#define VVCAM_ISP_CID_2DNR_STAT_STATIC_FAC (VVCAM_ISP_CID_2DNR_BASE + 0x004D) +#define VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_X \ + (VVCAM_ISP_CID_2DNR_BASE + 0x004E) +#define VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x004F) +#define VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_PX \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0050) +#define VVCAM_ISP_CID_2DNR_STAT_LUMA_CURVE_INT_MODE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0051) +#define VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_X \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0052) +#define VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0053) +#define VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_PX \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0054) +#define VVCAM_ISP_CID_2DNR_STAT_LSC_COMP_CURVE_INT_MODE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0055) +#define VVCAM_ISP_CID_2DNR_STAT_MOTION_ANCHOR_X \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0056) +#define VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_X \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0057) +#define VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_Y \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0058) +#define VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_PX \ + (VVCAM_ISP_CID_2DNR_BASE + 0x0059) +#define VVCAM_ISP_CID_2DNR_STAT_MOTION_CURVE_INT_MODE \ + (VVCAM_ISP_CID_2DNR_BASE + 0x005A) + +#ifdef __KERNEL__ +int vvcam_isp_2dnr_ctrl_count(void); +int vvcam_isp_2dnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v1_2/vvcam_isp_3dnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v1_2/vvcam_isp_3dnr.c index 48867b2..05431c3 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v1_2/vvcam_isp_3dnr.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v1_2/vvcam_isp_3dnr.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -106,6 +108,9 @@ static int vvcam_isp_3dnr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_3DNR_MANU_STRENGTH: case VVCAM_ISP_CID_3DNR_MANU_MOTION_INV: case VVCAM_ISP_CID_3DNR_MANU_DELTA: + case VVCAM_ISP_CID_3DNR_STAT_STRENGTH: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_INV: + case VVCAM_ISP_CID_3DNR_STAT_DELTA: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -197,9 +202,8 @@ const struct v4l2_ctrl_config vvcam_isp_3dnr_ctrls[] = { .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_3dnr_auto_motion_inv", .step = 1, - .min = 1, - .max = 10000, - .def = 1, + .min = 0, + .max = 65535, .dims = {20, 0, 0, 0}, }, { @@ -211,7 +215,7 @@ const struct v4l2_ctrl_config vvcam_isp_3dnr_ctrls[] = { .name = "isp_3dnr_auto_delta", .step = 1, .min = 0, - .max = 1024, + .max = 1023, .dims = {20, 0, 0, 0}, }, { @@ -233,7 +237,7 @@ const struct v4l2_ctrl_config vvcam_isp_3dnr_ctrls[] = { .name = "isp_3dnr_manu_motion_inv", .step = 1, .min = 0, - .max = 10000, + .max = 65535, }, { .ops = &vvcam_isp_3dnr_ctrl_ops, @@ -243,7 +247,39 @@ const struct v4l2_ctrl_config vvcam_isp_3dnr_ctrls[] = { .name = "isp_3dnr_manu_delta", .step = 1, .min = 0, - .max = 1024, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_INV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_motion_inv", + .step = 1, + .min = 0, + .max = 65535, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_DELTA, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_delta", + .step = 1, + .min = 0, + .max = 1023, .dims = {1, 0, 0, 0}, }, }; diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v1_2/vvcam_isp_3dnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v1_2/vvcam_isp_3dnr.h index c2510e1..72523ae 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v1_2/vvcam_isp_3dnr.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v1_2/vvcam_isp_3dnr.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_3DNR_H__ #define __VVCAM_ISP_3DNR_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_3DNR_ENABLE (VVCAM_ISP_CID_3DNR_BASE + 0x0000) #define VVCAM_ISP_CID_3DNR_RESET (VVCAM_ISP_CID_3DNR_BASE + 0x0001) #define VVCAM_ISP_CID_3DNR_MODE (VVCAM_ISP_CID_3DNR_BASE + 0x0002) @@ -65,8 +69,13 @@ #define VVCAM_ISP_CID_3DNR_MANU_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x0008) #define VVCAM_ISP_CID_3DNR_MANU_MOTION_INV (VVCAM_ISP_CID_3DNR_BASE + 0x0009) #define VVCAM_ISP_CID_3DNR_MANU_DELTA (VVCAM_ISP_CID_3DNR_BASE + 0x000A) +#define VVCAM_ISP_CID_3DNR_STAT_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x000B) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_INV (VVCAM_ISP_CID_3DNR_BASE + 0x000C) +#define VVCAM_ISP_CID_3DNR_STAT_DELTA (VVCAM_ISP_CID_3DNR_BASE + 0x000D) +#ifdef __KERNEL__ int vvcam_isp_3dnr_ctrl_count(void); int vvcam_isp_3dnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_1/vvcam_isp_3dnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_1/vvcam_isp_3dnr.c index 49ffc9e..5c6c538 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_1/vvcam_isp_3dnr.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_1/vvcam_isp_3dnr.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -106,6 +108,9 @@ static int vvcam_isp_3dnr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_3DNR_MANU_STRENGTH: case VVCAM_ISP_CID_3DNR_MANU_MOTION_INV: case VVCAM_ISP_CID_3DNR_MANU_DELTA: + case VVCAM_ISP_CID_3DNR_STAT_STRENGTH: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_INV: + case VVCAM_ISP_CID_3DNR_STAT_DELTA: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -197,9 +202,8 @@ const struct v4l2_ctrl_config vvcam_isp_3dnr_ctrls[] = { .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_3dnr_auto_motion_inv", .step = 1, - .min = 1, + .min = 0, .max = 65535, - .def = 1, .dims = {20, 0, 0, 0}, }, { @@ -246,6 +250,38 @@ const struct v4l2_ctrl_config vvcam_isp_3dnr_ctrls[] = { .max = 1023, .dims = {1, 0, 0, 0}, }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_strength", + .step = 1, + .min = 0, + .max = 127, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_INV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_motion_inv", + .step = 1, + .min = 0, + .max = 65535, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_DELTA, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_delta", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, }; int vvcam_isp_3dnr_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_1/vvcam_isp_3dnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_1/vvcam_isp_3dnr.h index c2510e1..72523ae 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_1/vvcam_isp_3dnr.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_1/vvcam_isp_3dnr.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_3DNR_H__ #define __VVCAM_ISP_3DNR_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_3DNR_ENABLE (VVCAM_ISP_CID_3DNR_BASE + 0x0000) #define VVCAM_ISP_CID_3DNR_RESET (VVCAM_ISP_CID_3DNR_BASE + 0x0001) #define VVCAM_ISP_CID_3DNR_MODE (VVCAM_ISP_CID_3DNR_BASE + 0x0002) @@ -65,8 +69,13 @@ #define VVCAM_ISP_CID_3DNR_MANU_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x0008) #define VVCAM_ISP_CID_3DNR_MANU_MOTION_INV (VVCAM_ISP_CID_3DNR_BASE + 0x0009) #define VVCAM_ISP_CID_3DNR_MANU_DELTA (VVCAM_ISP_CID_3DNR_BASE + 0x000A) +#define VVCAM_ISP_CID_3DNR_STAT_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x000B) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_INV (VVCAM_ISP_CID_3DNR_BASE + 0x000C) +#define VVCAM_ISP_CID_3DNR_STAT_DELTA (VVCAM_ISP_CID_3DNR_BASE + 0x000D) +#ifdef __KERNEL__ int vvcam_isp_3dnr_ctrl_count(void); int vvcam_isp_3dnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_4/vvcam_isp_3dnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_4/vvcam_isp_3dnr.c new file mode 100644 index 0000000..efca62a --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_4/vvcam_isp_3dnr.c @@ -0,0 +1,322 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_3dnr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_3dnr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_3DNR_ENABLE: + case VVCAM_ISP_CID_3DNR_RESET: + case VVCAM_ISP_CID_3DNR_MODE: + case VVCAM_ISP_CID_3DNR_AUTO_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_GAIN: + case VVCAM_ISP_CID_3DNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_INV: + case VVCAM_ISP_CID_3DNR_AUTO_DELTA: + case VVCAM_ISP_CID_3DNR_MANU_STRENGTH: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_INV: + case VVCAM_ISP_CID_3DNR_MANU_DELTA: + case VVCAM_ISP_CID_3DNR_MOTION_ROI: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_3dnr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_3DNR_ENABLE: + case VVCAM_ISP_CID_3DNR_RESET: + case VVCAM_ISP_CID_3DNR_MODE: + case VVCAM_ISP_CID_3DNR_AUTO_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_GAIN: + case VVCAM_ISP_CID_3DNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_INV: + case VVCAM_ISP_CID_3DNR_AUTO_DELTA: + case VVCAM_ISP_CID_3DNR_MANU_STRENGTH: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_INV: + case VVCAM_ISP_CID_3DNR_MANU_DELTA: + case VVCAM_ISP_CID_3DNR_MOTION_ROI: + case VVCAM_ISP_CID_3DNR_STAT_STRENGTH: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_INV: + case VVCAM_ISP_CID_3DNR_STAT_DELTA: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_3dnr_ctrl_ops = { + .s_ctrl = vvcam_isp_3dnr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_3dnr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_3dnr_ctrls[] = { + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* int32_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_MOTION_INV, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_motion_inv", + .step = 1, + .min = 0, + .max = 65535, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_DELTA, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_delta", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_MOTION_INV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_motion_inv", + .step = 1, + .min = 0, + .max = 65535, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_DELTA, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_delta", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + /* 64x array 64x4x32bit */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MOTION_ROI, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_motion_roi", + .step = 1, + .min = 0, + .max = 65535, + .dims = {64, 4, 0, 0}, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_INV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_motion_inv", + .step = 1, + .min = 0, + .max = 65535, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_DELTA, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_delta", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_3dnr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_3dnr_ctrls); +} + +int vvcam_isp_3dnr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_3dnr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_3dnr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp 3dnr ctrl %s failed %d.\n", + vvcam_isp_3dnr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_4/vvcam_isp_3dnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_4/vvcam_isp_3dnr.h new file mode 100644 index 0000000..444747e --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v2_4/vvcam_isp_3dnr.h @@ -0,0 +1,82 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_3DNR_H__ +#define __VVCAM_ISP_3DNR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_3DNR_ENABLE (VVCAM_ISP_CID_3DNR_BASE + 0x0000) +#define VVCAM_ISP_CID_3DNR_RESET (VVCAM_ISP_CID_3DNR_BASE + 0x0001) +#define VVCAM_ISP_CID_3DNR_MODE (VVCAM_ISP_CID_3DNR_BASE + 0x0002) +#define VVCAM_ISP_CID_3DNR_AUTO_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x0003) +#define VVCAM_ISP_CID_3DNR_AUTO_GAIN (VVCAM_ISP_CID_3DNR_BASE + 0x0004) +#define VVCAM_ISP_CID_3DNR_AUTO_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x0005) +#define VVCAM_ISP_CID_3DNR_AUTO_MOTION_INV (VVCAM_ISP_CID_3DNR_BASE + 0x0006) +#define VVCAM_ISP_CID_3DNR_AUTO_DELTA (VVCAM_ISP_CID_3DNR_BASE + 0x0007) +#define VVCAM_ISP_CID_3DNR_MANU_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x0008) +#define VVCAM_ISP_CID_3DNR_MANU_MOTION_INV (VVCAM_ISP_CID_3DNR_BASE + 0x0009) +#define VVCAM_ISP_CID_3DNR_MANU_DELTA (VVCAM_ISP_CID_3DNR_BASE + 0x000A) +#define VVCAM_ISP_CID_3DNR_MOTION_ROI (VVCAM_ISP_CID_3DNR_BASE + 0x000B) +#define VVCAM_ISP_CID_3DNR_STAT_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x000C) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_INV (VVCAM_ISP_CID_3DNR_BASE + 0x000D) +#define VVCAM_ISP_CID_3DNR_STAT_DELTA (VVCAM_ISP_CID_3DNR_BASE + 0x000E) + +#ifdef __KERNEL__ +int vvcam_isp_3dnr_ctrl_count(void); +int vvcam_isp_3dnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3/vvcam_isp_3dnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3/vvcam_isp_3dnr.c new file mode 100644 index 0000000..7a2391c --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3/vvcam_isp_3dnr.c @@ -0,0 +1,929 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_3dnr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_3dnr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_3DNR_ENABLE: + case VVCAM_ISP_CID_3DNR_PRE_GAMMA_ENABLE: + case VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE: + case VVCAM_ISP_CID_3DNR_MOTION_ERODE_ENABLE: + case VVCAM_ISP_CID_3DNR_WORK_MODE: + case VVCAM_ISP_CID_3DNR_RESET: + case VVCAM_ISP_CID_3DNR_MODE: + case VVCAM_ISP_CID_3DNR_AUTO_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_GAIN: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_AUTO_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_ERODE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_PRE_GAMMA_EN: + case VVCAM_ISP_CID_3DNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_3DNR_AUTO_RANGE_H: + case VVCAM_ISP_CID_3DNR_AUTO_RANGE_V: + case VVCAM_ISP_CID_3DNR_AUTO_DILATE_H: + case VVCAM_ISP_CID_3DNR_AUTO_PRE_WEIGHT: + case VVCAM_ISP_CID_3DNR_AUTO_SIGMA: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_STATIC: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_MOTION: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_SLOPE: + case VVCAM_ISP_CID_3DNR_MANU_DILATE_H: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_MANU_PRE_WEIGHT: + case VVCAM_ISP_CID_3DNR_MANU_RANGE_H: + case VVCAM_ISP_CID_3DNR_MANU_RANGE_V: + case VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_MANU_STRENGTH: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_MOTION: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_SLOPE: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_STATIC: + case VVCAM_ISP_CID_3DNR_MANU_SIGMA: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_3dnr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_3DNR_ENABLE: + case VVCAM_ISP_CID_3DNR_PRE_GAMMA_ENABLE: + case VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE: + case VVCAM_ISP_CID_3DNR_MOTION_ERODE_ENABLE: + case VVCAM_ISP_CID_3DNR_WORK_MODE: + case VVCAM_ISP_CID_3DNR_RESET: + case VVCAM_ISP_CID_3DNR_MODE: + case VVCAM_ISP_CID_3DNR_AUTO_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_GAIN: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_AUTO_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_ERODE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_PRE_GAMMA_EN: + case VVCAM_ISP_CID_3DNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_3DNR_AUTO_RANGE_H: + case VVCAM_ISP_CID_3DNR_AUTO_RANGE_V: + case VVCAM_ISP_CID_3DNR_AUTO_DILATE_H: + case VVCAM_ISP_CID_3DNR_AUTO_PRE_WEIGHT: + case VVCAM_ISP_CID_3DNR_AUTO_SIGMA: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_STATIC: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_MOTION: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_SLOPE: + case VVCAM_ISP_CID_3DNR_MANU_DILATE_H: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_MANU_PRE_WEIGHT: + case VVCAM_ISP_CID_3DNR_MANU_RANGE_H: + case VVCAM_ISP_CID_3DNR_MANU_RANGE_V: + case VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_MANU_STRENGTH: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_MOTION: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_SLOPE: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_STATIC: + case VVCAM_ISP_CID_3DNR_MANU_SIGMA: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B: + case VVCAM_ISP_CID_3DNR_STAT_WORK_MODE: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_DILATE_ENABLE: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_ERODE_ENABLE: + case VVCAM_ISP_CID_3DNR_STAT_DILATE_H: + case VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_STAT_PRE_WEIGHT: + case VVCAM_ISP_CID_3DNR_STAT_RANGE_H: + case VVCAM_ISP_CID_3DNR_STAT_RANGE_V: + case VVCAM_ISP_CID_3DNR_STAT_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_STAT_STRENGTH: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_STAT_BLEND_MOTION: + case VVCAM_ISP_CID_3DNR_STAT_BLEND_SLOPE: + case VVCAM_ISP_CID_3DNR_STAT_BLEND_STATIC: + case VVCAM_ISP_CID_3DNR_STAT_SIGMA: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_B: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_3dnr_ctrl_ops = { + .s_ctrl = vvcam_isp_3dnr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_3dnr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_3dnr_ctrls[] = { + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_PRE_GAMMA_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_pre_gamma_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_mot_dilate_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MOTION_ERODE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_mot_erode_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_WORK_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_work_mode", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x 0.0 ~ 1024.0*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_filter_len", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x 0.0 ~ 1024.0*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_filter_len2", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_NOISE_LEVEL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_noise_level", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_MOTION_SLOPE_THR, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_mot_slope_thr", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_sad_weight", + .step = 1, + .min = 0, + .max = 16, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_mot_dilate_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_MOTION_ERODE_EN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_mot_erode_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_PRE_GAMMA_EN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_pre_gamma_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_RANGE_H, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_range_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_RANGE_V, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_range_v", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_DILATE_H, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_dilate_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_PRE_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_pre_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_SIGMA, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_sigma", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_BLEND_STATIC, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_blend_stc", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_BLEND_MOTION, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_blend_mot", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_BLEND_SLOPE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_blend_slope", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 3~7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_DILATE_H, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_dilate_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + }, + { + /* float 0.0 ~ 1024.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_filter_len", + .step = 1, + .min = 0, + .max = 10240, + }, + { + /* float 0.0 ~ 1024.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_filter_len2", + .step = 1, + .min = 0, + .max = 10240, + }, + { + /* float 1 ~ 1024 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_level", + .step = 1, + .def = 10, + .min = 10, + .max = 10240, + }, + { + /* float 0 ~ 32 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_PRE_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_pre_weight", + .step = 1, + .min = 0, + .max = 32, + }, + { + /* float 3 ~ 7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_RANGE_H, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_range_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + }, + { + /* float 3 ~ 7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_RANGE_V, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_range_v", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + }, + { + /* float 0 ~ 16 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_sad_weight", + .step = 1, + .min = 0, + .max = 16, + }, + { + /* uint8_t 0 ~ 128 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* float 1 ~ 1023 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_mot_slope_thr", + .step = 1, + .def = 1, + .min = 1, + .max = 1023, + }, + { + /* float 0.0 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_BLEND_MOTION, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_blend_mot", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.0 ~ 32.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_BLEND_SLOPE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_blend_slope", + .step = 1, + .min = 0, + .max = 320, + }, + { + /* float 0.0 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_BLEND_STATIC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_blend_stc", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.1 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_SIGMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_sigma", + .step = 1, + .def = 1, + .min = 1, + .max = 1000, + }, + { + /* float 0 ~ 1000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_mdl_a", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0 ~ 1000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_mdl_b", + .step = 1, + .min = 0, + .max = 10000, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_DILATE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_mot_dilate_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_ERODE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_mot_erode_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_WORK_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_work_mode", + .step = 1, + .min = 0, + .max = 3, + }, + { + /* float 3~7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_DILATE_H, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_dilate_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + }, + { + /* float 0.0 ~ 1024.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_filter_len", + .step = 1, + .min = 0, + .max = 10240, + }, + { + /* float 0.0 ~ 1024.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN2, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_filter_len2", + .step = 1, + .min = 0, + .max = 10240, + }, + { + /* float 1 ~ 1024 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_LEVEL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_level", + .step = 1, + .def = 10, + .min = 10, + .max = 10240, + }, + { + /* float 0 ~ 32 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_PRE_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_pre_weight", + .step = 1, + .min = 0, + .max = 32, + }, + { + /* float 3 ~ 7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_RANGE_H, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_range_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + }, + { + /* float 3 ~ 7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_RANGE_V, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_range_v", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + }, + { + /* float 0 ~ 16 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_SAD_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_sad_weight", + .step = 1, + .min = 0, + .max = 16, + }, + { + /* uint8_t 0 ~ 128 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* float 1 ~ 1023 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_SLOPE_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_mot_slope_thr", + .step = 1, + .def = 1, + .min = 1, + .max = 1023, + }, + { + /* float 0.0 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_BLEND_MOTION, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_blend_mot", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.0 ~ 32.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_BLEND_SLOPE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_blend_slope", + .step = 1, + .min = 0, + .max = 320, + }, + { + /* float 0.0 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_BLEND_STATIC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_blend_stc", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.1 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_SIGMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_sigma", + .step = 1, + .def = 1, + .min = 1, + .max = 1000, + }, + { + /* float 0 ~ 1000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_A, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_mdl_a", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0 ~ 1000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_B, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_mdl_b", + .step = 1, + .min = 0, + .max = 10000, + }, +}; + +int vvcam_isp_3dnr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_3dnr_ctrls); +} + +int vvcam_isp_3dnr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_3dnr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_3dnr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp 3dnr ctrl %s failed %d.\n", + vvcam_isp_3dnr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3/vvcam_isp_3dnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3/vvcam_isp_3dnr.h new file mode 100644 index 0000000..b0cf35c --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3/vvcam_isp_3dnr.h @@ -0,0 +1,148 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_3DNR_H__ +#define __VVCAM_ISP_3DNR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_3DNR_ENABLE (VVCAM_ISP_CID_3DNR_BASE + 0x0000) +#define VVCAM_ISP_CID_3DNR_PRE_GAMMA_ENABLE (VVCAM_ISP_CID_3DNR_BASE + 0x0001) +#define VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0002) +#define VVCAM_ISP_CID_3DNR_MOTION_ERODE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0003) +#define VVCAM_ISP_CID_3DNR_WORK_MODE (VVCAM_ISP_CID_3DNR_BASE + 0x0004) +#define VVCAM_ISP_CID_3DNR_RESET (VVCAM_ISP_CID_3DNR_BASE + 0x0005) +#define VVCAM_ISP_CID_3DNR_MODE (VVCAM_ISP_CID_3DNR_BASE + 0x0006) +#define VVCAM_ISP_CID_3DNR_AUTO_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x0007) +#define VVCAM_ISP_CID_3DNR_AUTO_GAIN (VVCAM_ISP_CID_3DNR_BASE + 0x0008) +#define VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN (VVCAM_ISP_CID_3DNR_BASE + 0x0009) +#define VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2 (VVCAM_ISP_CID_3DNR_BASE + 0x000A) +#define VVCAM_ISP_CID_3DNR_AUTO_NOISE_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x000B) +#define VVCAM_ISP_CID_3DNR_AUTO_MOTION_SLOPE_THR \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000C) +#define VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x000D) +#define VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000E) +#define VVCAM_ISP_CID_3DNR_AUTO_MOTION_ERODE_EN \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000F) +#define VVCAM_ISP_CID_3DNR_AUTO_PRE_GAMMA_EN \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0010) +#define VVCAM_ISP_CID_3DNR_AUTO_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x0011) +#define VVCAM_ISP_CID_3DNR_AUTO_RANGE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0012) +#define VVCAM_ISP_CID_3DNR_AUTO_RANGE_V (VVCAM_ISP_CID_3DNR_BASE + 0x0013) +#define VVCAM_ISP_CID_3DNR_AUTO_DILATE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0014) +#define VVCAM_ISP_CID_3DNR_AUTO_PRE_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0015) +#define VVCAM_ISP_CID_3DNR_AUTO_SIGMA (VVCAM_ISP_CID_3DNR_BASE + 0x0016) +#define VVCAM_ISP_CID_3DNR_AUTO_BLEND_STATIC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0017) +#define VVCAM_ISP_CID_3DNR_AUTO_BLEND_MOTION \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0018) +#define VVCAM_ISP_CID_3DNR_AUTO_BLEND_SLOPE (VVCAM_ISP_CID_3DNR_BASE + 0x0019) +#define VVCAM_ISP_CID_3DNR_MANU_DILATE_H (VVCAM_ISP_CID_3DNR_BASE + 0x001A) +#define VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN (VVCAM_ISP_CID_3DNR_BASE + 0x001B) +#define VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2 (VVCAM_ISP_CID_3DNR_BASE + 0x001C) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x001D) +#define VVCAM_ISP_CID_3DNR_MANU_PRE_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x001E) +#define VVCAM_ISP_CID_3DNR_MANU_RANGE_H (VVCAM_ISP_CID_3DNR_BASE + 0x001F) +#define VVCAM_ISP_CID_3DNR_MANU_RANGE_V (VVCAM_ISP_CID_3DNR_BASE + 0x0020) +#define VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0021) +#define VVCAM_ISP_CID_3DNR_MANU_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x0022) +#define VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0023) +#define VVCAM_ISP_CID_3DNR_MANU_BLEND_MOTION \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0024) +#define VVCAM_ISP_CID_3DNR_MANU_BLEND_SLOPE (VVCAM_ISP_CID_3DNR_BASE + 0x0025) +#define VVCAM_ISP_CID_3DNR_MANU_BLEND_STATIC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0026) +#define VVCAM_ISP_CID_3DNR_MANU_SIGMA (VVCAM_ISP_CID_3DNR_BASE + 0x0027) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0028) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0029) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_DILATE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002A) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_ERODE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002B) +#define VVCAM_ISP_CID_3DNR_STAT_WORK_MODE (VVCAM_ISP_CID_3DNR_BASE + 0x002C) +#define VVCAM_ISP_CID_3DNR_STAT_DILATE_H (VVCAM_ISP_CID_3DNR_BASE + 0x002D) +#define VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN (VVCAM_ISP_CID_3DNR_BASE + 0x002E) +#define VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN2 (VVCAM_ISP_CID_3DNR_BASE + 0x002F) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x0030) +#define VVCAM_ISP_CID_3DNR_STAT_PRE_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0031) +#define VVCAM_ISP_CID_3DNR_STAT_RANGE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0032) +#define VVCAM_ISP_CID_3DNR_STAT_RANGE_V (VVCAM_ISP_CID_3DNR_BASE + 0x0033) +#define VVCAM_ISP_CID_3DNR_STAT_SAD_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0034) +#define VVCAM_ISP_CID_3DNR_STAT_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x0035) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_SLOPE_THR \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0036) +#define VVCAM_ISP_CID_3DNR_STAT_BLEND_MOTION \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0037) +#define VVCAM_ISP_CID_3DNR_STAT_BLEND_SLOPE (VVCAM_ISP_CID_3DNR_BASE + 0x0038) +#define VVCAM_ISP_CID_3DNR_STAT_BLEND_STATIC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0039) +#define VVCAM_ISP_CID_3DNR_STAT_SIGMA (VVCAM_ISP_CID_3DNR_BASE + 0x003A) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_A \ + (VVCAM_ISP_CID_3DNR_BASE + 0x003B) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_B \ + (VVCAM_ISP_CID_3DNR_BASE + 0x003C) + +#ifdef __KERNEL__ +int vvcam_isp_3dnr_ctrl_count(void); +int vvcam_isp_3dnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3_1/vvcam_isp_3dnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3_1/vvcam_isp_3dnr.c new file mode 100644 index 0000000..21ec375 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3_1/vvcam_isp_3dnr.c @@ -0,0 +1,969 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_3dnr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_3dnr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_3DNR_ENABLE: + case VVCAM_ISP_CID_3DNR_GAMMA_FE_BE_ENABLE: + case VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE: + case VVCAM_ISP_CID_3DNR_MOTION_ERODE_ENABLE: + case VVCAM_ISP_CID_3DNR_WORK_MODE: + case VVCAM_ISP_CID_3DNR_RESET: + case VVCAM_ISP_CID_3DNR_MODE: + case VVCAM_ISP_CID_3DNR_AUTO_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_GAIN: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_AUTO_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_ERODE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_GAMMA_FE_BE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_3DNR_AUTO_RANGE_H: + case VVCAM_ISP_CID_3DNR_AUTO_RANGE_V: + case VVCAM_ISP_CID_3DNR_AUTO_DILATE_H: + case VVCAM_ISP_CID_3DNR_AUTO_PRE_WEIGHT: + case VVCAM_ISP_CID_3DNR_AUTO_SIGMA: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_STATIC: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_MOTION: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_SLOPE: + case VVCAM_ISP_CID_3DNR_MANU_DILATE_H: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_MANU_PRE_WEIGHT: + case VVCAM_ISP_CID_3DNR_MANU_RANGE_H: + case VVCAM_ISP_CID_3DNR_MANU_RANGE_V: + case VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_MANU_STRENGTH: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_MOTION: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_SLOPE: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_STATIC: + case VVCAM_ISP_CID_3DNR_MANU_SIGMA: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_FIX_CURVE_START: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_3dnr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_3DNR_ENABLE: + case VVCAM_ISP_CID_3DNR_GAMMA_FE_BE_ENABLE: + case VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE: + case VVCAM_ISP_CID_3DNR_MOTION_ERODE_ENABLE: + case VVCAM_ISP_CID_3DNR_WORK_MODE: + case VVCAM_ISP_CID_3DNR_RESET: + case VVCAM_ISP_CID_3DNR_MODE: + case VVCAM_ISP_CID_3DNR_AUTO_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_GAIN: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_AUTO_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_ERODE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_GAMMA_FE_BE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_3DNR_AUTO_RANGE_H: + case VVCAM_ISP_CID_3DNR_AUTO_RANGE_V: + case VVCAM_ISP_CID_3DNR_AUTO_DILATE_H: + case VVCAM_ISP_CID_3DNR_AUTO_PRE_WEIGHT: + case VVCAM_ISP_CID_3DNR_AUTO_SIGMA: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_STATIC: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_MOTION: + case VVCAM_ISP_CID_3DNR_AUTO_BLEND_SLOPE: + case VVCAM_ISP_CID_3DNR_MANU_DILATE_H: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_MANU_PRE_WEIGHT: + case VVCAM_ISP_CID_3DNR_MANU_RANGE_H: + case VVCAM_ISP_CID_3DNR_MANU_RANGE_V: + case VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_MANU_STRENGTH: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_MOTION: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_SLOPE: + case VVCAM_ISP_CID_3DNR_MANU_BLEND_STATIC: + case VVCAM_ISP_CID_3DNR_MANU_SIGMA: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_FIX_CURVE_START: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_DILATE_ENABLE: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_ERODE_ENABLE: + case VVCAM_ISP_CID_3DNR_STAT_WORK_MODE: + case VVCAM_ISP_CID_3DNR_STAT_DILATE_H: + case VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_STAT_PRE_WEIGHT: + case VVCAM_ISP_CID_3DNR_STAT_RANGE_H: + case VVCAM_ISP_CID_3DNR_STAT_RANGE_V: + case VVCAM_ISP_CID_3DNR_STAT_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_STAT_STRENGTH: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_STAT_BLEND_MOTION: + case VVCAM_ISP_CID_3DNR_STAT_BLEND_SLOPE: + case VVCAM_ISP_CID_3DNR_STAT_BLEND_STATIC: + case VVCAM_ISP_CID_3DNR_STAT_SIGMA: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_B: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_FIX_CURVE_START: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_3dnr_ctrl_ops = { + .s_ctrl = vvcam_isp_3dnr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_3dnr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_3dnr_ctrls[] = { + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_GAMMA_FE_BE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_gamma_febe_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_mot_dilate_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MOTION_ERODE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_mot_erode_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_WORK_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_work_mode", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x 0.0 ~ 1024.0*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_filter_len", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x 0.0 ~ 1024.0*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_filter_len2", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x 1 ~ 1024*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_NOISE_LEVEL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_noise_level", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20x 1 ~ 1023*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_MOTION_SLOPE_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_mot_slope_thr", + .step = 1, + .def = 1, + .min = 1, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_sad_weight", + .step = 1, + .min = 0, + .max = 16, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_mot_dilate_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_MOTION_ERODE_EN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_mot_erode_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_GAMMA_FE_BE_EN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_gamma_febe_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_RANGE_H, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_range_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_RANGE_V, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_range_v", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_DILATE_H, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_dilate_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_PRE_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_pre_weight", + .step = 1, + .min = 0, + .max = 32, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x 0.1 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_SIGMA, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_sigma", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_BLEND_STATIC, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_blend_stc", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x 0.0 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_BLEND_MOTION, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_blend_mot", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float array 20x 0.0 ~ 32.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_BLEND_SLOPE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_blend_slope", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 3~7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_DILATE_H, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_dilate_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0.0 ~ 1024.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_filter_len", + .step = 1, + .min = 0, + .max = 10240, + }, + { + /* float 0.0 ~ 1024.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_filter_len2", + .step = 1, + .min = 0, + .max = 10240, + }, + { + /* float 1 ~ 1024 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_level", + .step = 1, + .def = 10, + .min = 10, + .max = 10240, + }, + { + /* uint8_t 0 ~ 32 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_PRE_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_pre_weight", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 3 ~ 7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_RANGE_H, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_range_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 3 ~ 7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_RANGE_V, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_range_v", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 16 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_sad_weight", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 128 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint16_t 1 ~ 1023 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_mot_slope_thr", + .step = 1, + .def = 1, + .min = 1, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0.0 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_BLEND_MOTION, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_blend_mot", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.0 ~ 32.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_BLEND_SLOPE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_blend_slope", + .step = 1, + .min = 0, + .max = 320, + }, + { + /* float 0.0 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_BLEND_STATIC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_blend_stc", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.1 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_SIGMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_sigma", + .step = 1, + .def = 1, + .min = 1, + .max = 1000, + }, + { + /* float 0.1 ~ 1000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_mdl_a", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0.1 ~ 1000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_mdl_b", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* uint16_t 0 ~ 4096 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_FIX_CURVE_START, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_mdl_fcs", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_DILATE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_mot_dilate_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_ERODE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_mot_erode_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_WORK_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_work_mode", + .step = 1, + .min = 0, + .max = 3, + }, + { + /* uint8_t 3~7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_DILATE_H, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_dilate_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0.0 ~ 1024.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_filter_len", + .step = 1, + .min = 0, + .max = 10240, + }, + { + /* float 0.0 ~ 1024.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN2, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_filter_len2", + .step = 1, + .min = 0, + .max = 10240, + }, + { + /* float 1 ~ 1024 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_LEVEL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_level", + .step = 1, + .def = 10, + .min = 10, + .max = 10240, + }, + { + /* uint8_t 0 ~ 32 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_PRE_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_pre_weight", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 3 ~ 7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_RANGE_H, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_range_h", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 3 ~ 7 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_RANGE_V, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_range_v", + .step = 1, + .def = 3, + .min = 3, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 16 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_SAD_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_sad_weight", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 128 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint16_t 1 ~ 1023 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_SLOPE_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_mot_slope_thr", + .step = 1, + .def = 1, + .min = 1, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0.0 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_BLEND_MOTION, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_blend_mot", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.0 ~ 32.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_BLEND_SLOPE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_blend_slope", + .step = 1, + .min = 0, + .max = 320, + }, + { + /* float 0.0 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_BLEND_STATIC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_blend_stc", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0.1 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_SIGMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_sigma", + .step = 1, + .def = 1, + .min = 1, + .max = 1000, + }, + { + /* float 0.1 ~ 1000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_A, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_mdl_a", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0.1 ~ 1000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_B, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_mdl_b", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* uint16_t 0 ~ 4096 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_FIX_CURVE_START, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_mdl_fcs", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_3dnr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_3dnr_ctrls); +} + +int vvcam_isp_3dnr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_3dnr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_3dnr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp 3dnr ctrl %s failed %d.\n", + vvcam_isp_3dnr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3_1/vvcam_isp_3dnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3_1/vvcam_isp_3dnr.h new file mode 100644 index 0000000..fe1fab2 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v3_1/vvcam_isp_3dnr.h @@ -0,0 +1,153 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_3DNR_H__ +#define __VVCAM_ISP_3DNR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_3DNR_ENABLE (VVCAM_ISP_CID_3DNR_BASE + 0x0000) +#define VVCAM_ISP_CID_3DNR_GAMMA_FE_BE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0001) +#define VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0002) +#define VVCAM_ISP_CID_3DNR_MOTION_ERODE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0003) +#define VVCAM_ISP_CID_3DNR_WORK_MODE (VVCAM_ISP_CID_3DNR_BASE + 0x0004) +#define VVCAM_ISP_CID_3DNR_RESET (VVCAM_ISP_CID_3DNR_BASE + 0x0005) +#define VVCAM_ISP_CID_3DNR_MODE (VVCAM_ISP_CID_3DNR_BASE + 0x0006) +#define VVCAM_ISP_CID_3DNR_AUTO_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x0007) +#define VVCAM_ISP_CID_3DNR_AUTO_GAIN (VVCAM_ISP_CID_3DNR_BASE + 0x0008) +#define VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN (VVCAM_ISP_CID_3DNR_BASE + 0x0009) +#define VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2 (VVCAM_ISP_CID_3DNR_BASE + 0x000A) +#define VVCAM_ISP_CID_3DNR_AUTO_NOISE_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x000B) +#define VVCAM_ISP_CID_3DNR_AUTO_MOTION_SLOPE_THR \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000C) +#define VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x000D) +#define VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000E) +#define VVCAM_ISP_CID_3DNR_AUTO_MOTION_ERODE_EN \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000F) +#define VVCAM_ISP_CID_3DNR_AUTO_GAMMA_FE_BE_EN \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0010) +#define VVCAM_ISP_CID_3DNR_AUTO_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x0011) +#define VVCAM_ISP_CID_3DNR_AUTO_RANGE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0012) +#define VVCAM_ISP_CID_3DNR_AUTO_RANGE_V (VVCAM_ISP_CID_3DNR_BASE + 0x0013) +#define VVCAM_ISP_CID_3DNR_AUTO_DILATE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0014) +#define VVCAM_ISP_CID_3DNR_AUTO_PRE_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0015) +#define VVCAM_ISP_CID_3DNR_AUTO_SIGMA (VVCAM_ISP_CID_3DNR_BASE + 0x0016) +#define VVCAM_ISP_CID_3DNR_AUTO_BLEND_STATIC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0017) +#define VVCAM_ISP_CID_3DNR_AUTO_BLEND_MOTION \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0018) +#define VVCAM_ISP_CID_3DNR_AUTO_BLEND_SLOPE (VVCAM_ISP_CID_3DNR_BASE + 0x0019) +#define VVCAM_ISP_CID_3DNR_MANU_DILATE_H (VVCAM_ISP_CID_3DNR_BASE + 0x001A) +#define VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN (VVCAM_ISP_CID_3DNR_BASE + 0x001B) +#define VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2 (VVCAM_ISP_CID_3DNR_BASE + 0x001C) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x001D) +#define VVCAM_ISP_CID_3DNR_MANU_PRE_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x001E) +#define VVCAM_ISP_CID_3DNR_MANU_RANGE_H (VVCAM_ISP_CID_3DNR_BASE + 0x001F) +#define VVCAM_ISP_CID_3DNR_MANU_RANGE_V (VVCAM_ISP_CID_3DNR_BASE + 0x0020) +#define VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0021) +#define VVCAM_ISP_CID_3DNR_MANU_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x0022) +#define VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0023) +#define VVCAM_ISP_CID_3DNR_MANU_BLEND_MOTION \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0024) +#define VVCAM_ISP_CID_3DNR_MANU_BLEND_SLOPE (VVCAM_ISP_CID_3DNR_BASE + 0x0025) +#define VVCAM_ISP_CID_3DNR_MANU_BLEND_STATIC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0026) +#define VVCAM_ISP_CID_3DNR_MANU_SIGMA (VVCAM_ISP_CID_3DNR_BASE + 0x0027) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0028) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0029) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_FIX_CURVE_START \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002A) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_DILATE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002B) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_ERODE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002C) +#define VVCAM_ISP_CID_3DNR_STAT_WORK_MODE (VVCAM_ISP_CID_3DNR_BASE + 0x002D) +#define VVCAM_ISP_CID_3DNR_STAT_DILATE_H (VVCAM_ISP_CID_3DNR_BASE + 0x002E) +#define VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN (VVCAM_ISP_CID_3DNR_BASE + 0x002F) +#define VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN2 (VVCAM_ISP_CID_3DNR_BASE + 0x0030) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x0031) +#define VVCAM_ISP_CID_3DNR_STAT_PRE_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0032) +#define VVCAM_ISP_CID_3DNR_STAT_RANGE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0033) +#define VVCAM_ISP_CID_3DNR_STAT_RANGE_V (VVCAM_ISP_CID_3DNR_BASE + 0x0034) +#define VVCAM_ISP_CID_3DNR_STAT_SAD_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0035) +#define VVCAM_ISP_CID_3DNR_STAT_STRENGTH (VVCAM_ISP_CID_3DNR_BASE + 0x0036) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_SLOPE_THR \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0037) +#define VVCAM_ISP_CID_3DNR_STAT_BLEND_MOTION \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0038) +#define VVCAM_ISP_CID_3DNR_STAT_BLEND_SLOPE (VVCAM_ISP_CID_3DNR_BASE + 0x0039) +#define VVCAM_ISP_CID_3DNR_STAT_BLEND_STATIC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x003A) +#define VVCAM_ISP_CID_3DNR_STAT_SIGMA (VVCAM_ISP_CID_3DNR_BASE + 0x003B) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_A \ + (VVCAM_ISP_CID_3DNR_BASE + 0x003C) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_B \ + (VVCAM_ISP_CID_3DNR_BASE + 0x003D) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_FIX_CURVE_START \ + (VVCAM_ISP_CID_3DNR_BASE + 0x003E) + +#ifdef __KERNEL__ +int vvcam_isp_3dnr_ctrl_count(void); +int vvcam_isp_3dnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v4/vvcam_isp_3dnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v4/vvcam_isp_3dnr.c new file mode 100644 index 0000000..f43cddc --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v4/vvcam_isp_3dnr.c @@ -0,0 +1,1091 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_3dnr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_3dnr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_3DNR_ENABLE: + case VVCAM_ISP_CID_3DNR_GAMMA_FE_BE_ENABLE: + case VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE: + case VVCAM_ISP_CID_3DNR_GAUSS_BLUR_ENABLE: + case VVCAM_ISP_CID_3DNR_RESET: + case VVCAM_ISP_CID_3DNR_MODE: + case VVCAM_ISP_CID_3DNR_AUTO_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_GAIN: + case VVCAM_ISP_CID_3DNR_AUTO_NMK: + case VVCAM_ISP_CID_3DNR_AUTO_NMP: + case VVCAM_ISP_CID_3DNR_AUTO_FIX_CURVE_START: + case VVCAM_ISP_CID_3DNR_AUTO_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_AUTO_NOISE_MODEL_B: + case VVCAM_ISP_CID_3DNR_AUTO_BLS_EXP: + case VVCAM_ISP_CID_3DNR_AUTO_TNR_STRENGTH: + case VVCAM_ISP_CID_3DNR_AUTO_TNR_STRENGTH2: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_SMOOTH_FAC: + case VVCAM_ISP_CID_3DNR_AUTO_RANGE_H: + case VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_AUTO_SQR_DIFF_FAC: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_SMOOTH_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_DILATE_H: + case VVCAM_ISP_CID_3DNR_AUTO_TNR_LUMA_CURVE_Y: + case VVCAM_ISP_CID_3DNR_AUTO_TNR_MOTION_SLOPE_Y: + case VVCAM_ISP_CID_3DNR_MANU_VST_FAC: + case VVCAM_ISP_CID_3DNR_MANU_TNR_STRENGTH: + case VVCAM_ISP_CID_3DNR_MANU_TNR_STRENGTH2: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_SMOOTH_FAC: + case VVCAM_ISP_CID_3DNR_MANU_RANGE_H: + case VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_MANU_DIFF_TYPE: + case VVCAM_ISP_CID_3DNR_MANU_SQR_DIFF_FAC: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_SMOOTH_LEVEL: + case VVCAM_ISP_CID_3DNR_MANU_DILATE_H: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_MANU_TNR_LUMA_CURVE_X: + case VVCAM_ISP_CID_3DNR_MANU_TNR_LUMA_CURVE_Y: + case VVCAM_ISP_CID_3DNR_MANU_TNR_MOTION_SLOPE_Y: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_INPUT_BIT: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_FIX_CURVE_START: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_BLS_EXP: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_3dnr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_3DNR_ENABLE: + case VVCAM_ISP_CID_3DNR_GAMMA_FE_BE_ENABLE: + case VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE: + case VVCAM_ISP_CID_3DNR_GAUSS_BLUR_ENABLE: + case VVCAM_ISP_CID_3DNR_RESET: + case VVCAM_ISP_CID_3DNR_MODE: + case VVCAM_ISP_CID_3DNR_AUTO_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_GAIN: + case VVCAM_ISP_CID_3DNR_AUTO_NMK: + case VVCAM_ISP_CID_3DNR_AUTO_NMP: + case VVCAM_ISP_CID_3DNR_AUTO_FIX_CURVE_START: + case VVCAM_ISP_CID_3DNR_AUTO_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_AUTO_NOISE_MODEL_B: + case VVCAM_ISP_CID_3DNR_AUTO_BLS_EXP: + case VVCAM_ISP_CID_3DNR_AUTO_TNR_STRENGTH: + case VVCAM_ISP_CID_3DNR_AUTO_TNR_STRENGTH2: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_SMOOTH_FAC: + case VVCAM_ISP_CID_3DNR_AUTO_RANGE_H: + case VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_AUTO_SQR_DIFF_FAC: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_SMOOTH_LEVEL: + case VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN: + case VVCAM_ISP_CID_3DNR_AUTO_DILATE_H: + case VVCAM_ISP_CID_3DNR_AUTO_TNR_LUMA_CURVE_Y: + case VVCAM_ISP_CID_3DNR_AUTO_TNR_MOTION_SLOPE_Y: + case VVCAM_ISP_CID_3DNR_MANU_VST_FAC: + case VVCAM_ISP_CID_3DNR_MANU_TNR_STRENGTH: + case VVCAM_ISP_CID_3DNR_MANU_TNR_STRENGTH2: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_SMOOTH_FAC: + case VVCAM_ISP_CID_3DNR_MANU_RANGE_H: + case VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_MANU_DIFF_TYPE: + case VVCAM_ISP_CID_3DNR_MANU_SQR_DIFF_FAC: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_SMOOTH_LEVEL: + case VVCAM_ISP_CID_3DNR_MANU_DILATE_H: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_MANU_TNR_LUMA_CURVE_X: + case VVCAM_ISP_CID_3DNR_MANU_TNR_LUMA_CURVE_Y: + case VVCAM_ISP_CID_3DNR_MANU_TNR_MOTION_SLOPE_Y: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_INPUT_BIT: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_FIX_CURVE_START: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B: + case VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_BLS_EXP: + case VVCAM_ISP_CID_3DNR_STAT_VST_FAC: + case VVCAM_ISP_CID_3DNR_STAT_TNR_STRENGTH: + case VVCAM_ISP_CID_3DNR_STAT_TNR_STRENGTH2: + case VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN: + case VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN2: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_SMOOTH_FAC: + case VVCAM_ISP_CID_3DNR_STAT_RANGE_H: + case VVCAM_ISP_CID_3DNR_STAT_SAD_WEIGHT: + case VVCAM_ISP_CID_3DNR_STAT_DIFF_TYPE: + case VVCAM_ISP_CID_3DNR_STAT_SQR_DIFF_FAC: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_SMOOTH_LEVEL: + case VVCAM_ISP_CID_3DNR_STAT_DILATE_H: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_LEVEL: + case VVCAM_ISP_CID_3DNR_STAT_MOTION_SLOPE_THR: + case VVCAM_ISP_CID_3DNR_STAT_TNR_LUMA_CURVE_X: + case VVCAM_ISP_CID_3DNR_STAT_TNR_LUMA_CURVE_Y: + case VVCAM_ISP_CID_3DNR_STAT_TNR_MOTION_SLOPE_Y: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_INPUT_BIT: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_FIX_CURVE_START: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_A: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_B: + case VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_BLS_EXP: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_3dnr_ctrl_ops = { + .s_ctrl = vvcam_isp_3dnr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_3dnr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_3dnr_ctrls[] = { + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_GAMMA_FE_BE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_gamma_febe_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_mot_dilate_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_GAUSS_BLUR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_gauss_blur_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 0 ~ 100*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_NMK, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_nmk", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* float 0 ~ 100*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_NMP, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_nmp", + .step = 1, + .min = 0, + .max = 1000, + }, + { + /* uint16_t 0 ~ 4096 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_FIX_CURVE_START, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_fix_curve_start", + .step = 1, + .min = 0, + .max = 4096, + .dims = {20, 0, 0, 0}, + }, + { + /* double array 20x 0.1~100*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_NOISE_MODEL_A, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_noise_mdl_a", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* double array 20x 0.1~10000*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_NOISE_MODEL_B, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_noise_mdl_b", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t array 20x4 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_BLS_EXP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_bls_exp", + .step = 1, + .min = 0, + .max = 1048575, + .dims = {20, 4, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_TNR_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_tnr_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_TNR_STRENGTH2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_tnr_strength2", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x 1~99 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_filter_len", + .step = 1, + .def = 1, + .min = 1, + .max = 99, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x 1~99 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_filter_len2", + .step = 1, + .def = 1, + .min = 1, + .max = 99, + .dims = {20, 0, 0, 0}, + }, + { + /* double array 20x 0.1 ~ 5.0*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_MOTION_SMOOTH_FAC, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_mot_smooth_fac", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t array 20x 3 or 6 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_RANGE_H, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_range_h", + .step = 1, + .def = 3, + .min = 3, + .max = 6, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_sad_weight", + .step = 1, + .min = 0, + .max = 16, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_SQR_DIFF_FAC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_sqr_diff_fac", + .step = 1, + .min = 0, + .max = 10, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_MOTION_SMOOTH_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_mot_smooth_level", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_mot_dilate_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t array 20x 3 or 6*/ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_DILATE_H, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_dilate_h", + .step = 1, + .def = 3, + .min = 3, + .max = 6, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_TNR_LUMA_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_tnr_luma_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {20, 12, 0, 0}, + }, + { + /* uint16_t array 20x */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_AUTO_TNR_MOTION_SLOPE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_auto_tnr_mot_slope_y", + .step = 1, + .min = 0, + .max = 4095, + .dims = {20, 12, 0, 0}, + }, + { + /* double 1.0 ~ 1000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_VST_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_vst_fac", + .step = 1, + .def = 10, + .min = 10, + .max = 10000, + }, + { + /* uint8_t 0 ~ 128 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_TNR_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_tnr_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 128 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_TNR_STRENGTH2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_tnr_strength2", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 1 ~ 99 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_filter_len", + .step = 1, + .def = 1, + .min = 1, + .max = 99, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 1 ~ 99 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_filter_len2", + .step = 1, + .def = 1, + .min = 1, + .max = 99, + .dims = {1, 0, 0, 0}, + }, + { + /* double 0.1 ~ 5.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_MOTION_SMOOTH_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_mot_smooth_fac", + .step = 1, + .def = 1, + .min = 1, + .max = 50, + }, + { + /* int 3 or 6 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_RANGE_H, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_range_h", + .step = 1, + .def = 3, + .min = 3, + .max = 6, + }, + { + /* uint8_t 0 ~ 16 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_sad_weight", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_DIFF_TYPE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_diff_type", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_SQR_DIFF_FAC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_sqr_diff_fac", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 0~1 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_MOTION_SMOOTH_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_mot_smooth_level", + .step = 1, + .min = 0, + .max = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* 3 or 6 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_DILATE_H, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_dilate_h", + .step = 1, + .def = 3, + .min = 3, + .max = 6, + }, + { + /* uint16_t 0 ~ 65535 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_level", + .step = 1, + .min = 0, + .max = 65535, + .dims = {1, 0, 0, 0}, + }, + { + /* uint16_t 0 ~ 4095 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_mot_slope_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + /* uint16_t 0 ~ 4095 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_TNR_LUMA_CURVE_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_tnr_luma_curve_x", + .step = 1, + .min = 0, + .max = 4095, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t 0 ~ 65535 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_TNR_LUMA_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_tnr_luma_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t 0 ~ 4095 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_TNR_MOTION_SLOPE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_tnr_mot_slope_y", + .step = 1, + .min = 0, + .max = 4095, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t 20 or 24 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_INPUT_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_mdl_in_bit", + .step = 1, + .def = 20, + .min = 20, + .max = 24, + .dims = {1, 0, 0, 0}, + }, + { + /* uint16_t 0 ~ 4096 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_FIX_CURVE_START, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_mdl_fcs", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + /* double 0.1 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_mdl_a", + .step = 1, + .def = 1, + .min = 1, + .max = 1000, + }, + { + /* double 0.1 ~ 10000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_mdl_b", + .step = 1, + .def = 1, + .min = 1, + .max = 100000, + }, + { + /* uint32_t 0 ~ 1048575 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_BLS_EXP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_manu_noise_mdl_bls_exp", + .step = 1, + .min = 0, + .max = 1048575, + .dims = {4, 0, 0, 0}, + }, + { + /* double 1.0 ~ 1000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_VST_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_vst_fac", + .step = 1, + .def = 10, + .min = 10, + .max = 10000, + }, + { + /* uint8_t 0 ~ 128 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_TNR_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_tnr_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 128 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_TNR_STRENGTH2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_tnr_strength2", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 1 ~ 99 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_filter_len", + .step = 1, + .def = 1, + .min = 1, + .max = 99, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 1 ~ 99 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_filter_len2", + .step = 1, + .def = 1, + .min = 1, + .max = 99, + .dims = {1, 0, 0, 0}, + }, + { + /* double 0.1 ~ 5.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_SMOOTH_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_mot_smooth_fac", + .step = 1, + .def = 1, + .min = 1, + .max = 50, + }, + { + /* int 3 or 6 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_RANGE_H, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_range_h", + .step = 1, + .def = 3, + .min = 3, + .max = 6, + }, + { + /* uint8_t 0 ~ 16 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_SAD_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_sad_weight", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_DIFF_TYPE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_diff_type", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_SQR_DIFF_FAC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_sqr_diff_fac", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 0~1 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_SMOOTH_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_mot_smooth_level", + .step = 1, + .min = 0, + .max = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* 3 or 6 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_DILATE_H, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_dilate_h", + .step = 1, + .def = 3, + .min = 3, + .max = 6, + }, + { + /* uint16_t 0 ~ 65535 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_LEVEL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_level", + .step = 1, + .min = 0, + .max = 65535, + .dims = {1, 0, 0, 0}, + }, + { + /* uint16_t 0 ~ 4095 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_MOTION_SLOPE_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_mot_slope_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + /* uint16_t 0 ~ 4095 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_TNR_LUMA_CURVE_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_tnr_luma_curve_x", + .step = 1, + .min = 0, + .max = 4095, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t 0 ~ 65535 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_TNR_LUMA_CURVE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_tnr_luma_curve_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t 0 ~ 4095 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_TNR_MOTION_SLOPE_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_tnr_mot_slope_y", + .step = 1, + .min = 0, + .max = 4095, + .dims = {12, 0, 0, 0}, + }, + { + /* uint16_t 20 or 24 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_INPUT_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_mdl_in_bit", + .step = 1, + .def = 20, + .min = 20, + .max = 24, + .dims = {1, 0, 0, 0}, + }, + { + /* uint16_t 0 ~ 4096 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_FIX_CURVE_START, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_mdl_fcs", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + /* double 0.1 ~ 100.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_A, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_mdl_a", + .step = 1, + .def = 1, + .min = 1, + .max = 1000, + }, + { + /* double 0.1 ~ 10000.0 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_B, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_mdl_b", + .step = 1, + .def = 1, + .min = 1, + .max = 100000, + }, + { + /* uint32_t 0 ~ 1048575 */ + .ops = &vvcam_isp_3dnr_ctrl_ops, + .id = VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_BLS_EXP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_3dnr_stat_noise_mdl_bls_exp", + .step = 1, + .min = 0, + .max = 1048575, + .dims = {4, 0, 0, 0}, + }, +}; + +int vvcam_isp_3dnr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_3dnr_ctrls); +} + +int vvcam_isp_3dnr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_3dnr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_3dnr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp 3dnr ctrl %s failed %d.\n", + vvcam_isp_3dnr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v4/vvcam_isp_3dnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v4/vvcam_isp_3dnr.h new file mode 100644 index 0000000..520ebcf --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/3dnr/3dnr_v4/vvcam_isp_3dnr.h @@ -0,0 +1,181 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_3DNR_H__ +#define __VVCAM_ISP_3DNR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_3DNR_ENABLE (VVCAM_ISP_CID_3DNR_BASE + 0x0000) +#define VVCAM_ISP_CID_3DNR_GAMMA_FE_BE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0001) +#define VVCAM_ISP_CID_3DNR_MOTION_DILATE_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0002) +#define VVCAM_ISP_CID_3DNR_GAUSS_BLUR_ENABLE \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0003) +#define VVCAM_ISP_CID_3DNR_RESET (VVCAM_ISP_CID_3DNR_BASE + 0x0004) +#define VVCAM_ISP_CID_3DNR_MODE (VVCAM_ISP_CID_3DNR_BASE + 0x0005) +#define VVCAM_ISP_CID_3DNR_AUTO_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x0006) +#define VVCAM_ISP_CID_3DNR_AUTO_GAIN (VVCAM_ISP_CID_3DNR_BASE + 0x0007) +#define VVCAM_ISP_CID_3DNR_AUTO_NMK (VVCAM_ISP_CID_3DNR_BASE + 0x0008) +#define VVCAM_ISP_CID_3DNR_AUTO_NMP (VVCAM_ISP_CID_3DNR_BASE + 0x0009) +#define VVCAM_ISP_CID_3DNR_AUTO_FIX_CURVE_START \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000A) +#define VVCAM_ISP_CID_3DNR_AUTO_NOISE_MODEL_A \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000B) +#define VVCAM_ISP_CID_3DNR_AUTO_NOISE_MODEL_B \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000C) +#define VVCAM_ISP_CID_3DNR_AUTO_BLS_EXP (VVCAM_ISP_CID_3DNR_BASE + 0x000D) +#define VVCAM_ISP_CID_3DNR_AUTO_TNR_STRENGTH \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000E) +#define VVCAM_ISP_CID_3DNR_AUTO_TNR_STRENGTH2 \ + (VVCAM_ISP_CID_3DNR_BASE + 0x000F) +#define VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN (VVCAM_ISP_CID_3DNR_BASE + 0x0010) +#define VVCAM_ISP_CID_3DNR_AUTO_FILTER_LEN2 (VVCAM_ISP_CID_3DNR_BASE + 0x0011) +#define VVCAM_ISP_CID_3DNR_AUTO_MOTION_SMOOTH_FAC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0012) +#define VVCAM_ISP_CID_3DNR_AUTO_RANGE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0013) +#define VVCAM_ISP_CID_3DNR_AUTO_SAD_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0014) +#define VVCAM_ISP_CID_3DNR_AUTO_SQR_DIFF_FAC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0015) +#define VVCAM_ISP_CID_3DNR_AUTO_MOTION_SMOOTH_LEVEL \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0016) +#define VVCAM_ISP_CID_3DNR_AUTO_MOTION_DILATE_EN \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0017) +#define VVCAM_ISP_CID_3DNR_AUTO_DILATE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0018) +#define VVCAM_ISP_CID_3DNR_AUTO_TNR_LUMA_CURVE_Y \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0019) +#define VVCAM_ISP_CID_3DNR_AUTO_TNR_MOTION_SLOPE_Y \ + (VVCAM_ISP_CID_3DNR_BASE + 0x001A) + +#define VVCAM_ISP_CID_3DNR_MANU_VST_FAC (VVCAM_ISP_CID_3DNR_BASE + 0x001B) +#define VVCAM_ISP_CID_3DNR_MANU_TNR_STRENGTH \ + (VVCAM_ISP_CID_3DNR_BASE + 0x001C) +#define VVCAM_ISP_CID_3DNR_MANU_TNR_STRENGTH2 \ + (VVCAM_ISP_CID_3DNR_BASE + 0x001D) +#define VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN (VVCAM_ISP_CID_3DNR_BASE + 0x001E) +#define VVCAM_ISP_CID_3DNR_MANU_FILTER_LEN2 (VVCAM_ISP_CID_3DNR_BASE + 0x001F) +#define VVCAM_ISP_CID_3DNR_MANU_MOTION_SMOOTH_FAC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0020) +#define VVCAM_ISP_CID_3DNR_MANU_RANGE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0021) +#define VVCAM_ISP_CID_3DNR_MANU_SAD_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0022) +#define VVCAM_ISP_CID_3DNR_MANU_DIFF_TYPE (VVCAM_ISP_CID_3DNR_BASE + 0x0023) +#define VVCAM_ISP_CID_3DNR_MANU_SQR_DIFF_FAC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0024) +#define VVCAM_ISP_CID_3DNR_MANU_MOTION_SMOOTH_LEVEL \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0025) +#define VVCAM_ISP_CID_3DNR_MANU_DILATE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0026) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x0027) +#define VVCAM_ISP_CID_3DNR_MANU_MOTION_SLOPE_THR \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0028) +#define VVCAM_ISP_CID_3DNR_MANU_TNR_LUMA_CURVE_X \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0029) +#define VVCAM_ISP_CID_3DNR_MANU_TNR_LUMA_CURVE_Y \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002A) +#define VVCAM_ISP_CID_3DNR_MANU_TNR_MOTION_SLOPE_Y \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002B) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_INPUT_BIT \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002C) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_FIX_CURVE_START \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002D) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_A \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002E) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_B \ + (VVCAM_ISP_CID_3DNR_BASE + 0x002F) +#define VVCAM_ISP_CID_3DNR_MANU_NOISE_MODEL_BLS_EXP \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0030) +#define VVCAM_ISP_CID_3DNR_STAT_VST_FAC (VVCAM_ISP_CID_3DNR_BASE + 0x0031) +#define VVCAM_ISP_CID_3DNR_STAT_TNR_STRENGTH \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0032) +#define VVCAM_ISP_CID_3DNR_STAT_TNR_STRENGTH2 \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0033) +#define VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN (VVCAM_ISP_CID_3DNR_BASE + 0x0034) +#define VVCAM_ISP_CID_3DNR_STAT_FILTER_LEN2 (VVCAM_ISP_CID_3DNR_BASE + 0x0035) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_SMOOTH_FAC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0036) +#define VVCAM_ISP_CID_3DNR_STAT_RANGE_H (VVCAM_ISP_CID_3DNR_BASE + 0x0037) +#define VVCAM_ISP_CID_3DNR_STAT_SAD_WEIGHT (VVCAM_ISP_CID_3DNR_BASE + 0x0038) +#define VVCAM_ISP_CID_3DNR_STAT_DIFF_TYPE (VVCAM_ISP_CID_3DNR_BASE + 0x0039) +#define VVCAM_ISP_CID_3DNR_STAT_SQR_DIFF_FAC \ + (VVCAM_ISP_CID_3DNR_BASE + 0x003A) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_SMOOTH_LEVEL \ + (VVCAM_ISP_CID_3DNR_BASE + 0x003B) +#define VVCAM_ISP_CID_3DNR_STAT_DILATE_H (VVCAM_ISP_CID_3DNR_BASE + 0x003C) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_LEVEL (VVCAM_ISP_CID_3DNR_BASE + 0x003D) +#define VVCAM_ISP_CID_3DNR_STAT_MOTION_SLOPE_THR \ + (VVCAM_ISP_CID_3DNR_BASE + 0x003E) +#define VVCAM_ISP_CID_3DNR_STAT_TNR_LUMA_CURVE_X \ + (VVCAM_ISP_CID_3DNR_BASE + 0x003F) +#define VVCAM_ISP_CID_3DNR_STAT_TNR_LUMA_CURVE_Y \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0040) +#define VVCAM_ISP_CID_3DNR_STAT_TNR_MOTION_SLOPE_Y \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0041) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_INPUT_BIT \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0042) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_FIX_CURVE_START \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0043) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_A \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0044) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_B \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0045) +#define VVCAM_ISP_CID_3DNR_STAT_NOISE_MODEL_BLS_EXP \ + (VVCAM_ISP_CID_3DNR_BASE + 0x0046) + +#ifdef __KERNEL__ +int vvcam_isp_3dnr_ctrl_count(void); +int vvcam_isp_3dnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v3/vvcam_isp_ae.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v3/vvcam_isp_ae.c index 6e9ee75..6ce55c9 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v3/vvcam_isp_ae.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v3/vvcam_isp_ae.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -95,6 +97,19 @@ static int vvcam_isp_ae_s_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_AE_LUMA: case VVCAM_ISP_CID_AE_OBJECT_REGION: case VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE: + case VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT: + case VVCAM_ISP_CID_EC_AGAIN: + case VVCAM_ISP_CID_EC_AGAIN_MAX: + case VVCAM_ISP_CID_EC_AGAIN_MIN: + case VVCAM_ISP_CID_EC_AGAIN_STEP: + case VVCAM_ISP_CID_EC_DGAIN: + case VVCAM_ISP_CID_EC_DGAIN_MAX: + case VVCAM_ISP_CID_EC_DGAIN_MIN: + case VVCAM_ISP_CID_EC_DGAIN_STEP: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP: ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -144,6 +159,19 @@ static int vvcam_isp_ae_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_AE_LUMA: case VVCAM_ISP_CID_AE_OBJECT_REGION: case VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE: + case VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT: + case VVCAM_ISP_CID_EC_AGAIN: + case VVCAM_ISP_CID_EC_AGAIN_MAX: + case VVCAM_ISP_CID_EC_AGAIN_MIN: + case VVCAM_ISP_CID_EC_AGAIN_STEP: + case VVCAM_ISP_CID_EC_DGAIN: + case VVCAM_ISP_CID_EC_DGAIN_MAX: + case VVCAM_ISP_CID_EC_DGAIN_MIN: + case VVCAM_ISP_CID_EC_DGAIN_STEP: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -506,6 +534,162 @@ const struct v4l2_ctrl_config vvcam_isp_ae_ctrls[] = { .min = 0, .max = 1, }, + { + /* float 32x32x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_exp_v2_window_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1024}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN_MAX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again_max", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN_MIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again_min", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN_STEP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again_step", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN_MAX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain_max", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN_MIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain_min", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN_STEP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain_step", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time_max", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time_min", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time_step", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, }; int vvcam_isp_ae_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v3/vvcam_isp_ae.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v3/vvcam_isp_ae.h index ea32cdc..dfbd043 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v3/vvcam_isp_ae.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v3/vvcam_isp_ae.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_AE_H__ #define __VVCAM_ISP_AE_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_AE_ENABLE (VVCAM_ISP_CID_AE_BASE + 0x0000) #define VVCAM_ISP_CID_AE_RESET (VVCAM_ISP_CID_AE_BASE + 0x0001) #define VVCAM_ISP_CID_AE_STATE (VVCAM_ISP_CID_AE_BASE + 0x0002) @@ -84,8 +88,23 @@ #define VVCAM_ISP_CID_AE_LUMA (VVCAM_ISP_CID_AE_BASE + 0x001D) #define VVCAM_ISP_CID_AE_OBJECT_REGION (VVCAM_ISP_CID_AE_BASE + 0x001E) #define VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE (VVCAM_ISP_CID_AE_BASE + 0x001F) +#define VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT (VVCAM_ISP_CID_AE_BASE + 0x0020) +#define VVCAM_ISP_CID_EC_AGAIN (VVCAM_ISP_CID_AE_BASE + 0x0021) +#define VVCAM_ISP_CID_EC_AGAIN_MAX (VVCAM_ISP_CID_AE_BASE + 0x0022) +#define VVCAM_ISP_CID_EC_AGAIN_MIN (VVCAM_ISP_CID_AE_BASE + 0x0023) +#define VVCAM_ISP_CID_EC_AGAIN_STEP (VVCAM_ISP_CID_AE_BASE + 0x0024) +#define VVCAM_ISP_CID_EC_DGAIN (VVCAM_ISP_CID_AE_BASE + 0x0025) +#define VVCAM_ISP_CID_EC_DGAIN_MAX (VVCAM_ISP_CID_AE_BASE + 0x0026) +#define VVCAM_ISP_CID_EC_DGAIN_MIN (VVCAM_ISP_CID_AE_BASE + 0x0027) +#define VVCAM_ISP_CID_EC_DGAIN_STEP (VVCAM_ISP_CID_AE_BASE + 0x0028) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME (VVCAM_ISP_CID_AE_BASE + 0x0029) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX (VVCAM_ISP_CID_AE_BASE + 0x002A) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN (VVCAM_ISP_CID_AE_BASE + 0x002B) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP (VVCAM_ISP_CID_AE_BASE + 0x002C) +#ifdef __KERNEL__ int vvcam_isp_ae_ctrl_count(void); int vvcam_isp_ae_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4/vvcam_isp_ae.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4/vvcam_isp_ae.c new file mode 100644 index 0000000..584bc41 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4/vvcam_isp_ae.c @@ -0,0 +1,754 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_ae.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_ae_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AE_ENABLE: + case VVCAM_ISP_CID_AE_RESET: + case VVCAM_ISP_CID_AE_STATE: + case VVCAM_ISP_CID_AE_SEM_MODE: + case VVCAM_ISP_CID_AE_FLICKER_PERIOD: + case VVCAM_ISP_CID_AE_SETPOINT: + case VVCAM_ISP_CID_AE_TOLORENCE: + case VVCAM_ISP_CID_AE_DAMPOVER: + case VVCAM_ISP_CID_AE_DAMPOVER_RATIO: + case VVCAM_ISP_CID_AE_DAMPOVER_GAIN: + case VVCAM_ISP_CID_AE_DAMPUNDER: + case VVCAM_ISP_CID_AE_DAMPUNDER_RATIO: + case VVCAM_ISP_CID_AE_DAMPUNDER_GAIN: + case VVCAM_ISP_CID_AE_MOTION_FILTER: + case VVCAM_ISP_CID_AE_MOTION_THRESHOLD: + case VVCAM_ISP_CID_AE_TARGET_FILTER: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_REPRESS: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_GAIN: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_LEVEL: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_REPRESS: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_GAIN: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_LEVEL: + case VVCAM_ISP_CID_AE_WDR_CONTRAST_MIN: + case VVCAM_ISP_CID_AE_WDR_CONTRAST_MAX: + case VVCAM_ISP_CID_AE_ROI_WEIGHT: + case VVCAM_ISP_CID_AE_ROI: + case VVCAM_ISP_CID_AE_HIST: + case VVCAM_ISP_CID_AE_LUMA: + case VVCAM_ISP_CID_AE_OBJECT_REGION: + case VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE: + case VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT: + case VVCAM_ISP_CID_EC_AGAIN: + case VVCAM_ISP_CID_EC_AGAIN_MAX: + case VVCAM_ISP_CID_EC_AGAIN_MIN: + case VVCAM_ISP_CID_EC_AGAIN_STEP: + case VVCAM_ISP_CID_EC_DGAIN: + case VVCAM_ISP_CID_EC_DGAIN_MAX: + case VVCAM_ISP_CID_EC_DGAIN_MIN: + case VVCAM_ISP_CID_EC_DGAIN_STEP: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP: + case VVCAM_ISP_CID_AE_EXP_TABLE: + case VVCAM_ISP_CID_AE_EXP_DECOMP_CUSTOM: + case VVCAM_ISP_CID_AE_PERFORMANCE_OPTI_MODE: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_ae_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AE_ENABLE: + case VVCAM_ISP_CID_AE_RESET: + case VVCAM_ISP_CID_AE_STATE: + case VVCAM_ISP_CID_AE_SEM_MODE: + case VVCAM_ISP_CID_AE_FLICKER_PERIOD: + case VVCAM_ISP_CID_AE_SETPOINT: + case VVCAM_ISP_CID_AE_TOLORENCE: + case VVCAM_ISP_CID_AE_DAMPOVER: + case VVCAM_ISP_CID_AE_DAMPOVER_RATIO: + case VVCAM_ISP_CID_AE_DAMPOVER_GAIN: + case VVCAM_ISP_CID_AE_DAMPUNDER: + case VVCAM_ISP_CID_AE_DAMPUNDER_RATIO: + case VVCAM_ISP_CID_AE_DAMPUNDER_GAIN: + case VVCAM_ISP_CID_AE_MOTION_FILTER: + case VVCAM_ISP_CID_AE_MOTION_THRESHOLD: + case VVCAM_ISP_CID_AE_TARGET_FILTER: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_REPRESS: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_GAIN: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_LEVEL: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_REPRESS: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_GAIN: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_LEVEL: + case VVCAM_ISP_CID_AE_WDR_CONTRAST_MIN: + case VVCAM_ISP_CID_AE_WDR_CONTRAST_MAX: + case VVCAM_ISP_CID_AE_ROI_WEIGHT: + case VVCAM_ISP_CID_AE_ROI: + case VVCAM_ISP_CID_AE_HIST: + case VVCAM_ISP_CID_AE_LUMA: + case VVCAM_ISP_CID_AE_OBJECT_REGION: + case VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE: + case VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT: + case VVCAM_ISP_CID_EC_AGAIN: + case VVCAM_ISP_CID_EC_AGAIN_MAX: + case VVCAM_ISP_CID_EC_AGAIN_MIN: + case VVCAM_ISP_CID_EC_AGAIN_STEP: + case VVCAM_ISP_CID_EC_DGAIN: + case VVCAM_ISP_CID_EC_DGAIN_MAX: + case VVCAM_ISP_CID_EC_DGAIN_MIN: + case VVCAM_ISP_CID_EC_DGAIN_STEP: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP: + case VVCAM_ISP_CID_AE_EXP_TABLE: + case VVCAM_ISP_CID_AE_EXP_DECOMP_CUSTOM: + case VVCAM_ISP_CID_AE_PERFORMANCE_OPTI_MODE: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_ae_ctrl_ops = { + .s_ctrl = vvcam_isp_ae_s_ctrl, + .g_volatile_ctrl = vvcam_isp_ae_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_ae_ctrls[] = { + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_STATE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_state", + .step = 1, + .min = 0, + .max = 4, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_SEM_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_sem_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_FLICKER_PERIOD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_flicker_period", + .step = 1, + .min = 0, + .max = 3, + }, + { + /* float (0,255) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_SETPOINT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_setpoint", + .step = 1, + .min = 1, + .max = 254, + .def = 1, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_TOLORENCE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_tolerence", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPOVER, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampover", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (1,4) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPOVER_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampover_ratio", + .step = 1, + .min = 101, + .max = 399, + .def = 200, + }, + { + /* float [1,128) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPOVER_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampover_gain", + .step = 1, + .min = 100, + .max = 12799, + .def = 100, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPUNDER, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampunder", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPUNDER_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampunder_ratio", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float [1,16) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPUNDER_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampunder_gain", + .step = 1, + .min = 100, + .max = 1599, + .def = 100, + }, + { + /* float (0,1) 32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_MOTION_FILTER, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_motion_filter", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (0,1) 32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_MOTION_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_motion_threshold", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (0,1) 32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_TARGET_FILTER, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_target_filter", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float array 8x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_REPRESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_linear_repress", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {8}, + }, + { + /* float array 8x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_linear_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {8}, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_LEVEL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_linear_level", + .step = 1, + .min = 0, + .max = 16, + }, + { + /* float array 8x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_HDR_REPRESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_hdr_repress", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {8}, + }, + { + /* float array 8x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_HDR_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_hdr_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {8}, + }, + { + /* int 0~16 */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_HDR_LEVEL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_hdr_level", + .step = 1, + .min = 0, + .max = 16, + }, + { + /* float (0,255) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_WDR_CONTRAST_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_wdr_contrast_min", + .step = 1, + .min = 1, + .max = 254, + .def = 1, + }, + { + /* float (0,255) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_WDR_CONTRAST_MAX, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_wdr_contrast_max", + .step = 1, + .min = 1, + .max = 254, + .def = 1, + }, + { + /* float 25x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_ROI_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_roi_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {25}, + }, + { + /* int 25x4*16bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_ROI, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_roi", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {25, 4, 0, 0}, + }, + { + /* uint32_t array 256*32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_HIST, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_hist", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {256}, + }, + { + /* uint8_t array 32*32*8bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LUMA, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_luma", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1024}, + }, + { + /* uint8_t array 32*32*8bit*/ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_OBJECT_REGION, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_object_region", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1024}, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_frame_calc_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float 32x32x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_exp_v2_window_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1024}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN_MAX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again_max", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN_MIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again_min", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN_STEP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again_step", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN_MAX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain_max", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN_MIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain_min", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN_STEP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain_step", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time_max", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time_min", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time_step", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 8x4*32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_EXP_TABLE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_exp_table", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {8, 4, 0, 0}, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_EXP_DECOMP_CUSTOM, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_exp_decomp_custom", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_PERFORMANCE_OPTI_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_performance_opti_mode", + .step = 1, + .min = 0, + .max = 2, + }, +}; + +int vvcam_isp_ae_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_ae_ctrls); +} + +int vvcam_isp_ae_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_ae_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_ae_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err(isp_dev->dev, "reigster isp ae ctrl %s failed %d.\n", + vvcam_isp_ae_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4/vvcam_isp_ae.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4/vvcam_isp_ae.h new file mode 100644 index 0000000..10d7f53 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4/vvcam_isp_ae.h @@ -0,0 +1,113 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_AE_H__ +#define __VVCAM_ISP_AE_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_AE_ENABLE (VVCAM_ISP_CID_AE_BASE + 0x0000) +#define VVCAM_ISP_CID_AE_RESET (VVCAM_ISP_CID_AE_BASE + 0x0001) +#define VVCAM_ISP_CID_AE_STATE (VVCAM_ISP_CID_AE_BASE + 0x0002) +#define VVCAM_ISP_CID_AE_SEM_MODE (VVCAM_ISP_CID_AE_BASE + 0x0004) +#define VVCAM_ISP_CID_AE_FLICKER_PERIOD (VVCAM_ISP_CID_AE_BASE + 0x0005) +#define VVCAM_ISP_CID_AE_SETPOINT (VVCAM_ISP_CID_AE_BASE + 0x0006) +#define VVCAM_ISP_CID_AE_TOLORENCE (VVCAM_ISP_CID_AE_BASE + 0x0007) +#define VVCAM_ISP_CID_AE_DAMPOVER (VVCAM_ISP_CID_AE_BASE + 0x0008) +#define VVCAM_ISP_CID_AE_DAMPOVER_RATIO (VVCAM_ISP_CID_AE_BASE + 0x0009) +#define VVCAM_ISP_CID_AE_DAMPOVER_GAIN (VVCAM_ISP_CID_AE_BASE + 0x000A) +#define VVCAM_ISP_CID_AE_DAMPUNDER (VVCAM_ISP_CID_AE_BASE + 0x000B) +#define VVCAM_ISP_CID_AE_DAMPUNDER_RATIO (VVCAM_ISP_CID_AE_BASE + 0x000C) +#define VVCAM_ISP_CID_AE_DAMPUNDER_GAIN (VVCAM_ISP_CID_AE_BASE + 0x000D) +#define VVCAM_ISP_CID_AE_MOTION_FILTER (VVCAM_ISP_CID_AE_BASE + 0x000E) +#define VVCAM_ISP_CID_AE_MOTION_THRESHOLD (VVCAM_ISP_CID_AE_BASE + 0x000F) +#define VVCAM_ISP_CID_AE_TARGET_FILTER (VVCAM_ISP_CID_AE_BASE + 0x0010) +#define VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_REPRESS (VVCAM_ISP_CID_AE_BASE + 0x0011) +#define VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_GAIN (VVCAM_ISP_CID_AE_BASE + 0x0012) +#define VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_LEVEL (VVCAM_ISP_CID_AE_BASE + 0x0013) +#define VVCAM_ISP_CID_AE_LOWLIGHT_HDR_REPRESS (VVCAM_ISP_CID_AE_BASE + 0x0014) +#define VVCAM_ISP_CID_AE_LOWLIGHT_HDR_GAIN (VVCAM_ISP_CID_AE_BASE + 0x0015) +#define VVCAM_ISP_CID_AE_LOWLIGHT_HDR_LEVEL (VVCAM_ISP_CID_AE_BASE + 0x0016) +#define VVCAM_ISP_CID_AE_WDR_CONTRAST_MIN (VVCAM_ISP_CID_AE_BASE + 0x0017) +#define VVCAM_ISP_CID_AE_WDR_CONTRAST_MAX (VVCAM_ISP_CID_AE_BASE + 0x0018) +#define VVCAM_ISP_CID_AE_ROI_WEIGHT (VVCAM_ISP_CID_AE_BASE + 0x001A) +#define VVCAM_ISP_CID_AE_ROI (VVCAM_ISP_CID_AE_BASE + 0x001B) +#define VVCAM_ISP_CID_AE_HIST (VVCAM_ISP_CID_AE_BASE + 0x001C) +#define VVCAM_ISP_CID_AE_LUMA (VVCAM_ISP_CID_AE_BASE + 0x001D) +#define VVCAM_ISP_CID_AE_OBJECT_REGION (VVCAM_ISP_CID_AE_BASE + 0x001E) +#define VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE (VVCAM_ISP_CID_AE_BASE + 0x001F) +#define VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT (VVCAM_ISP_CID_AE_BASE + 0x0020) +#define VVCAM_ISP_CID_EC_AGAIN (VVCAM_ISP_CID_AE_BASE + 0x0021) +#define VVCAM_ISP_CID_EC_AGAIN_MAX (VVCAM_ISP_CID_AE_BASE + 0x0022) +#define VVCAM_ISP_CID_EC_AGAIN_MIN (VVCAM_ISP_CID_AE_BASE + 0x0023) +#define VVCAM_ISP_CID_EC_AGAIN_STEP (VVCAM_ISP_CID_AE_BASE + 0x0024) +#define VVCAM_ISP_CID_EC_DGAIN (VVCAM_ISP_CID_AE_BASE + 0x0025) +#define VVCAM_ISP_CID_EC_DGAIN_MAX (VVCAM_ISP_CID_AE_BASE + 0x0026) +#define VVCAM_ISP_CID_EC_DGAIN_MIN (VVCAM_ISP_CID_AE_BASE + 0x0027) +#define VVCAM_ISP_CID_EC_DGAIN_STEP (VVCAM_ISP_CID_AE_BASE + 0x0028) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME (VVCAM_ISP_CID_AE_BASE + 0x0029) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX (VVCAM_ISP_CID_AE_BASE + 0x002A) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN (VVCAM_ISP_CID_AE_BASE + 0x002B) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP (VVCAM_ISP_CID_AE_BASE + 0x002C) +#define VVCAM_ISP_CID_AE_EXP_TABLE (VVCAM_ISP_CID_AE_BASE + 0x002D) +#define VVCAM_ISP_CID_AE_EXP_DECOMP_CUSTOM (VVCAM_ISP_CID_AE_BASE + 0x002E) +#define VVCAM_ISP_CID_AE_PERFORMANCE_OPTI_MODE (VVCAM_ISP_CID_AE_BASE + 0x002F) + +#ifdef __KERNEL__ +int vvcam_isp_ae_ctrl_count(void); +int vvcam_isp_ae_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4_1/vvcam_isp_ae.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4_1/vvcam_isp_ae.c new file mode 100644 index 0000000..f9c6fee --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4_1/vvcam_isp_ae.c @@ -0,0 +1,836 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_ae.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_ae_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AE_ENABLE: + case VVCAM_ISP_CID_AE_RESET: + case VVCAM_ISP_CID_AE_STATE: + case VVCAM_ISP_CID_AE_SEM_MODE: + case VVCAM_ISP_CID_AE_FLICKER_PERIOD: + case VVCAM_ISP_CID_AE_SETPOINT: + case VVCAM_ISP_CID_AE_TOLORENCE: + case VVCAM_ISP_CID_AE_DAMPOVER: + case VVCAM_ISP_CID_AE_DAMPOVER_RATIO: + case VVCAM_ISP_CID_AE_DAMPOVER_GAIN: + case VVCAM_ISP_CID_AE_DAMPUNDER: + case VVCAM_ISP_CID_AE_DAMPUNDER_RATIO: + case VVCAM_ISP_CID_AE_DAMPUNDER_GAIN: + case VVCAM_ISP_CID_AE_MOTION_FILTER: + case VVCAM_ISP_CID_AE_MOTION_THRESHOLD: + case VVCAM_ISP_CID_AE_TARGET_FILTER: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_REPRESS: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_GAIN: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_LEVEL: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_REPRESS: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_GAIN: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_LEVEL: + case VVCAM_ISP_CID_AE_WDR_CONTRAST_MIN: + case VVCAM_ISP_CID_AE_WDR_CONTRAST_MAX: + case VVCAM_ISP_CID_AE_ROI_WEIGHT: + case VVCAM_ISP_CID_AE_ROI: + case VVCAM_ISP_CID_AE_HIST: + case VVCAM_ISP_CID_AE_LUMA: + case VVCAM_ISP_CID_AE_OBJECT_REGION: + case VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE: + case VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT: + case VVCAM_ISP_CID_EC_AGAIN: + case VVCAM_ISP_CID_EC_AGAIN_MAX: + case VVCAM_ISP_CID_EC_AGAIN_MIN: + case VVCAM_ISP_CID_EC_AGAIN_STEP: + case VVCAM_ISP_CID_EC_DGAIN: + case VVCAM_ISP_CID_EC_DGAIN_MAX: + case VVCAM_ISP_CID_EC_DGAIN_MIN: + case VVCAM_ISP_CID_EC_DGAIN_STEP: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP: + case VVCAM_ISP_CID_AE_EXP_TABLE: + case VVCAM_ISP_CID_AE_EXP_V3_ROI: + case VVCAM_ISP_CID_AE_EXP_V3_ROI_WEIGHT: + case VVCAM_ISP_CID_AE_EXP_V3_ROI_CALC_WEIGHT: + case VVCAM_ISP_CID_AE_FRONT_GROUND_TYPE: + case VVCAM_ISP_CID_AE_FRONT_GROUND_FACE_WEIGHT: + case VVCAM_ISP_CID_AE_FRONT_GROUND_TOUCH_WEIGHT: + case VVCAM_ISP_CID_AE_EXP_DECOMP_CUSTOM: + case VVCAM_ISP_CID_AE_PERFORMANCE_OPTI_MODE: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_ae_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AE_ENABLE: + case VVCAM_ISP_CID_AE_RESET: + case VVCAM_ISP_CID_AE_STATE: + case VVCAM_ISP_CID_AE_SEM_MODE: + case VVCAM_ISP_CID_AE_FLICKER_PERIOD: + case VVCAM_ISP_CID_AE_SETPOINT: + case VVCAM_ISP_CID_AE_TOLORENCE: + case VVCAM_ISP_CID_AE_DAMPOVER: + case VVCAM_ISP_CID_AE_DAMPOVER_RATIO: + case VVCAM_ISP_CID_AE_DAMPOVER_GAIN: + case VVCAM_ISP_CID_AE_DAMPUNDER: + case VVCAM_ISP_CID_AE_DAMPUNDER_RATIO: + case VVCAM_ISP_CID_AE_DAMPUNDER_GAIN: + case VVCAM_ISP_CID_AE_MOTION_FILTER: + case VVCAM_ISP_CID_AE_MOTION_THRESHOLD: + case VVCAM_ISP_CID_AE_TARGET_FILTER: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_REPRESS: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_GAIN: + case VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_LEVEL: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_REPRESS: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_GAIN: + case VVCAM_ISP_CID_AE_LOWLIGHT_HDR_LEVEL: + case VVCAM_ISP_CID_AE_WDR_CONTRAST_MIN: + case VVCAM_ISP_CID_AE_WDR_CONTRAST_MAX: + case VVCAM_ISP_CID_AE_ROI_WEIGHT: + case VVCAM_ISP_CID_AE_ROI: + case VVCAM_ISP_CID_AE_HIST: + case VVCAM_ISP_CID_AE_LUMA: + case VVCAM_ISP_CID_AE_OBJECT_REGION: + case VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE: + case VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT: + case VVCAM_ISP_CID_EC_AGAIN: + case VVCAM_ISP_CID_EC_AGAIN_MAX: + case VVCAM_ISP_CID_EC_AGAIN_MIN: + case VVCAM_ISP_CID_EC_AGAIN_STEP: + case VVCAM_ISP_CID_EC_DGAIN: + case VVCAM_ISP_CID_EC_DGAIN_MAX: + case VVCAM_ISP_CID_EC_DGAIN_MIN: + case VVCAM_ISP_CID_EC_DGAIN_STEP: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN: + case VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP: + case VVCAM_ISP_CID_AE_EXP_TABLE: + case VVCAM_ISP_CID_AE_EXP_V3_ROI: + case VVCAM_ISP_CID_AE_EXP_V3_ROI_WEIGHT: + case VVCAM_ISP_CID_AE_EXP_V3_ROI_CALC_WEIGHT: + case VVCAM_ISP_CID_AE_FRONT_GROUND_TYPE: + case VVCAM_ISP_CID_AE_FRONT_GROUND_FACE_WEIGHT: + case VVCAM_ISP_CID_AE_FRONT_GROUND_TOUCH_WEIGHT: + case VVCAM_ISP_CID_AE_EXP_DECOMP_CUSTOM: + case VVCAM_ISP_CID_AE_PERFORMANCE_OPTI_MODE: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_ae_ctrl_ops = { + .s_ctrl = vvcam_isp_ae_s_ctrl, + .g_volatile_ctrl = vvcam_isp_ae_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_ae_ctrls[] = { + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_STATE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_state", + .step = 1, + .min = 0, + .max = 4, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_SEM_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_sem_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_FLICKER_PERIOD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_flicker_period", + .step = 1, + .min = 0, + .max = 3, + }, + { + /* float (0,255) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_SETPOINT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_setpoint", + .step = 1, + .min = 1, + .max = 254, + .def = 1, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_TOLORENCE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_tolerence", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPOVER, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampover", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (1,4) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPOVER_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampover_ratio", + .step = 1, + .min = 101, + .max = 399, + .def = 200, + }, + { + /* float [1,128) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPOVER_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampover_gain", + .step = 1, + .min = 100, + .max = 12799, + .def = 100, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPUNDER, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampunder", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPUNDER_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampunder_ratio", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float [1,16) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_DAMPUNDER_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_dampunder_gain", + .step = 1, + .min = 100, + .max = 1599, + .def = 100, + }, + { + /* float (0,1) 32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_MOTION_FILTER, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_motion_filter", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (0,1) 32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_MOTION_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_motion_threshold", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (0,1) 32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_TARGET_FILTER, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_target_filter", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float array 8x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_REPRESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_linear_repress", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {8}, + }, + { + /* float array 8x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_linear_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {8}, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_LEVEL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_linear_level", + .step = 1, + .min = 0, + .max = 16, + }, + { + /* float array 8x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_HDR_REPRESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_hdr_repress", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {8}, + }, + { + /* float array 8x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_HDR_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_hdr_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {8}, + }, + { + /* int 0~16 */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LOWLIGHT_HDR_LEVEL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_lowlight_hdr_level", + .step = 1, + .min = 0, + .max = 16, + }, + { + /* float (0,255) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_WDR_CONTRAST_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_wdr_contrast_min", + .step = 1, + .min = 1, + .max = 254, + .def = 1, + }, + { + /* float (0,255) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_WDR_CONTRAST_MAX, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_wdr_contrast_max", + .step = 1, + .min = 1, + .max = 254, + .def = 1, + }, + { + /* float 25x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_ROI_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_roi_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {25}, + }, + { + /* int 25x4*16bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_ROI, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_roi", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {25, 4, 0, 0}, + }, + { + /* uint32_t array 256*32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_HIST, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_hist", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {256}, + }, + { + /* uint8_t array 32*32*8bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_LUMA, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_luma", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1024}, + }, + { + /* uint8_t array 32*32*8bit*/ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_OBJECT_REGION, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_object_region", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1024}, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_frame_calc_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float 32x32x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_exp_v2_window_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1024}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN_MAX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again_max", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN_MIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again_min", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_AGAIN_STEP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_again_step", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN_MAX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain_max", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN_MIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain_min", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_DGAIN_STEP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_dgain_step", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time_max", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time_min", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ec_integration_time_step", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 8x4*32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_EXP_TABLE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_exp_table", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {8, 4, 0, 0}, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_EXP_V3_ROI_CALC_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_exp_v3_roi_calc_weight", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float 25x32bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_EXP_V3_ROI_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_exp_v3_roi_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {25}, + }, + { + /* uint16_t 25x4x16bit */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_EXP_V3_ROI, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_exp_v3_roi", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {25, 4, 0, 0}, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_FRONT_GROUND_TYPE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_front_type", + .step = 1, + .min = 0, + .max = 2, + }, + { + /* float (0, 1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_FRONT_GROUND_FACE_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_front_face_weight", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + /* float (0, 1) */ + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_FRONT_GROUND_TOUCH_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_front_touch_weight", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_EXP_DECOMP_CUSTOM, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_exp_decomp_custom", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ae_ctrl_ops, + .id = VVCAM_ISP_CID_AE_PERFORMANCE_OPTI_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ae_performance_opti_mode", + .step = 1, + .min = 0, + .max = 2, + }, +}; + +int vvcam_isp_ae_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_ae_ctrls); +} + +int vvcam_isp_ae_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_ae_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_ae_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err(isp_dev->dev, "reigster isp ae ctrl %s failed %d.\n", + vvcam_isp_ae_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4_1/vvcam_isp_ae.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4_1/vvcam_isp_ae.h new file mode 100644 index 0000000..2047416 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ae/ae_v4_1/vvcam_isp_ae.h @@ -0,0 +1,119 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_AE_H__ +#define __VVCAM_ISP_AE_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_AE_ENABLE (VVCAM_ISP_CID_AE_BASE + 0x0000) +#define VVCAM_ISP_CID_AE_RESET (VVCAM_ISP_CID_AE_BASE + 0x0001) +#define VVCAM_ISP_CID_AE_STATE (VVCAM_ISP_CID_AE_BASE + 0x0002) +#define VVCAM_ISP_CID_AE_SEM_MODE (VVCAM_ISP_CID_AE_BASE + 0x0004) +#define VVCAM_ISP_CID_AE_FLICKER_PERIOD (VVCAM_ISP_CID_AE_BASE + 0x0005) +#define VVCAM_ISP_CID_AE_SETPOINT (VVCAM_ISP_CID_AE_BASE + 0x0006) +#define VVCAM_ISP_CID_AE_TOLORENCE (VVCAM_ISP_CID_AE_BASE + 0x0007) +#define VVCAM_ISP_CID_AE_DAMPOVER (VVCAM_ISP_CID_AE_BASE + 0x0008) +#define VVCAM_ISP_CID_AE_DAMPOVER_RATIO (VVCAM_ISP_CID_AE_BASE + 0x0009) +#define VVCAM_ISP_CID_AE_DAMPOVER_GAIN (VVCAM_ISP_CID_AE_BASE + 0x000A) +#define VVCAM_ISP_CID_AE_DAMPUNDER (VVCAM_ISP_CID_AE_BASE + 0x000B) +#define VVCAM_ISP_CID_AE_DAMPUNDER_RATIO (VVCAM_ISP_CID_AE_BASE + 0x000C) +#define VVCAM_ISP_CID_AE_DAMPUNDER_GAIN (VVCAM_ISP_CID_AE_BASE + 0x000D) +#define VVCAM_ISP_CID_AE_MOTION_FILTER (VVCAM_ISP_CID_AE_BASE + 0x000E) +#define VVCAM_ISP_CID_AE_MOTION_THRESHOLD (VVCAM_ISP_CID_AE_BASE + 0x000F) +#define VVCAM_ISP_CID_AE_TARGET_FILTER (VVCAM_ISP_CID_AE_BASE + 0x0010) +#define VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_REPRESS (VVCAM_ISP_CID_AE_BASE + 0x0011) +#define VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_GAIN (VVCAM_ISP_CID_AE_BASE + 0x0012) +#define VVCAM_ISP_CID_AE_LOWLIGHT_LINEAR_LEVEL (VVCAM_ISP_CID_AE_BASE + 0x0013) +#define VVCAM_ISP_CID_AE_LOWLIGHT_HDR_REPRESS (VVCAM_ISP_CID_AE_BASE + 0x0014) +#define VVCAM_ISP_CID_AE_LOWLIGHT_HDR_GAIN (VVCAM_ISP_CID_AE_BASE + 0x0015) +#define VVCAM_ISP_CID_AE_LOWLIGHT_HDR_LEVEL (VVCAM_ISP_CID_AE_BASE + 0x0016) +#define VVCAM_ISP_CID_AE_WDR_CONTRAST_MIN (VVCAM_ISP_CID_AE_BASE + 0x0017) +#define VVCAM_ISP_CID_AE_WDR_CONTRAST_MAX (VVCAM_ISP_CID_AE_BASE + 0x0018) +#define VVCAM_ISP_CID_AE_ROI_WEIGHT (VVCAM_ISP_CID_AE_BASE + 0x001A) +#define VVCAM_ISP_CID_AE_ROI (VVCAM_ISP_CID_AE_BASE + 0x001B) +#define VVCAM_ISP_CID_AE_HIST (VVCAM_ISP_CID_AE_BASE + 0x001C) +#define VVCAM_ISP_CID_AE_LUMA (VVCAM_ISP_CID_AE_BASE + 0x001D) +#define VVCAM_ISP_CID_AE_OBJECT_REGION (VVCAM_ISP_CID_AE_BASE + 0x001E) +#define VVCAM_ISP_CID_AE_FRAME_CALC_ENABLE (VVCAM_ISP_CID_AE_BASE + 0x001F) +#define VVCAM_ISP_CID_AE_EXPV2_WINDOW_WEIGHT (VVCAM_ISP_CID_AE_BASE + 0x0020) +#define VVCAM_ISP_CID_EC_AGAIN (VVCAM_ISP_CID_AE_BASE + 0x0021) +#define VVCAM_ISP_CID_EC_AGAIN_MAX (VVCAM_ISP_CID_AE_BASE + 0x0022) +#define VVCAM_ISP_CID_EC_AGAIN_MIN (VVCAM_ISP_CID_AE_BASE + 0x0023) +#define VVCAM_ISP_CID_EC_AGAIN_STEP (VVCAM_ISP_CID_AE_BASE + 0x0024) +#define VVCAM_ISP_CID_EC_DGAIN (VVCAM_ISP_CID_AE_BASE + 0x0025) +#define VVCAM_ISP_CID_EC_DGAIN_MAX (VVCAM_ISP_CID_AE_BASE + 0x0026) +#define VVCAM_ISP_CID_EC_DGAIN_MIN (VVCAM_ISP_CID_AE_BASE + 0x0027) +#define VVCAM_ISP_CID_EC_DGAIN_STEP (VVCAM_ISP_CID_AE_BASE + 0x0028) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME (VVCAM_ISP_CID_AE_BASE + 0x0029) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME_MAX (VVCAM_ISP_CID_AE_BASE + 0x002A) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME_MIN (VVCAM_ISP_CID_AE_BASE + 0x002B) +#define VVCAM_ISP_CID_EC_INTEGRATION_TIME_STEP (VVCAM_ISP_CID_AE_BASE + 0x002C) +#define VVCAM_ISP_CID_AE_EXP_TABLE (VVCAM_ISP_CID_AE_BASE + 0x002D) +#define VVCAM_ISP_CID_AE_EXP_V3_ROI (VVCAM_ISP_CID_AE_BASE + 0x002E) +#define VVCAM_ISP_CID_AE_EXP_V3_ROI_WEIGHT (VVCAM_ISP_CID_AE_BASE + 0x002F) +#define VVCAM_ISP_CID_AE_EXP_V3_ROI_CALC_WEIGHT (VVCAM_ISP_CID_AE_BASE + 0x0030) +#define VVCAM_ISP_CID_AE_FRONT_GROUND_TYPE (VVCAM_ISP_CID_AE_BASE + 0x0031) +#define VVCAM_ISP_CID_AE_FRONT_GROUND_FACE_WEIGHT (VVCAM_ISP_CID_AE_BASE + 0x0032) +#define VVCAM_ISP_CID_AE_FRONT_GROUND_TOUCH_WEIGHT (VVCAM_ISP_CID_AE_BASE + 0x0033) +#define VVCAM_ISP_CID_AE_EXP_DECOMP_CUSTOM (VVCAM_ISP_CID_AE_BASE + 0x0034) +#define VVCAM_ISP_CID_AE_PERFORMANCE_OPTI_MODE (VVCAM_ISP_CID_AE_BASE + 0x0035) + +#ifdef __KERNEL__ +int vvcam_isp_ae_ctrl_count(void); +int vvcam_isp_ae_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v3/vvcam_isp_af.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v3/vvcam_isp_af.c index 97ddeb9..0eac74a 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v3/vvcam_isp_af.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v3/vvcam_isp_af.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -212,9 +214,9 @@ const struct v4l2_ctrl_config vvcam_isp_af_ctrls[] = { .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_cdaf_points_of_curve", .step = 1, - .min = 1, + .min = 3, .max = 20, - .def = 1, + .def = 3, .dims = {1}, }, { diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v3/vvcam_isp_af.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v3/vvcam_isp_af.h index a4b9fad..21d1de2 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v3/vvcam_isp_af.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v3/vvcam_isp_af.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_AF_H__ #define __VVCAM_ISP_AF_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_AF_ENABLE (VVCAM_ISP_CID_AF_BASE + 0x0000) #define VVCAM_ISP_CID_AF_RESET (VVCAM_ISP_CID_AF_BASE + 0x0001) #define VVCAM_ISP_CID_AF_STATE (VVCAM_ISP_CID_AF_BASE + 0x0002) @@ -78,7 +82,9 @@ (VVCAM_ISP_CID_AF_BASE + 0x0012) #define VVCAM_ISP_CID_PDAF_ROI_INDEX (VVCAM_ISP_CID_AF_BASE + 0x0013) +#ifdef __KERNEL__ int vvcam_isp_af_ctrl_count(void); int vvcam_isp_af_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4/vvcam_isp_af.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4/vvcam_isp_af.c new file mode 100644 index 0000000..544c653 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4/vvcam_isp_af.c @@ -0,0 +1,367 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_af.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_af_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AF_ENABLE: + case VVCAM_ISP_CID_AF_RESET: + case VVCAM_ISP_CID_AF_MODE: + // case VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT: + case VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE: + case VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE: + case VVCAM_ISP_CID_CDAF_MAX_FOCAL: + case VVCAM_ISP_CID_CDAF_MIN_FOCAL: + case VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX: + case VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE: + case VVCAM_ISP_CID_PDAF_ROI_INDEX: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_af_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AF_ENABLE: + case VVCAM_ISP_CID_AF_STATE: + case VVCAM_ISP_CID_AF_MODE: + // case VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT: + case VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE: + case VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE: + case VVCAM_ISP_CID_CDAF_MAX_FOCAL: + case VVCAM_ISP_CID_CDAF_MIN_FOCAL: + case VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX: + case VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE: + case VVCAM_ISP_CID_PDAF_ROI_INDEX: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_af_ctrl_ops = { + .s_ctrl = vvcam_isp_af_s_ctrl, + .g_volatile_ctrl = vvcam_isp_af_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_af_ctrls[] = { + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_STATE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_state", + .step = 1, + .min = 0, + .max = 5, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_mode", + .step = 1, + .min = 0, + .max = 2, + }, + /* this control is related to afmv1_1, which is not supported in afv4 for now + { + // float array 9x + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_window_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {9, 0, 0, 0}, + }, + */ + { + /* float (0,1) */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_stable_tolerance", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_points_of_curve", + .step = 1, + .min = 3, + .max = 20, + .def = 3, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_MAX_FOCAL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_max_focal", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_MIN_FOCAL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_min_focal", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_motion_threshold", + .step = 1, + .min = 1, + .max = 999, + .def = 1, + }, + { + /* float (0,1023) */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_pd_conf_threshold", + .step = 1, + .min = 1, + .max = 10229, + .def = 1, + }, + { + /* float [0,1023] */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_pd_shift_threshold", + .step = 1, + .min = 0, + .max = 10230, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_pd_stable_cnt_max", + .step = 1, + .min = 1, + .max = 10, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_defocus_frame_num", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_loss_conf_frame_num", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_acc_focus_step", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_acc_focus_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_ROI_INDEX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_roi_index", + .step = 1, + .min = 0, + .max = 48, + .dims = {1}, + }, +}; + +int vvcam_isp_af_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_af_ctrls); +} + +int vvcam_isp_af_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_af_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_af_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp af ctrl %s failed %d.\n", + vvcam_isp_af_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4/vvcam_isp_af.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4/vvcam_isp_af.h new file mode 100644 index 0000000..b1d7517 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4/vvcam_isp_af.h @@ -0,0 +1,91 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_AF_H__ +#define __VVCAM_ISP_AF_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_AF_ENABLE (VVCAM_ISP_CID_AF_BASE + 0x0000) +#define VVCAM_ISP_CID_AF_RESET (VVCAM_ISP_CID_AF_BASE + 0x0001) +#define VVCAM_ISP_CID_AF_STATE (VVCAM_ISP_CID_AF_BASE + 0x0002) +#define VVCAM_ISP_CID_AF_MODE (VVCAM_ISP_CID_AF_BASE + 0x0003) +#define VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT (VVCAM_ISP_CID_AF_BASE + 0x0004) +#define VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE (VVCAM_ISP_CID_AF_BASE + 0x0005) +#define VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE (VVCAM_ISP_CID_AF_BASE + 0x0006) +#define VVCAM_ISP_CID_CDAF_MAX_FOCAL (VVCAM_ISP_CID_AF_BASE + 0x0007) +#define VVCAM_ISP_CID_CDAF_MIN_FOCAL (VVCAM_ISP_CID_AF_BASE + 0x0008) +#define VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD (VVCAM_ISP_CID_AF_BASE + 0x0009) +#define VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD \ + (VVCAM_ISP_CID_AF_BASE + 0x000A) +#define VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD \ + (VVCAM_ISP_CID_AF_BASE + 0x000B) +#define VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX \ + (VVCAM_ISP_CID_AF_BASE + 0x000C) +#define VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM \ + (VVCAM_ISP_CID_AF_BASE + 0x000D) +#define VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM \ + (VVCAM_ISP_CID_AF_BASE + 0x000E) +#define VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP (VVCAM_ISP_CID_AF_BASE + 0x000F) +#define VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE \ + (VVCAM_ISP_CID_AF_BASE + 0x0010) +#define VVCAM_ISP_CID_PDAF_ROI_INDEX (VVCAM_ISP_CID_AF_BASE + 0x0011) + +#ifdef __KERNEL__ +int vvcam_isp_af_ctrl_count(void); +int vvcam_isp_af_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_1_1/vvcam_isp_af.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_1_1/vvcam_isp_af.c new file mode 100644 index 0000000..c7a91ec --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_1_1/vvcam_isp_af.c @@ -0,0 +1,392 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_af.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_af_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AF_ENABLE: + case VVCAM_ISP_CID_AF_RESET: + case VVCAM_ISP_CID_AF_MODE: + case VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT: + case VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE: + case VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE: + case VVCAM_ISP_CID_CDAF_MAX_FOCAL: + case VVCAM_ISP_CID_CDAF_MIN_FOCAL: + case VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX: + case VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE: + case VVCAM_ISP_CID_PDAF_ROI_INDEX: + case VVCAM_ISP_CID_AFMV11_ROI_WEIGHT: + case VVCAM_ISP_CID_AFMV11_ROI: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_af_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AF_ENABLE: + case VVCAM_ISP_CID_AF_STATE: + case VVCAM_ISP_CID_AF_MODE: + case VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT: + case VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE: + case VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE: + case VVCAM_ISP_CID_CDAF_MAX_FOCAL: + case VVCAM_ISP_CID_CDAF_MIN_FOCAL: + case VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX: + case VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE: + case VVCAM_ISP_CID_PDAF_ROI_INDEX: + case VVCAM_ISP_CID_AFMV11_ROI_WEIGHT: + case VVCAM_ISP_CID_AFMV11_ROI: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_af_ctrl_ops = { + .s_ctrl = vvcam_isp_af_s_ctrl, + .g_volatile_ctrl = vvcam_isp_af_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_af_ctrls[] = { + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_STATE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_state", + .step = 1, + .min = 0, + .max = 5, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_mode", + .step = 1, + .min = 0, + .max = 2, + }, + { + /* float array 9x */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_window_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {9, 0, 0, 0}, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_stable_tolerance", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_points_of_curve", + .step = 1, + .min = 3, + .max = 20, + .def = 3, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_MAX_FOCAL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_max_focal", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_MIN_FOCAL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_min_focal", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_motion_threshold", + .step = 1, + .min = 1, + .max = 999, + .def = 1, + }, + { + /* float (0,1023) */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_pd_conf_threshold", + .step = 1, + .min = 1, + .max = 10229, + .def = 1, + }, + { + /* float [0,1023] */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_pd_shift_threshold", + .step = 1, + .min = 0, + .max = 10230, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_pd_stable_cnt_max", + .step = 1, + .min = 1, + .max = 10, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_defocus_frame_num", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_loss_conf_frame_num", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_acc_focus_step", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_acc_focus_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_ROI_INDEX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_roi_index", + .step = 1, + .min = 0, + .max = 48, + .dims = {1}, + }, + { + /* float 25x array 0~1 */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AFMV11_ROI_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afmv11_roi_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {25, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AFMV11_ROI, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afmv11_roi", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {25, 4, 0, 0}, + } +}; + +int vvcam_isp_af_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_af_ctrls); +} + +int vvcam_isp_af_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_af_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_af_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp af ctrl %s failed %d.\n", + vvcam_isp_af_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_1_1/vvcam_isp_af.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_1_1/vvcam_isp_af.h new file mode 100644 index 0000000..3132591 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_1_1/vvcam_isp_af.h @@ -0,0 +1,93 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_AF_H__ +#define __VVCAM_ISP_AF_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_AF_ENABLE (VVCAM_ISP_CID_AF_BASE + 0x0000) +#define VVCAM_ISP_CID_AF_RESET (VVCAM_ISP_CID_AF_BASE + 0x0001) +#define VVCAM_ISP_CID_AF_STATE (VVCAM_ISP_CID_AF_BASE + 0x0002) +#define VVCAM_ISP_CID_AF_MODE (VVCAM_ISP_CID_AF_BASE + 0x0003) +#define VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT (VVCAM_ISP_CID_AF_BASE + 0x0004) +#define VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE (VVCAM_ISP_CID_AF_BASE + 0x0005) +#define VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE (VVCAM_ISP_CID_AF_BASE + 0x0006) +#define VVCAM_ISP_CID_CDAF_MAX_FOCAL (VVCAM_ISP_CID_AF_BASE + 0x0007) +#define VVCAM_ISP_CID_CDAF_MIN_FOCAL (VVCAM_ISP_CID_AF_BASE + 0x0008) +#define VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD (VVCAM_ISP_CID_AF_BASE + 0x0009) +#define VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD \ + (VVCAM_ISP_CID_AF_BASE + 0x000A) +#define VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD \ + (VVCAM_ISP_CID_AF_BASE + 0x000B) +#define VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX \ + (VVCAM_ISP_CID_AF_BASE + 0x000C) +#define VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM \ + (VVCAM_ISP_CID_AF_BASE + 0x000D) +#define VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM \ + (VVCAM_ISP_CID_AF_BASE + 0x000E) +#define VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP (VVCAM_ISP_CID_AF_BASE + 0x000F) +#define VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE \ + (VVCAM_ISP_CID_AF_BASE + 0x0010) +#define VVCAM_ISP_CID_PDAF_ROI_INDEX (VVCAM_ISP_CID_AF_BASE + 0x0011) +#define VVCAM_ISP_CID_AFMV11_ROI_WEIGHT (VVCAM_ISP_CID_AF_BASE + 0x0012) +#define VVCAM_ISP_CID_AFMV11_ROI (VVCAM_ISP_CID_AF_BASE + 0x0013) + +#ifdef __KERNEL__ +int vvcam_isp_af_ctrl_count(void); +int vvcam_isp_af_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_3/vvcam_isp_af.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_3/vvcam_isp_af.c new file mode 100644 index 0000000..fd040df --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_3/vvcam_isp_af.c @@ -0,0 +1,381 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_af.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_af_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AF_ENABLE: + case VVCAM_ISP_CID_AF_RESET: + case VVCAM_ISP_CID_AF_MODE: + // case VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT: + case VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE: + case VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE: + case VVCAM_ISP_CID_CDAF_MAX_FOCAL: + case VVCAM_ISP_CID_CDAF_MIN_FOCAL: + case VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX: + case VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE: + case VVCAM_ISP_CID_PDAF_ROI_INDEX: + case VVCAM_ISP_CID_AFMV3_ROI_WEIGHT: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_af_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AF_ENABLE: + case VVCAM_ISP_CID_AF_STATE: + case VVCAM_ISP_CID_AF_MODE: + // case VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT: + case VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE: + case VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE: + case VVCAM_ISP_CID_CDAF_MAX_FOCAL: + case VVCAM_ISP_CID_CDAF_MIN_FOCAL: + case VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD: + case VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX: + case VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP: + case VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE: + case VVCAM_ISP_CID_PDAF_ROI_INDEX: + case VVCAM_ISP_CID_AFMV3_ROI_WEIGHT: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_af_ctrl_ops = { + .s_ctrl = vvcam_isp_af_s_ctrl, + .g_volatile_ctrl = vvcam_isp_af_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_af_ctrls[] = { + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_STATE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_state", + .step = 1, + .min = 0, + .max = 5, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AF_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_af_mode", + .step = 1, + .min = 0, + .max = 2, + }, + /* this control is related to afmv1_1, which is not supported in afv4 for now + { + // float array 9x + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_window_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {9, 0, 0, 0}, + }, + */ + { + /* float (0,1) */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_stable_tolerance", + .step = 1, + .min = 1, + .max = 99, + .def = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_points_of_curve", + .step = 1, + .min = 3, + .max = 20, + .def = 3, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_MAX_FOCAL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_max_focal", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_MIN_FOCAL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_min_focal", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + /* float (0,1) */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cdaf_motion_threshold", + .step = 1, + .min = 1, + .max = 999, + .def = 1, + }, + { + /* float (0,1023) */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_pd_conf_threshold", + .step = 1, + .min = 1, + .max = 10229, + .def = 1, + }, + { + /* float [0,1023] */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_pd_shift_threshold", + .step = 1, + .min = 0, + .max = 10230, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_pd_stable_cnt_max", + .step = 1, + .min = 1, + .max = 10, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_defocus_frame_num", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_loss_conf_frame_num", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_acc_focus_step", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pcdaf_acc_focus_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_ROI_INDEX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_roi_index", + .step = 1, + .min = 0, + .max = 48, + .dims = {1}, + }, + { + /* float 225x array 0~255 */ + .ops = &vvcam_isp_af_ctrl_ops, + .id = VVCAM_ISP_CID_AFMV3_ROI_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afmv3_roi_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {225, 0, 0, 0}, + }, +}; + +int vvcam_isp_af_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_af_ctrls); +} + +int vvcam_isp_af_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_af_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_af_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp af ctrl %s failed %d.\n", + vvcam_isp_af_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_3/vvcam_isp_af.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_3/vvcam_isp_af.h new file mode 100644 index 0000000..b331b0a --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/af/af_v4_3/vvcam_isp_af.h @@ -0,0 +1,92 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_AF_H__ +#define __VVCAM_ISP_AF_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_AF_ENABLE (VVCAM_ISP_CID_AF_BASE + 0x0000) +#define VVCAM_ISP_CID_AF_RESET (VVCAM_ISP_CID_AF_BASE + 0x0001) +#define VVCAM_ISP_CID_AF_STATE (VVCAM_ISP_CID_AF_BASE + 0x0002) +#define VVCAM_ISP_CID_AF_MODE (VVCAM_ISP_CID_AF_BASE + 0x0003) +#define VVCAM_ISP_CID_CDAF_WINDOW_WEIGHT (VVCAM_ISP_CID_AF_BASE + 0x0004) +#define VVCAM_ISP_CID_CDAF_STABLE_TOLERENCE (VVCAM_ISP_CID_AF_BASE + 0x0005) +#define VVCAM_ISP_CID_CDAF_POINTS_OF_CURVE (VVCAM_ISP_CID_AF_BASE + 0x0006) +#define VVCAM_ISP_CID_CDAF_MAX_FOCAL (VVCAM_ISP_CID_AF_BASE + 0x0007) +#define VVCAM_ISP_CID_CDAF_MIN_FOCAL (VVCAM_ISP_CID_AF_BASE + 0x0008) +#define VVCAM_ISP_CID_CDAF_MOTION_THRESHOLD (VVCAM_ISP_CID_AF_BASE + 0x0009) +#define VVCAM_ISP_CID_PDAF_PD_CONF_THRESHOLD \ + (VVCAM_ISP_CID_AF_BASE + 0x000A) +#define VVCAM_ISP_CID_PDAF_PD_SHIFT_THRESHOLD \ + (VVCAM_ISP_CID_AF_BASE + 0x000B) +#define VVCAM_ISP_CID_PDAF_PD_STABLE_CNT_MAX \ + (VVCAM_ISP_CID_AF_BASE + 0x000C) +#define VVCAM_ISP_CID_PCDAF_DEFOCUS_FRAME_NUM \ + (VVCAM_ISP_CID_AF_BASE + 0x000D) +#define VVCAM_ISP_CID_PCDAF_LOSS_CONF_FRAME_NUM \ + (VVCAM_ISP_CID_AF_BASE + 0x000E) +#define VVCAM_ISP_CID_PCDAF_ACC_FOCUS_STEP (VVCAM_ISP_CID_AF_BASE + 0x000F) +#define VVCAM_ISP_CID_PCDAF_ACC_FOCUS_ENABLE \ + (VVCAM_ISP_CID_AF_BASE + 0x0010) +#define VVCAM_ISP_CID_PDAF_ROI_INDEX (VVCAM_ISP_CID_AF_BASE + 0x0011) +#define VVCAM_ISP_CID_AFMV3_ROI_WEIGHT (VVCAM_ISP_CID_AF_BASE + 0x0012) + +#ifdef __KERNEL__ +int vvcam_isp_af_ctrl_count(void); +int vvcam_isp_af_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1/vvcam_isp_afm.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1/vvcam_isp_afm.c index 7c413e7..b2e1aed 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1/vvcam_isp_afm.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1/vvcam_isp_afm.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -188,7 +190,7 @@ const struct v4l2_ctrl_config vvcam_isp_afm_ctrls[] = { .dims = {4, 0, 0, 0}, }, { - /* 0~255 */ + /* 0~65535 */ .ops = &vvcam_isp_afm_ctrl_ops, .id = VVCAM_ISP_CID_AFM_THRESHOLD, .type = V4L2_CTRL_TYPE_U32, @@ -196,8 +198,7 @@ const struct v4l2_ctrl_config vvcam_isp_afm_ctrls[] = { .name = "isp_afm_threshold", .step = 1, .min = 0, - .max = 255, - .def = 0, + .max = 65535, .dims = {1, 0, 0, 0}, }, { @@ -299,7 +300,7 @@ const struct v4l2_ctrl_config vvcam_isp_afm_ctrls[] = { .max = 0xFFFFFFFF, .dims = {1, 0, 0, 0}, }, - + }; int vvcam_isp_afm_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1/vvcam_isp_afm.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1/vvcam_isp_afm.h index 5def58e..cd35cb2 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1/vvcam_isp_afm.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1/vvcam_isp_afm.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_AFM_H__ #define __VVCAM_ISP_AFM_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_AFM_ENABLE (VVCAM_ISP_CID_AFM_BASE + 0x0000) #define VVCAM_ISP_CID_AFM_RESET (VVCAM_ISP_CID_AFM_BASE + 0x0001) #define VVCAM_ISP_CID_AFM_MEASURE_WINDOW_A (VVCAM_ISP_CID_AFM_BASE + 0x0002) @@ -70,7 +74,9 @@ #define VVCAM_ISP_CID_AFM_WIN_B_PIXEL_CNT (VVCAM_ISP_CID_AFM_BASE + 0x000D) #define VVCAM_ISP_CID_AFM_WIN_C_PIXEL_CNT (VVCAM_ISP_CID_AFM_BASE + 0x000E) +#ifdef __KERNEL__ int vvcam_isp_afm_ctrl_count(void); int vvcam_isp_afm_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1_1/vvcam_isp_afm.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1_1/vvcam_isp_afm.c new file mode 100644 index 0000000..126349e --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1_1/vvcam_isp_afm.c @@ -0,0 +1,711 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_afm.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_afm_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AFM_INST0_ENABLE: + case VVCAM_ISP_CID_AFM_INST1_ENABLE: + case VVCAM_ISP_CID_AFM_INST2_ENABLE: + case VVCAM_ISP_CID_AFM_RESET: + case VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_A: + case VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_B: + case VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_C: + case VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_A: + case VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_B: + case VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_C: + case VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_A: + case VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_B: + case VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_C: + case VVCAM_ISP_CID_AFM_INST0_THRESHOLD: + case VVCAM_ISP_CID_AFM_INST1_THRESHOLD: + case VVCAM_ISP_CID_AFM_INST2_THRESHOLD: + case VVCAM_ISP_CID_AFM_INST0_WIN_A_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST0_WIN_B_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST0_WIN_C_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST0_WIN_A_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST0_WIN_B_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST0_WIN_C_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST0_WIN_A_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST0_WIN_B_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST0_WIN_C_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST1_WIN_A_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST1_WIN_B_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST1_WIN_C_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST1_WIN_A_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST1_WIN_B_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST1_WIN_C_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST1_WIN_A_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST1_WIN_B_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST1_WIN_C_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST2_WIN_A_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST2_WIN_B_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST2_WIN_C_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST2_WIN_A_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST2_WIN_B_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST2_WIN_C_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST2_WIN_A_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST2_WIN_B_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST2_WIN_C_PIXEL_CNT: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_afm_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AFM_INST0_ENABLE: + case VVCAM_ISP_CID_AFM_INST1_ENABLE: + case VVCAM_ISP_CID_AFM_INST2_ENABLE: + case VVCAM_ISP_CID_AFM_WINDOW_ENABLE: + case VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_A: + case VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_B: + case VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_C: + case VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_A: + case VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_B: + case VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_C: + case VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_A: + case VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_B: + case VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_C: + case VVCAM_ISP_CID_AFM_INST0_THRESHOLD: + case VVCAM_ISP_CID_AFM_INST1_THRESHOLD: + case VVCAM_ISP_CID_AFM_INST2_THRESHOLD: + case VVCAM_ISP_CID_AFM_INST0_WIN_A_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST0_WIN_B_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST0_WIN_C_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST0_WIN_A_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST0_WIN_B_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST0_WIN_C_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST0_WIN_A_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST0_WIN_B_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST0_WIN_C_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST1_WIN_A_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST1_WIN_B_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST1_WIN_C_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST1_WIN_A_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST1_WIN_B_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST1_WIN_C_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST1_WIN_A_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST1_WIN_B_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST1_WIN_C_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST2_WIN_A_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST2_WIN_B_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST2_WIN_C_SHARPNESS: + case VVCAM_ISP_CID_AFM_INST2_WIN_A_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST2_WIN_B_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST2_WIN_C_LUMINANCE: + case VVCAM_ISP_CID_AFM_INST2_WIN_A_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST2_WIN_B_PIXEL_CNT: + case VVCAM_ISP_CID_AFM_INST2_WIN_C_PIXEL_CNT: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_afm_ctrl_ops = { + .s_ctrl = vvcam_isp_afm_s_ctrl, + .g_volatile_ctrl = vvcam_isp_afm_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_afm_ctrls[] = { + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* bool 4x4 array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_WINDOW_ENABLE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_win_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {4, 4, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint16_t 4x array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_A, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_measure_win_a", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* uint16_t 4x array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_B, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_measure_win_b", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* uint16_t 4x array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_C, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_measure_win_c", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* uint16_t 4x array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_A, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_measure_win_a", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* uint16_t 4x array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_B, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_measure_win_b", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* uint16_t 4x array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_C, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_measure_win_c", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* uint16_t 4x array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_A, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_measure_win_a", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* uint16_t 4x array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_B, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_measure_win_b", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* uint16_t 4x array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_C, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_measure_win_c", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* 0~255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_threshold", + .step = 1, + .min = 0, + .max = 65535, + .def = 0, + .dims = {1, 0, 0, 0}, + }, + { + /* 0~255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_threshold", + .step = 1, + .min = 0, + .max = 65535, + .def = 0, + .dims = {1, 0, 0, 0}, + }, + { + /* 0~255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_threshold", + .step = 1, + .min = 0, + .max = 65535, + .def = 0, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_WIN_A_SHARPNESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_win_a_sharpness", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_WIN_B_SHARPNESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_win_b_sharpness", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_WIN_C_SHARPNESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_win_c_sharpness", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_WIN_A_LUMINANCE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_win_a_luminance", + .step = 1, + .min = 0, + .max = 0xFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_WIN_B_LUMINANCE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_win_b_luminance", + .step = 1, + .min = 0, + .max = 0xFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_WIN_C_LUMINANCE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_win_c_luminance", + .step = 1, + .min = 0, + .max = 0xFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_WIN_A_PIXEL_CNT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_win_a_pixel_cnt", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_WIN_B_PIXEL_CNT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_win_b_pixel_cnt", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST0_WIN_C_PIXEL_CNT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst0_win_c_pixel_cnt", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_WIN_A_SHARPNESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_win_a_sharpness", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_WIN_B_SHARPNESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_win_b_sharpness", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_WIN_C_SHARPNESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_win_c_sharpness", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_WIN_A_LUMINANCE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_win_a_luminance", + .step = 1, + .min = 0, + .max = 0xFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_WIN_B_LUMINANCE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_win_b_luminance", + .step = 1, + .min = 0, + .max = 0xFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_WIN_C_LUMINANCE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_win_c_luminance", + .step = 1, + .min = 0, + .max = 0xFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_WIN_A_PIXEL_CNT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_win_a_pixel_cnt", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_WIN_B_PIXEL_CNT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_win_b_pixel_cnt", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST1_WIN_C_PIXEL_CNT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst1_win_c_pixel_cnt", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_WIN_A_SHARPNESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_win_a_sharpness", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_WIN_B_SHARPNESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_win_b_sharpness", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_WIN_C_SHARPNESS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_win_c_sharpness", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_WIN_A_LUMINANCE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_win_a_luminance", + .step = 1, + .min = 0, + .max = 0xFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_WIN_B_LUMINANCE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_win_b_luminance", + .step = 1, + .min = 0, + .max = 0xFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_WIN_C_LUMINANCE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_win_c_luminance", + .step = 1, + .min = 0, + .max = 0xFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_WIN_A_PIXEL_CNT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_win_a_pixel_cnt", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_WIN_B_PIXEL_CNT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_win_b_pixel_cnt", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_INST2_WIN_C_PIXEL_CNT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_inst2_win_c_pixel_cnt", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_afm_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_afm_ctrls); +} + +int vvcam_isp_afm_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_afm_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_afm_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp afm ctrl %s failed %d.\n", + vvcam_isp_afm_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1_1/vvcam_isp_afm.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1_1/vvcam_isp_afm.h new file mode 100644 index 0000000..3d0e705 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v1_1/vvcam_isp_afm.h @@ -0,0 +1,148 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_AFM_H__ +#define __VVCAM_ISP_AFM_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_AFM_INST0_ENABLE (VVCAM_ISP_CID_AFM_BASE + 0x0000) +#define VVCAM_ISP_CID_AFM_INST1_ENABLE (VVCAM_ISP_CID_AFM_BASE + 0x0001) +#define VVCAM_ISP_CID_AFM_INST2_ENABLE (VVCAM_ISP_CID_AFM_BASE + 0x0002) +#define VVCAM_ISP_CID_AFM_WINDOW_ENABLE (VVCAM_ISP_CID_AFM_BASE + 0x0003) +#define VVCAM_ISP_CID_AFM_RESET (VVCAM_ISP_CID_AFM_BASE + 0x0004) +#define VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_A \ + (VVCAM_ISP_CID_AFM_BASE + 0x0005) +#define VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_B \ + (VVCAM_ISP_CID_AFM_BASE + 0x0006) +#define VVCAM_ISP_CID_AFM_INST0_MEASURE_WINDOW_C \ + (VVCAM_ISP_CID_AFM_BASE + 0x0007) +#define VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_A \ + (VVCAM_ISP_CID_AFM_BASE + 0x0008) +#define VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_B \ + (VVCAM_ISP_CID_AFM_BASE + 0x0009) +#define VVCAM_ISP_CID_AFM_INST1_MEASURE_WINDOW_C \ + (VVCAM_ISP_CID_AFM_BASE + 0x000A) +#define VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_A \ + (VVCAM_ISP_CID_AFM_BASE + 0x000B) +#define VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_B \ + (VVCAM_ISP_CID_AFM_BASE + 0x000C) +#define VVCAM_ISP_CID_AFM_INST2_MEASURE_WINDOW_C \ + (VVCAM_ISP_CID_AFM_BASE + 0x000D) +#define VVCAM_ISP_CID_AFM_INST0_THRESHOLD (VVCAM_ISP_CID_AFM_BASE + 0x000E) +#define VVCAM_ISP_CID_AFM_INST1_THRESHOLD (VVCAM_ISP_CID_AFM_BASE + 0x000F) +#define VVCAM_ISP_CID_AFM_INST2_THRESHOLD (VVCAM_ISP_CID_AFM_BASE + 0x0010) + +#define VVCAM_ISP_CID_AFM_INST0_WIN_A_SHARPNESS \ + (VVCAM_ISP_CID_AFM_BASE + 0x0011) +#define VVCAM_ISP_CID_AFM_INST0_WIN_B_SHARPNESS \ + (VVCAM_ISP_CID_AFM_BASE + 0x0012) +#define VVCAM_ISP_CID_AFM_INST0_WIN_C_SHARPNESS \ + (VVCAM_ISP_CID_AFM_BASE + 0x0013) +#define VVCAM_ISP_CID_AFM_INST0_WIN_A_LUMINANCE \ + (VVCAM_ISP_CID_AFM_BASE + 0x0014) +#define VVCAM_ISP_CID_AFM_INST0_WIN_B_LUMINANCE \ + (VVCAM_ISP_CID_AFM_BASE + 0x0015) +#define VVCAM_ISP_CID_AFM_INST0_WIN_C_LUMINANCE \ + (VVCAM_ISP_CID_AFM_BASE + 0x0016) +#define VVCAM_ISP_CID_AFM_INST0_WIN_A_PIXEL_CNT \ + (VVCAM_ISP_CID_AFM_BASE + 0x0017) +#define VVCAM_ISP_CID_AFM_INST0_WIN_B_PIXEL_CNT \ + (VVCAM_ISP_CID_AFM_BASE + 0x0018) +#define VVCAM_ISP_CID_AFM_INST0_WIN_C_PIXEL_CNT \ + (VVCAM_ISP_CID_AFM_BASE + 0x0019) +#define VVCAM_ISP_CID_AFM_INST1_WIN_A_SHARPNESS \ + (VVCAM_ISP_CID_AFM_BASE + 0x001A) +#define VVCAM_ISP_CID_AFM_INST1_WIN_B_SHARPNESS \ + (VVCAM_ISP_CID_AFM_BASE + 0x001B) +#define VVCAM_ISP_CID_AFM_INST1_WIN_C_SHARPNESS \ + (VVCAM_ISP_CID_AFM_BASE + 0x001C) +#define VVCAM_ISP_CID_AFM_INST1_WIN_A_LUMINANCE \ + (VVCAM_ISP_CID_AFM_BASE + 0x001D) +#define VVCAM_ISP_CID_AFM_INST1_WIN_B_LUMINANCE \ + (VVCAM_ISP_CID_AFM_BASE + 0x001E) +#define VVCAM_ISP_CID_AFM_INST1_WIN_C_LUMINANCE \ + (VVCAM_ISP_CID_AFM_BASE + 0x001F) +#define VVCAM_ISP_CID_AFM_INST1_WIN_A_PIXEL_CNT \ + (VVCAM_ISP_CID_AFM_BASE + 0x0020) +#define VVCAM_ISP_CID_AFM_INST1_WIN_B_PIXEL_CNT \ + (VVCAM_ISP_CID_AFM_BASE + 0x0021) +#define VVCAM_ISP_CID_AFM_INST1_WIN_C_PIXEL_CNT \ + (VVCAM_ISP_CID_AFM_BASE + 0x0022) +#define VVCAM_ISP_CID_AFM_INST2_WIN_A_SHARPNESS \ + (VVCAM_ISP_CID_AFM_BASE + 0x0023) +#define VVCAM_ISP_CID_AFM_INST2_WIN_B_SHARPNESS \ + (VVCAM_ISP_CID_AFM_BASE + 0x0024) +#define VVCAM_ISP_CID_AFM_INST2_WIN_C_SHARPNESS \ + (VVCAM_ISP_CID_AFM_BASE + 0x0025) +#define VVCAM_ISP_CID_AFM_INST2_WIN_A_LUMINANCE \ + (VVCAM_ISP_CID_AFM_BASE + 0x0026) +#define VVCAM_ISP_CID_AFM_INST2_WIN_B_LUMINANCE \ + (VVCAM_ISP_CID_AFM_BASE + 0x0027) +#define VVCAM_ISP_CID_AFM_INST2_WIN_C_LUMINANCE \ + (VVCAM_ISP_CID_AFM_BASE + 0x0028) +#define VVCAM_ISP_CID_AFM_INST2_WIN_A_PIXEL_CNT \ + (VVCAM_ISP_CID_AFM_BASE + 0x0029) +#define VVCAM_ISP_CID_AFM_INST2_WIN_B_PIXEL_CNT \ + (VVCAM_ISP_CID_AFM_BASE + 0x002A) +#define VVCAM_ISP_CID_AFM_INST2_WIN_C_PIXEL_CNT \ + (VVCAM_ISP_CID_AFM_BASE + 0x002B) + +#ifdef __KERNEL__ +int vvcam_isp_afm_ctrl_count(void); +int vvcam_isp_afm_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v3/vvcam_isp_afm.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v3/vvcam_isp_afm.c new file mode 100644 index 0000000..e607b9e --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v3/vvcam_isp_afm.c @@ -0,0 +1,551 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_afm.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_afm_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AFM_ENABLE: + case VVCAM_ISP_CID_AFM_GAMMA_ENABLE: + case VVCAM_ISP_CID_AFM_RESET: + case VVCAM_ISP_CID_AFM_BLS: + case VVCAM_ISP_CID_AFM_HIST_THRESHOLD: + case VVCAM_ISP_CID_AFM_GAMMA_VAL: + case VVCAM_ISP_CID_AFM_HW_ROI: + case VVCAM_ISP_CID_AFM_LDG_IIR_HIGH_PASS_Y: + case VVCAM_ISP_CID_AFM_LDG_IIR_HIGH_PASS_X: + case VVCAM_ISP_CID_AFM_LDG_IIR_LOW_PASS_Y: + case VVCAM_ISP_CID_AFM_LDG_IIR_LOW_PASS_X: + case VVCAM_ISP_CID_AFM_LDG_FIR_HIGH_PASS_Y: + case VVCAM_ISP_CID_AFM_LDG_FIR_HIGH_PASS_X: + case VVCAM_ISP_CID_AFM_LDG_FIR_LOW_PASS_Y: + case VVCAM_ISP_CID_AFM_LDG_FIR_LOW_PASS_X: + case VVCAM_ISP_CID_AFM_CORING_IIR_HIGH_PASS: + case VVCAM_ISP_CID_AFM_CORING_IIR_LOW_PASS: + case VVCAM_ISP_CID_AFM_CORING_FIR_HIGH_PASS: + case VVCAM_ISP_CID_AFM_CORING_FIR_LOW_PASS: + case VVCAM_ISP_CID_AFM_IIR_DATA_SHIFT: + case VVCAM_ISP_CID_AFM_IIR_HIGH_PASS_WEIGHT: + case VVCAM_ISP_CID_AFM_IIR_LOW_PASS_WEIGHT: + case VVCAM_ISP_CID_AFM_IIR_HIGH_PASS_COEFF: + case VVCAM_ISP_CID_AFM_IIR_LOW_PASS_COEFF: + case VVCAM_ISP_CID_AFM_FIR_DATA_SHIFT: + case VVCAM_ISP_CID_AFM_FIR_HIGH_PASS_WEIGHT: + case VVCAM_ISP_CID_AFM_FIR_LOW_PASS_WEIGHT: + case VVCAM_ISP_CID_AFM_SHARPNESS_HIGH_PASS: + case VVCAM_ISP_CID_AFM_SHARPNESS_LOW_PASS: + case VVCAM_ISP_CID_AFM_HIST_LOW_DATA: + case VVCAM_ISP_CID_AFM_HIST_HIGH_DATA: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_afm_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AFM_ENABLE: + // case VVCAM_ISP_CID_AFM_GAMMA_ENABLE: + case VVCAM_ISP_CID_AFM_RESET: + case VVCAM_ISP_CID_AFM_BLS: + case VVCAM_ISP_CID_AFM_HIST_THRESHOLD: + case VVCAM_ISP_CID_AFM_GAMMA_VAL: + case VVCAM_ISP_CID_AFM_HW_ROI: + case VVCAM_ISP_CID_AFM_LDG_IIR_HIGH_PASS_Y: + case VVCAM_ISP_CID_AFM_LDG_IIR_HIGH_PASS_X: + case VVCAM_ISP_CID_AFM_LDG_IIR_LOW_PASS_Y: + case VVCAM_ISP_CID_AFM_LDG_IIR_LOW_PASS_X: + case VVCAM_ISP_CID_AFM_LDG_FIR_HIGH_PASS_Y: + case VVCAM_ISP_CID_AFM_LDG_FIR_HIGH_PASS_X: + case VVCAM_ISP_CID_AFM_LDG_FIR_LOW_PASS_Y: + case VVCAM_ISP_CID_AFM_LDG_FIR_LOW_PASS_X: + case VVCAM_ISP_CID_AFM_CORING_IIR_HIGH_PASS: + case VVCAM_ISP_CID_AFM_CORING_IIR_LOW_PASS: + case VVCAM_ISP_CID_AFM_CORING_FIR_HIGH_PASS: + case VVCAM_ISP_CID_AFM_CORING_FIR_LOW_PASS: + case VVCAM_ISP_CID_AFM_IIR_DATA_SHIFT: + case VVCAM_ISP_CID_AFM_IIR_HIGH_PASS_WEIGHT: + case VVCAM_ISP_CID_AFM_IIR_LOW_PASS_WEIGHT: + case VVCAM_ISP_CID_AFM_IIR_HIGH_PASS_COEFF: + case VVCAM_ISP_CID_AFM_IIR_LOW_PASS_COEFF: + case VVCAM_ISP_CID_AFM_FIR_DATA_SHIFT: + case VVCAM_ISP_CID_AFM_FIR_HIGH_PASS_WEIGHT: + case VVCAM_ISP_CID_AFM_FIR_LOW_PASS_WEIGHT: + case VVCAM_ISP_CID_AFM_SHARPNESS_HIGH_PASS: + case VVCAM_ISP_CID_AFM_SHARPNESS_LOW_PASS: + case VVCAM_ISP_CID_AFM_HIST_LOW_DATA: + case VVCAM_ISP_CID_AFM_HIST_HIGH_DATA: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_afm_ctrl_ops = { + .s_ctrl = vvcam_isp_afm_s_ctrl, + .g_volatile_ctrl = vvcam_isp_afm_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_afm_ctrls[] = { + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_GAMMA_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_gamma_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_BLS, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_bls", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_HIST_THRESHOLD, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_hist_threshold", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + /* float (0,4] */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_GAMMA_VAL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_gamma_val", + .step = 1, + .min = 1, + .max = 400, + .def = 1, + }, + { + /* uint16_t 4x array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_HW_ROI, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_hw_roi", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* float 0 ~ 15.9375 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_LDG_IIR_HIGH_PASS_Y, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_ldg_iir_high_pass_y", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_LDG_IIR_HIGH_PASS_X, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_ldg_iir_high_pass_x", + .step = 1, + .min = 0, + .max = 255, + .dims = {4, 0, 0, 0}, + }, + { + /* float 0 ~ 15.9375 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_LDG_IIR_LOW_PASS_Y, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_ldg_iir_low_pass_y", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_LDG_IIR_LOW_PASS_X, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_ldg_iir_low_pass_x", + .step = 1, + .min = 0, + .max = 255, + .dims = {4, 0, 0, 0}, + }, + { + /* float 0 ~ 15.9375 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_LDG_FIR_HIGH_PASS_Y, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_ldg_fir_high_pass_y", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_LDG_FIR_HIGH_PASS_X, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_ldg_fir_high_pass_x", + .step = 1, + .min = 0, + .max = 255, + .dims = {4, 0, 0, 0}, + }, + { + /* float 0 ~ 15.9375 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_LDG_FIR_LOW_PASS_Y, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_ldg_fir_low_pass_y", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_LDG_FIR_LOW_PASS_X, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_ldg_fir_low_pass_x", + .step = 1, + .min = 0, + .max = 255, + .dims = {4, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_CORING_IIR_HIGH_PASS, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_coring_iir_high_pass", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_CORING_IIR_LOW_PASS, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_coring_iir_low_pass", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_CORING_FIR_HIGH_PASS, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_coring_fir_high_pass", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 255 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_CORING_FIR_LOW_PASS, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_coring_fir_low_pass", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* uint8_t 0 ~ 15 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_IIR_DATA_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_iir_data_shift", + .step = 1, + .min = 0, + .max = 15, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0 ~ 15.9375 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_IIR_HIGH_PASS_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_iir_high_pass_weight", + .step = 1, + .min = 0, + .max = 255, + }, + { + /* float 0 ~ 15.9375 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_IIR_LOW_PASS_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_iir_low_pass_weight", + .step = 1, + .min = 0, + .max = 255, + }, + { + /* float 3*4 -4095/256 ~ 4095/256 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_IIR_HIGH_PASS_COEFF, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_iir_high_pass_coeff", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 4, 0, 0}, + }, + { + /* float 3*4 -4095/256 ~ 4095/256 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_IIR_LOW_PASS_COEFF, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_iir_low_pass_coeff", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 4, 0, 0}, + }, + { + /* uint8_t 0 ~ 15 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_FIR_DATA_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_fir_data_shift", + .step = 1, + .min = 0, + .max = 15, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0 ~ 15.9375 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_FIR_HIGH_PASS_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_fir_high_pass_weight", + .step = 1, + .min = 0, + .max = 255, + }, + { + /* float 0 ~ 15.9375 */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_FIR_LOW_PASS_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_fir_low_pass_weight", + .step = 1, + .min = 0, + .max = 255, + }, + { + /* uint32_t 15x15 array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_SHARPNESS_HIGH_PASS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_sharpness_high_pass", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {225, 0, 0, 0}, + }, + { + /* uint32_t 15x15 array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_SHARPNESS_LOW_PASS, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_sharpness_low_pass", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {225, 0, 0, 0}, + }, + { + /* uint32_t 15x15 array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_HIST_LOW_DATA, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_hist_low_data", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {225, 0, 0, 0}, + }, + { + /* uint32_t 15x15 array */ + .ops = &vvcam_isp_afm_ctrl_ops, + .id = VVCAM_ISP_CID_AFM_HIST_HIGH_DATA, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_afm_hist_high_data", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {225, 0, 0, 0}, + }, +}; + +int vvcam_isp_afm_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_afm_ctrls); +} + +int vvcam_isp_afm_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_afm_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_afm_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp afm ctrl %s failed %d.\n", + vvcam_isp_afm_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v3/vvcam_isp_afm.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v3/vvcam_isp_afm.h new file mode 100644 index 0000000..1dcca99 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/afm/afm_v3/vvcam_isp_afm.h @@ -0,0 +1,119 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_AFM_H__ +#define __VVCAM_ISP_AFM_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_AFM_ENABLE (VVCAM_ISP_CID_AFM_BASE + 0x0000) +#define VVCAM_ISP_CID_AFM_GAMMA_ENABLE (VVCAM_ISP_CID_AFM_BASE + 0x0001) +#define VVCAM_ISP_CID_AFM_RESET (VVCAM_ISP_CID_AFM_BASE + 0x0002) +#define VVCAM_ISP_CID_AFM_BLS (VVCAM_ISP_CID_AFM_BASE + 0x0003) +#define VVCAM_ISP_CID_AFM_HIST_THRESHOLD (VVCAM_ISP_CID_AFM_BASE + 0x0004) +#define VVCAM_ISP_CID_AFM_GAMMA_VAL (VVCAM_ISP_CID_AFM_BASE + 0x0005) +#define VVCAM_ISP_CID_AFM_HW_ROI (VVCAM_ISP_CID_AFM_BASE + 0x0006) +#define VVCAM_ISP_CID_AFM_LDG_IIR_HIGH_PASS_Y \ + (VVCAM_ISP_CID_AFM_BASE + 0x0007) +#define VVCAM_ISP_CID_AFM_LDG_IIR_HIGH_PASS_X \ + (VVCAM_ISP_CID_AFM_BASE + 0x0008) +#define VVCAM_ISP_CID_AFM_LDG_IIR_LOW_PASS_Y \ + (VVCAM_ISP_CID_AFM_BASE + 0x0009) +#define VVCAM_ISP_CID_AFM_LDG_IIR_LOW_PASS_X \ + (VVCAM_ISP_CID_AFM_BASE + 0x000A) +#define VVCAM_ISP_CID_AFM_LDG_FIR_HIGH_PASS_Y \ + (VVCAM_ISP_CID_AFM_BASE + 0x000B) +#define VVCAM_ISP_CID_AFM_LDG_FIR_HIGH_PASS_X \ + (VVCAM_ISP_CID_AFM_BASE + 0x000C) +#define VVCAM_ISP_CID_AFM_LDG_FIR_LOW_PASS_Y \ + (VVCAM_ISP_CID_AFM_BASE + 0x000D) +#define VVCAM_ISP_CID_AFM_LDG_FIR_LOW_PASS_X \ + (VVCAM_ISP_CID_AFM_BASE + 0x000E) +#define VVCAM_ISP_CID_AFM_CORING_IIR_HIGH_PASS \ + (VVCAM_ISP_CID_AFM_BASE + 0x000F) +#define VVCAM_ISP_CID_AFM_CORING_IIR_LOW_PASS \ + (VVCAM_ISP_CID_AFM_BASE + 0x0010) +#define VVCAM_ISP_CID_AFM_CORING_FIR_HIGH_PASS \ + (VVCAM_ISP_CID_AFM_BASE + 0x0011) +#define VVCAM_ISP_CID_AFM_CORING_FIR_LOW_PASS \ + (VVCAM_ISP_CID_AFM_BASE + 0x0012) +#define VVCAM_ISP_CID_AFM_IIR_DATA_SHIFT (VVCAM_ISP_CID_AFM_BASE + 0x0013) +#define VVCAM_ISP_CID_AFM_IIR_HIGH_PASS_WEIGHT \ + (VVCAM_ISP_CID_AFM_BASE + 0x0014) +#define VVCAM_ISP_CID_AFM_IIR_LOW_PASS_WEIGHT \ + (VVCAM_ISP_CID_AFM_BASE + 0x0015) +#define VVCAM_ISP_CID_AFM_IIR_HIGH_PASS_COEFF \ + (VVCAM_ISP_CID_AFM_BASE + 0x0016) +#define VVCAM_ISP_CID_AFM_IIR_LOW_PASS_COEFF \ + (VVCAM_ISP_CID_AFM_BASE + 0x0017) +#define VVCAM_ISP_CID_AFM_FIR_DATA_SHIFT (VVCAM_ISP_CID_AFM_BASE + 0x0018) +#define VVCAM_ISP_CID_AFM_FIR_HIGH_PASS_WEIGHT \ + (VVCAM_ISP_CID_AFM_BASE + 0x0019) +#define VVCAM_ISP_CID_AFM_FIR_LOW_PASS_WEIGHT \ + (VVCAM_ISP_CID_AFM_BASE + 0x001A) +#define VVCAM_ISP_CID_AFM_SHARPNESS_HIGH_PASS \ + (VVCAM_ISP_CID_AFM_BASE + 0x001B) +#define VVCAM_ISP_CID_AFM_SHARPNESS_LOW_PASS \ + (VVCAM_ISP_CID_AFM_BASE + 0x001C) +#define VVCAM_ISP_CID_AFM_HIST_LOW_DATA (VVCAM_ISP_CID_AFM_BASE + 0x001D) +#define VVCAM_ISP_CID_AFM_HIST_HIGH_DATA (VVCAM_ISP_CID_AFM_BASE + 0x001E) + +#ifdef __KERNEL__ +int vvcam_isp_afm_ctrl_count(void); +int vvcam_isp_afm_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v3/vvcam_isp_awb.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v3/vvcam_isp_awb.c index 36e96f5..0d30673 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v3/vvcam_isp_awb.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v3/vvcam_isp_awb.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v3/vvcam_isp_awb.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v3/vvcam_isp_awb.h index 8752b65..407b191 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v3/vvcam_isp_awb.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v3/vvcam_isp_awb.h @@ -1,69 +1,75 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_AWB_H__ #define __VVCAM_ISP_AWB_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_AWB_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x0000) #define VVCAM_ISP_CID_AWB_STATE (VVCAM_ISP_CID_AWB_BASE + 0x0001) #define VVCAM_ISP_CID_AWB_MODE (VVCAM_ISP_CID_AWB_BASE + 0x0002) #define VVCAM_ISP_CID_AWB_USE_CC_OFFSET (VVCAM_ISP_CID_AWB_BASE + 0x0003) #define VVCAM_ISP_CID_AWB_USE_CC_MATRIX (VVCAM_ISP_CID_AWB_BASE + 0x0004) #define VVCAM_ISP_CID_AWB_USE_DAMPING (VVCAM_ISP_CID_AWB_BASE + 0x0005) -#define VVCAM_ISP_CID_AWB_ROI_WEIGHT (VVCAM_ISP_CID_AWB_BASE + 0x0008) -#define VVCAM_ISP_CID_AWB_ROI (VVCAM_ISP_CID_AWB_BASE + 0x0009) +#define VVCAM_ISP_CID_AWB_ROI_WEIGHT (VVCAM_ISP_CID_AWB_BASE + 0x0006) +#define VVCAM_ISP_CID_AWB_ROI (VVCAM_ISP_CID_AWB_BASE + 0x0007) +#ifdef __KERNEL__ int vvcam_isp_awb_ctrl_count(void); int vvcam_isp_awb_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4/vvcam_isp_awb.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4/vvcam_isp_awb.c new file mode 100644 index 0000000..11570e6 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4/vvcam_isp_awb.c @@ -0,0 +1,633 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_awb.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_awb_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AWB_ENABLE: + case VVCAM_ISP_CID_AWB_STATE: + case VVCAM_ISP_CID_AWB_MODE: + case VVCAM_ISP_CID_AWB_USE_CC_OFFSET: + case VVCAM_ISP_CID_AWB_USE_CC_MATRIX: + case VVCAM_ISP_CID_AWB_USE_DAMPING: + case VVCAM_ISP_CID_AWB_ROI_WEIGHT: + case VVCAM_ISP_CID_AWB_ROI: + case VVCAM_ISP_CID_AWB_CONFIDENCE_THRESH: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_ENABLE: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_A: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_CWF: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_D65: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_THRESH: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_THRESH: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_THRESH: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_ENABLE: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_BRIGHT: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_ENABLE: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_BRIGHT: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_R: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_B: + case VVCAM_ISP_CID_AWB_USE_MANU_DAMP_COEFF: + case VVCAM_ISP_CID_AWB_MANU_DAMP_COEFF: + case VVCAM_ISP_CID_AWB_PERFORMANCE_OPTI_MODE: + case VVCAM_ISP_CID_AWB_LOCK_THRESH: + case VVCAM_ISP_CID_AWB_UNLOCK_THRESH: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_awb_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AWB_ENABLE: + case VVCAM_ISP_CID_AWB_STATE: + case VVCAM_ISP_CID_AWB_MODE: + case VVCAM_ISP_CID_AWB_USE_CC_OFFSET: + case VVCAM_ISP_CID_AWB_USE_CC_MATRIX: + case VVCAM_ISP_CID_AWB_USE_DAMPING: + case VVCAM_ISP_CID_AWB_ROI_WEIGHT: + case VVCAM_ISP_CID_AWB_ROI: + case VVCAM_ISP_CID_AWB_COLOR_TEMP_WEIGHT: + case VVCAM_ISP_CID_AWB_CONFIDENCE_THRESH: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_ENABLE: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_A: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_CWF: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_D65: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_THRESH: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_THRESH: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_THRESH: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_ENABLE: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_BRIGHT: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_ENABLE: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_BRIGHT: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_R: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_B: + case VVCAM_ISP_CID_AWB_USE_MANU_DAMP_COEFF: + case VVCAM_ISP_CID_AWB_MANU_DAMP_COEFF: + case VVCAM_ISP_CID_AWB_PERFORMANCE_OPTI_MODE: + case VVCAM_ISP_CID_AWB_LOCK_THRESH: + case VVCAM_ISP_CID_AWB_UNLOCK_THRESH: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_awb_ctrl_ops = { + .s_ctrl = vvcam_isp_awb_s_ctrl, + .g_volatile_ctrl = vvcam_isp_awb_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_awb_ctrls[] = { + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_STATE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_state", + .step = 1, + .min = 0, + .max = 4, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_USE_CC_OFFSET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_use_cc_offset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_USE_CC_MATRIX, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_use_cc_matrix", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_USE_DAMPING, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_use_damping", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float array 25x32bit 0~1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_ROI_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_roi_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {25}, + }, + { + /* int array 25x4*16bit */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_ROI, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_roi", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {25, 4, 0, 0}, + }, + { + /* float array 7x32bit [0, 1] */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_COLOR_TEMP_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_color_temp_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {7}, + }, + { + /* float array 10x32bit [0, 3] */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFIDENCE_THRESH, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confidence_thresh", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {10}, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_TEMP_PREFER_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_temp_prefer_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_TEMP_PREFER_A, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_temp_prefer_a", + .step = 1, + .min = 1, + .max = 511, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_TEMP_PREFER_CWF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_temp_prefer_cwf", + .step = 1, + .min = 1, + .max = 511, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_TEMP_PREFER_D65, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_temp_prefer_d65", + .step = 1, + .min = 1, + .max = 511, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_CWF_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_cwf_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_CWF_RG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_cwf_rg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_CWF_BG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_cwf_bg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,3) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_CWF_THRESH, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_cwf_thresh", + .step = 1, + .min = 1, + .max = 29999, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_TL84_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_tl84_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_TL84_RG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_tl84_rg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_TL84_BG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_tl84_bg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,3) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_TL84_THRESH, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_tl84_thresh", + .step = 1, + .min = 1, + .max = 29999, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_D65_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_d65_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_D65_RG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_d65_rg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_D65_BG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_d65_bg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,3) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_D65_THRESH, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_d65_thresh", + .step = 1, + .min = 1, + .max = 29999, + .def = 1, + }, + { + /* bool array 10x32bit */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_ENABLE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_light_weight_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {10}, + }, + { + /* float array 10x18x32bit [0, 17] */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_BRIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_light_weight_bright", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {10, 18, 0, 0}, + }, + { + /* float array 10x18x32bit [0, 1] */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_LIGHT_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_light_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {10, 18, 0, 0}, + }, + { + /* bool array 10x32bit */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_GRAY_PREFER_ENABLE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_gray_prefer_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {10}, + }, + { + /* float array 10x18x32bit [0, 17] */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_GRAY_PREFER_BRIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_gray_prefer_bright", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {10, 18, 0, 0}, + }, + { + /* uint16_t array 10x18x16bit (0, 512) */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_GRAY_PREFER_R, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_gray_prefer_r", + .step = 1, + .min = 1, + .max = 511, + .def = 1, + .dims = {10, 18, 0, 0}, + }, + { + /* uint16_t array 10x18x16bit (0, 512) */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_GRAY_PREFER_B, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_gray_prefer_b", + .step = 1, + .min = 1, + .max = 511, + .def = 1, + .dims = {10, 18, 0, 0}, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_USE_MANU_DAMP_COEFF, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_use_manu_damp_coeff", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float (0, 1) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_MANU_DAMP_COEFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_manu_damp_coeff", + .step = 1, + .min = 1, + .max = 9999, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_PERFORMANCE_OPTI_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_performance_opti_mode", + .step = 1, + .min = 0, + .max = 2, + }, + { + /* float [0, 0.2] ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_LOCK_THRESH, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_lock_thresh", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* float [0, 0.2] ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_UNLOCK_THRESH, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_unlock_thresh", + .step = 1, + .min = 0, + .max = 2000, + }, +}; + +int vvcam_isp_awb_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_awb_ctrls); +} + +int vvcam_isp_awb_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_awb_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_awb_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp awb ctrl %s failed %d.\n", + vvcam_isp_awb_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4/vvcam_isp_awb.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4/vvcam_isp_awb.h new file mode 100644 index 0000000..1e3ca89 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4/vvcam_isp_awb.h @@ -0,0 +1,105 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_AWB_H__ +#define __VVCAM_ISP_AWB_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_AWB_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x0000) +#define VVCAM_ISP_CID_AWB_STATE (VVCAM_ISP_CID_AWB_BASE + 0x0001) +#define VVCAM_ISP_CID_AWB_MODE (VVCAM_ISP_CID_AWB_BASE + 0x0002) +#define VVCAM_ISP_CID_AWB_USE_CC_OFFSET (VVCAM_ISP_CID_AWB_BASE + 0x0003) +#define VVCAM_ISP_CID_AWB_USE_CC_MATRIX (VVCAM_ISP_CID_AWB_BASE + 0x0004) +#define VVCAM_ISP_CID_AWB_USE_DAMPING (VVCAM_ISP_CID_AWB_BASE + 0x0005) +#define VVCAM_ISP_CID_AWB_ROI_WEIGHT (VVCAM_ISP_CID_AWB_BASE + 0x0006) +#define VVCAM_ISP_CID_AWB_ROI (VVCAM_ISP_CID_AWB_BASE + 0x0007) +#define VVCAM_ISP_CID_AWB_COLOR_TEMP_WEIGHT (VVCAM_ISP_CID_AWB_BASE + 0x0008) +#define VVCAM_ISP_CID_AWB_CONFIDENCE_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0009) +#define VVCAM_ISP_CID_AWB_TEMP_PREFER_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x000A) +#define VVCAM_ISP_CID_AWB_TEMP_PREFER_A (VVCAM_ISP_CID_AWB_BASE + 0x000B) +#define VVCAM_ISP_CID_AWB_TEMP_PREFER_CWF (VVCAM_ISP_CID_AWB_BASE + 0x000C) +#define VVCAM_ISP_CID_AWB_TEMP_PREFER_D65 (VVCAM_ISP_CID_AWB_BASE + 0x000D) +#define VVCAM_ISP_CID_AWB_CONFOUND_CWF_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x000E) +#define VVCAM_ISP_CID_AWB_CONFOUND_CWF_RG (VVCAM_ISP_CID_AWB_BASE + 0x000F) +#define VVCAM_ISP_CID_AWB_CONFOUND_CWF_BG (VVCAM_ISP_CID_AWB_BASE + 0x0010) +#define VVCAM_ISP_CID_AWB_CONFOUND_CWF_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0011) +#define VVCAM_ISP_CID_AWB_CONFOUND_TL84_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x0012) +#define VVCAM_ISP_CID_AWB_CONFOUND_TL84_RG (VVCAM_ISP_CID_AWB_BASE + 0x0013) +#define VVCAM_ISP_CID_AWB_CONFOUND_TL84_BG (VVCAM_ISP_CID_AWB_BASE + 0x0014) +#define VVCAM_ISP_CID_AWB_CONFOUND_TL84_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0015) +#define VVCAM_ISP_CID_AWB_CONFOUND_D65_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x0016) +#define VVCAM_ISP_CID_AWB_CONFOUND_D65_RG (VVCAM_ISP_CID_AWB_BASE + 0x0017) +#define VVCAM_ISP_CID_AWB_CONFOUND_D65_BG (VVCAM_ISP_CID_AWB_BASE + 0x0018) +#define VVCAM_ISP_CID_AWB_CONFOUND_D65_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0019) +#define VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x001A) +#define VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_BRIGHT (VVCAM_ISP_CID_AWB_BASE + 0x001B) +#define VVCAM_ISP_CID_AWB_LIGHT_WEIGHT (VVCAM_ISP_CID_AWB_BASE + 0x001C) +#define VVCAM_ISP_CID_AWB_GRAY_PREFER_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x001D) +#define VVCAM_ISP_CID_AWB_GRAY_PREFER_BRIGHT (VVCAM_ISP_CID_AWB_BASE + 0x001E) +#define VVCAM_ISP_CID_AWB_GRAY_PREFER_R (VVCAM_ISP_CID_AWB_BASE + 0x001F) +#define VVCAM_ISP_CID_AWB_GRAY_PREFER_B (VVCAM_ISP_CID_AWB_BASE + 0x0020) +#define VVCAM_ISP_CID_AWB_USE_MANU_DAMP_COEFF (VVCAM_ISP_CID_AWB_BASE + 0x0021) +#define VVCAM_ISP_CID_AWB_MANU_DAMP_COEFF (VVCAM_ISP_CID_AWB_BASE + 0x0022) +#define VVCAM_ISP_CID_AWB_PERFORMANCE_OPTI_MODE (VVCAM_ISP_CID_AWB_BASE + 0x0023) +#define VVCAM_ISP_CID_AWB_LOCK_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0024) +#define VVCAM_ISP_CID_AWB_UNLOCK_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0025) + +#ifdef __KERNEL__ +int vvcam_isp_awb_ctrl_count(void); +int vvcam_isp_awb_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4_1/vvcam_isp_awb.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4_1/vvcam_isp_awb.c new file mode 100644 index 0000000..fce3b58 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4_1/vvcam_isp_awb.c @@ -0,0 +1,698 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_awb.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_awb_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AWB_ENABLE: + case VVCAM_ISP_CID_AWB_STATE: + case VVCAM_ISP_CID_AWB_MODE: + case VVCAM_ISP_CID_AWB_USE_CC_OFFSET: + case VVCAM_ISP_CID_AWB_USE_CC_MATRIX: + case VVCAM_ISP_CID_AWB_USE_DAMPING: + case VVCAM_ISP_CID_AWB_ROI_WEIGHT: + case VVCAM_ISP_CID_AWB_ROI: + case VVCAM_ISP_CID_AWB_CONFIDENCE_THRESH: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_ENABLE: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_A: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_CWF: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_D65: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_THRESH: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_THRESH: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_THRESH: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_ENABLE: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_BRIGHT: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_ENABLE: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_BRIGHT: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_R: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_B: + case VVCAM_ISP_CID_AWB_FRONT_GROUND_FACE_ENABLE: + case VVCAM_ISP_CID_AWB_FRONT_GROUND_ROI_NUM: + case VVCAM_ISP_CID_AWB_FRONT_GROUND_FACE_WEIGHT: + case VVCAM_ISP_CID_AWB_FRONT_GROUND_RG: + case VVCAM_ISP_CID_AWB_FRONT_GROUND_BG: + case VVCAM_ISP_CID_AWB_USE_MANU_DAMP_COEFF: + case VVCAM_ISP_CID_AWB_MANU_DAMP_COEFF: + case VVCAM_ISP_CID_AWB_PERFORMANCE_OPTI_MODE: + case VVCAM_ISP_CID_AWB_LOCK_THRESH: + case VVCAM_ISP_CID_AWB_UNLOCK_THRESH: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_awb_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_AWB_ENABLE: + case VVCAM_ISP_CID_AWB_STATE: + case VVCAM_ISP_CID_AWB_MODE: + case VVCAM_ISP_CID_AWB_USE_CC_OFFSET: + case VVCAM_ISP_CID_AWB_USE_CC_MATRIX: + case VVCAM_ISP_CID_AWB_USE_DAMPING: + case VVCAM_ISP_CID_AWB_ROI_WEIGHT: + case VVCAM_ISP_CID_AWB_ROI: + case VVCAM_ISP_CID_AWB_COLOR_TEMP_WEIGHT: + case VVCAM_ISP_CID_AWB_CONFIDENCE_THRESH: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_ENABLE: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_A: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_CWF: + case VVCAM_ISP_CID_AWB_TEMP_PREFER_D65: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_CWF_THRESH: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_TL84_THRESH: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_ENABLE: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_RG: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_BG: + case VVCAM_ISP_CID_AWB_CONFOUND_D65_THRESH: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_ENABLE: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_BRIGHT: + case VVCAM_ISP_CID_AWB_LIGHT_WEIGHT: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_ENABLE: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_BRIGHT: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_R: + case VVCAM_ISP_CID_AWB_GRAY_PREFER_B: + case VVCAM_ISP_CID_AWB_FRONT_GROUND_FACE_ENABLE: + case VVCAM_ISP_CID_AWB_FRONT_GROUND_ROI_NUM: + case VVCAM_ISP_CID_AWB_FRONT_GROUND_FACE_WEIGHT: + case VVCAM_ISP_CID_AWB_FRONT_GROUND_RG: + case VVCAM_ISP_CID_AWB_FRONT_GROUND_BG: + case VVCAM_ISP_CID_AWB_USE_MANU_DAMP_COEFF: + case VVCAM_ISP_CID_AWB_MANU_DAMP_COEFF: + case VVCAM_ISP_CID_AWB_PERFORMANCE_OPTI_MODE: + case VVCAM_ISP_CID_AWB_LOCK_THRESH: + case VVCAM_ISP_CID_AWB_UNLOCK_THRESH: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_awb_ctrl_ops = { + .s_ctrl = vvcam_isp_awb_s_ctrl, + .g_volatile_ctrl = vvcam_isp_awb_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_awb_ctrls[] = { + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_STATE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_state", + .step = 1, + .min = 0, + .max = 4, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_USE_CC_OFFSET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_use_cc_offset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_USE_CC_MATRIX, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_use_cc_matrix", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_USE_DAMPING, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_use_damping", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float array 25x32bit 0~1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_ROI_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_roi_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {25}, + }, + { + /* int array 25x4*16bit */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_ROI, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_roi", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {25, 4, 0, 0}, + }, + { + /* float array 7x32bit [0, 1] */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_COLOR_TEMP_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_color_temp_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {7}, + }, + { + /* float array 10x32bit [0, 3] */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFIDENCE_THRESH, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confidence_thresh", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {10}, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_TEMP_PREFER_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_temp_prefer_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_TEMP_PREFER_A, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_temp_prefer_a", + .step = 1, + .min = 1, + .max = 511, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_TEMP_PREFER_CWF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_temp_prefer_cwf", + .step = 1, + .min = 1, + .max = 511, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_TEMP_PREFER_D65, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_temp_prefer_d65", + .step = 1, + .min = 1, + .max = 511, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_CWF_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_cwf_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_CWF_RG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_cwf_rg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_CWF_BG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_cwf_bg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,3) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_CWF_THRESH, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_cwf_thresh", + .step = 1, + .min = 1, + .max = 29999, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_TL84_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_tl84_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_TL84_RG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_tl84_rg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_TL84_BG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_tl84_bg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,3) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_TL84_THRESH, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_tl84_thresh", + .step = 1, + .min = 1, + .max = 29999, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_D65_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_d65_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_D65_RG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_d65_rg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_D65_BG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_d65_bg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0,3) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_CONFOUND_D65_THRESH, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_confound_d65_thresh", + .step = 1, + .min = 1, + .max = 29999, + .def = 1, + }, + { + /* bool array 10x32bit */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_ENABLE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_light_weight_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {10}, + }, + { + /* float array 10x18x32bit [0, 17] */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_BRIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_light_weight_bright", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {10, 18, 0, 0}, + }, + { + /* float array 10x18x32bit [0, 1] */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_LIGHT_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_light_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {10, 18, 0, 0}, + }, + { + /* bool array 10x32bit */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_GRAY_PREFER_ENABLE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_gray_prefer_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {10}, + }, + { + /* float array 10x18x32bit [0, 17] */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_GRAY_PREFER_BRIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_gray_prefer_bright", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {10, 18, 0, 0}, + }, + { + /* uint16_t array 10x18x16bit (0, 512) */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_GRAY_PREFER_R, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_gray_prefer_r", + .step = 1, + .min = 1, + .max = 511, + .def = 1, + .dims = {10, 18, 0, 0}, + }, + { + /* uint16_t array 10x18x16bit (0, 512) */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_GRAY_PREFER_B, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_gray_prefer_b", + .step = 1, + .min = 1, + .max = 511, + .def = 1, + .dims = {10, 18, 0, 0}, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_FRONT_GROUND_FACE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_front_face_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_FRONT_GROUND_ROI_NUM, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_front_roi_num", + .step = 1, + .min = 0, + .max = 25, + }, + { + /* float [0, 1] ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_FRONT_GROUND_FACE_WEIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_front_face_weight", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float (0, 4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_FRONT_GROUND_RG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_front_rg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + /* float (0, 4) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_FRONT_GROUND_BG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_front_bg", + .step = 1, + .min = 1, + .max = 39999, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_USE_MANU_DAMP_COEFF, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_use_manu_damp_coeff", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float (0, 1) ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_MANU_DAMP_COEFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_manu_damp_coeff", + .step = 1, + .min = 1, + .max = 9999, + .def = 1, + }, + { + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_PERFORMANCE_OPTI_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_performance_opti_mode", + .step = 1, + .min = 0, + .max = 2, + }, + { + /* float [0, 0.2] ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_LOCK_THRESH, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_lock_thresh", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* float [0, 0.2] ratio 10000:1 */ + .ops = &vvcam_isp_awb_ctrl_ops, + .id = VVCAM_ISP_CID_AWB_UNLOCK_THRESH, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_awb_unlock_thresh", + .step = 1, + .min = 0, + .max = 2000, + }, +}; + +int vvcam_isp_awb_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_awb_ctrls); +} + +int vvcam_isp_awb_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_awb_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_awb_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp awb ctrl %s failed %d.\n", + vvcam_isp_awb_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4_1/vvcam_isp_awb.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4_1/vvcam_isp_awb.h new file mode 100644 index 0000000..441a573 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/awb/awb_v4_1/vvcam_isp_awb.h @@ -0,0 +1,110 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_AWB_H__ +#define __VVCAM_ISP_AWB_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_AWB_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x0000) +#define VVCAM_ISP_CID_AWB_STATE (VVCAM_ISP_CID_AWB_BASE + 0x0001) +#define VVCAM_ISP_CID_AWB_MODE (VVCAM_ISP_CID_AWB_BASE + 0x0002) +#define VVCAM_ISP_CID_AWB_USE_CC_OFFSET (VVCAM_ISP_CID_AWB_BASE + 0x0003) +#define VVCAM_ISP_CID_AWB_USE_CC_MATRIX (VVCAM_ISP_CID_AWB_BASE + 0x0004) +#define VVCAM_ISP_CID_AWB_USE_DAMPING (VVCAM_ISP_CID_AWB_BASE + 0x0005) +#define VVCAM_ISP_CID_AWB_ROI_WEIGHT (VVCAM_ISP_CID_AWB_BASE + 0x0006) +#define VVCAM_ISP_CID_AWB_ROI (VVCAM_ISP_CID_AWB_BASE + 0x0007) +#define VVCAM_ISP_CID_AWB_COLOR_TEMP_WEIGHT (VVCAM_ISP_CID_AWB_BASE + 0x0008) +#define VVCAM_ISP_CID_AWB_CONFIDENCE_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0009) +#define VVCAM_ISP_CID_AWB_TEMP_PREFER_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x000A) +#define VVCAM_ISP_CID_AWB_TEMP_PREFER_A (VVCAM_ISP_CID_AWB_BASE + 0x000B) +#define VVCAM_ISP_CID_AWB_TEMP_PREFER_CWF (VVCAM_ISP_CID_AWB_BASE + 0x000C) +#define VVCAM_ISP_CID_AWB_TEMP_PREFER_D65 (VVCAM_ISP_CID_AWB_BASE + 0x000D) +#define VVCAM_ISP_CID_AWB_CONFOUND_CWF_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x000E) +#define VVCAM_ISP_CID_AWB_CONFOUND_CWF_RG (VVCAM_ISP_CID_AWB_BASE + 0x000F) +#define VVCAM_ISP_CID_AWB_CONFOUND_CWF_BG (VVCAM_ISP_CID_AWB_BASE + 0x0010) +#define VVCAM_ISP_CID_AWB_CONFOUND_CWF_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0011) +#define VVCAM_ISP_CID_AWB_CONFOUND_TL84_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x0012) +#define VVCAM_ISP_CID_AWB_CONFOUND_TL84_RG (VVCAM_ISP_CID_AWB_BASE + 0x0013) +#define VVCAM_ISP_CID_AWB_CONFOUND_TL84_BG (VVCAM_ISP_CID_AWB_BASE + 0x0014) +#define VVCAM_ISP_CID_AWB_CONFOUND_TL84_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0015) +#define VVCAM_ISP_CID_AWB_CONFOUND_D65_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x0016) +#define VVCAM_ISP_CID_AWB_CONFOUND_D65_RG (VVCAM_ISP_CID_AWB_BASE + 0x0017) +#define VVCAM_ISP_CID_AWB_CONFOUND_D65_BG (VVCAM_ISP_CID_AWB_BASE + 0x0018) +#define VVCAM_ISP_CID_AWB_CONFOUND_D65_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0019) +#define VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x001A) +#define VVCAM_ISP_CID_AWB_LIGHT_WEIGHT_BRIGHT (VVCAM_ISP_CID_AWB_BASE + 0x001B) +#define VVCAM_ISP_CID_AWB_LIGHT_WEIGHT (VVCAM_ISP_CID_AWB_BASE + 0x001C) +#define VVCAM_ISP_CID_AWB_GRAY_PREFER_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x001D) +#define VVCAM_ISP_CID_AWB_GRAY_PREFER_BRIGHT (VVCAM_ISP_CID_AWB_BASE + 0x001E) +#define VVCAM_ISP_CID_AWB_GRAY_PREFER_R (VVCAM_ISP_CID_AWB_BASE + 0x001F) +#define VVCAM_ISP_CID_AWB_GRAY_PREFER_B (VVCAM_ISP_CID_AWB_BASE + 0x0020) +#define VVCAM_ISP_CID_AWB_FRONT_GROUND_FACE_ENABLE (VVCAM_ISP_CID_AWB_BASE + 0x0021) +#define VVCAM_ISP_CID_AWB_FRONT_GROUND_ROI_NUM (VVCAM_ISP_CID_AWB_BASE + 0x0022) +#define VVCAM_ISP_CID_AWB_FRONT_GROUND_FACE_WEIGHT (VVCAM_ISP_CID_AWB_BASE + 0x0023) +#define VVCAM_ISP_CID_AWB_FRONT_GROUND_RG (VVCAM_ISP_CID_AWB_BASE + 0x0024) +#define VVCAM_ISP_CID_AWB_FRONT_GROUND_BG (VVCAM_ISP_CID_AWB_BASE + 0x0025) +#define VVCAM_ISP_CID_AWB_USE_MANU_DAMP_COEFF (VVCAM_ISP_CID_AWB_BASE + 0x0026) +#define VVCAM_ISP_CID_AWB_MANU_DAMP_COEFF (VVCAM_ISP_CID_AWB_BASE + 0x0027) +#define VVCAM_ISP_CID_AWB_PERFORMANCE_OPTI_MODE (VVCAM_ISP_CID_AWB_BASE + 0x0028) +#define VVCAM_ISP_CID_AWB_LOCK_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x0029) +#define VVCAM_ISP_CID_AWB_UNLOCK_THRESH (VVCAM_ISP_CID_AWB_BASE + 0x002A) + +#ifdef __KERNEL__ +int vvcam_isp_awb_ctrl_count(void); +int vvcam_isp_awb_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/bls/bls/vvcam_isp_bls.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/bls/bls/vvcam_isp_bls.c index ad7f8cf..09cf630 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/bls/bls/vvcam_isp_bls.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/bls/bls/vvcam_isp_bls.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -69,7 +71,7 @@ static int vvcam_isp_bls_s_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_BLS_MODE: case VVCAM_ISP_CID_BLS_AUTO_LEVEL: case VVCAM_ISP_CID_BLS_AUTO_GAIN: - case VVCAM_ISP_CID_BLS_AUTO_VALUES: + case VVCAM_ISP_CID_BLS_AUTO_TABLE: case VVCAM_ISP_CID_BLS_MANU_R_VALUE: case VVCAM_ISP_CID_BLS_MANU_GR_VALUE: case VVCAM_ISP_CID_BLS_MANU_GB_VALUE: @@ -97,11 +99,15 @@ static int vvcam_isp_bls_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_BLS_MODE: case VVCAM_ISP_CID_BLS_AUTO_LEVEL: case VVCAM_ISP_CID_BLS_AUTO_GAIN: - case VVCAM_ISP_CID_BLS_AUTO_VALUES: + case VVCAM_ISP_CID_BLS_AUTO_TABLE: case VVCAM_ISP_CID_BLS_MANU_R_VALUE: case VVCAM_ISP_CID_BLS_MANU_GR_VALUE: case VVCAM_ISP_CID_BLS_MANU_GB_VALUE: case VVCAM_ISP_CID_BLS_MANU_B_VALUE: + case VVCAM_ISP_CID_BLS_STAT_R_VALUE: + case VVCAM_ISP_CID_BLS_STAT_GR_VALUE: + case VVCAM_ISP_CID_BLS_STAT_GB_VALUE: + case VVCAM_ISP_CID_BLS_STAT_B_VALUE: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -165,10 +171,10 @@ const struct v4l2_ctrl_config vvcam_isp_bls_ctrls[] = { }, { .ops = &vvcam_isp_bls_ctrl_ops, - .id = VVCAM_ISP_CID_BLS_AUTO_VALUES, + .id = VVCAM_ISP_CID_BLS_AUTO_TABLE, .type = V4L2_CTRL_TYPE_U32, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_bls_auto_values", + .name = "isp_bls_auto_table", .step = 1, .min = 0, .max = 4095, @@ -218,6 +224,50 @@ const struct v4l2_ctrl_config vvcam_isp_bls_ctrls[] = { .max = 4095, .dims = {1}, }, + { + .ops = &vvcam_isp_bls_ctrl_ops, + .id = VVCAM_ISP_CID_BLS_STAT_R_VALUE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_bls_stat_r_value", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1}, + }, + { + .ops = &vvcam_isp_bls_ctrl_ops, + .id = VVCAM_ISP_CID_BLS_STAT_GR_VALUE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_bls_stat_gr_value", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1}, + }, + { + .ops = &vvcam_isp_bls_ctrl_ops, + .id = VVCAM_ISP_CID_BLS_STAT_GB_VALUE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_bls_stat_gb_value", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1}, + }, + { + .ops = &vvcam_isp_bls_ctrl_ops, + .id = VVCAM_ISP_CID_BLS_STAT_B_VALUE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_bls_stat_b_value", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1}, + }, }; int vvcam_isp_bls_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/bls/bls/vvcam_isp_bls.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/bls/bls/vvcam_isp_bls.h index b52d80e..b5c7880 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/bls/bls/vvcam_isp_bls.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/bls/bls/vvcam_isp_bls.h @@ -1,70 +1,80 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_BLS_H__ #define __VVCAM_ISP_BLS_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_BLS_RESET (VVCAM_ISP_CID_BLS_BASE + 0x0000) #define VVCAM_ISP_CID_BLS_MODE (VVCAM_ISP_CID_BLS_BASE + 0x0001) #define VVCAM_ISP_CID_BLS_AUTO_LEVEL (VVCAM_ISP_CID_BLS_BASE + 0x0002) #define VVCAM_ISP_CID_BLS_AUTO_GAIN (VVCAM_ISP_CID_BLS_BASE + 0x0003) -#define VVCAM_ISP_CID_BLS_AUTO_VALUES (VVCAM_ISP_CID_BLS_BASE + 0x0004) +#define VVCAM_ISP_CID_BLS_AUTO_TABLE (VVCAM_ISP_CID_BLS_BASE + 0x0004) #define VVCAM_ISP_CID_BLS_MANU_R_VALUE (VVCAM_ISP_CID_BLS_BASE + 0x0005) #define VVCAM_ISP_CID_BLS_MANU_GR_VALUE (VVCAM_ISP_CID_BLS_BASE + 0x0006) #define VVCAM_ISP_CID_BLS_MANU_GB_VALUE (VVCAM_ISP_CID_BLS_BASE + 0x0007) #define VVCAM_ISP_CID_BLS_MANU_B_VALUE (VVCAM_ISP_CID_BLS_BASE + 0x0008) +#define VVCAM_ISP_CID_BLS_STAT_R_VALUE (VVCAM_ISP_CID_BLS_BASE + 0x0009) +#define VVCAM_ISP_CID_BLS_STAT_GR_VALUE (VVCAM_ISP_CID_BLS_BASE + 0x000A) +#define VVCAM_ISP_CID_BLS_STAT_GB_VALUE (VVCAM_ISP_CID_BLS_BASE + 0x000B) +#define VVCAM_ISP_CID_BLS_STAT_B_VALUE (VVCAM_ISP_CID_BLS_BASE + 0x000C) +#ifdef __KERNEL__ int vvcam_isp_bls_ctrl_count(void); int vvcam_isp_bls_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ccm/ccm/vvcam_isp_ccm.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ccm/ccm/vvcam_isp_ccm.c index bf79ff0..1e1c9f2 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ccm/ccm/vvcam_isp_ccm.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ccm/ccm/vvcam_isp_ccm.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -92,6 +94,8 @@ static int vvcam_isp_ccm_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_CCM_RESET: case VVCAM_ISP_CID_CCM_MATRIX: case VVCAM_ISP_CID_CCM_OFFSET: + case VVCAM_ISP_CID_CCM_STAT_MATRIX: + case VVCAM_ISP_CID_CCM_STAT_OFFSET: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -130,7 +134,6 @@ const struct v4l2_ctrl_config vvcam_isp_ccm_ctrls[] = { .max = 1, }, { - /* float 3x3 array -16~15.992 */ .ops = &vvcam_isp_ccm_ctrl_ops, .id = VVCAM_ISP_CID_CCM_MATRIX, .type = V4L2_CTRL_TYPE_U32, @@ -142,7 +145,7 @@ const struct v4l2_ctrl_config vvcam_isp_ccm_ctrls[] = { .dims = {3, 3, 0, 0}, }, { - /* float 3x array -4095~4095 */ + /* float 3x array -2047~2047 */ .ops = &vvcam_isp_ccm_ctrl_ops, .id = VVCAM_ISP_CID_CCM_OFFSET, .type = V4L2_CTRL_TYPE_U32, @@ -153,6 +156,29 @@ const struct v4l2_ctrl_config vvcam_isp_ccm_ctrls[] = { .max = 0xFFFFFFFF, .dims = {3}, }, + { + .ops = &vvcam_isp_ccm_ctrl_ops, + .id = VVCAM_ISP_CID_CCM_STAT_MATRIX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ccm_stat_matrix", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 3, 0, 0}, + }, + { + /* float 3x array -2047~2047 */ + .ops = &vvcam_isp_ccm_ctrl_ops, + .id = VVCAM_ISP_CID_CCM_STAT_OFFSET, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ccm_stat_offset", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3}, + }, }; int vvcam_isp_ccm_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ccm/ccm/vvcam_isp_ccm.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ccm/ccm/vvcam_isp_ccm.h index 98acbe3..b4bd608 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ccm/ccm/vvcam_isp_ccm.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ccm/ccm/vvcam_isp_ccm.h @@ -1,65 +1,73 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_CCM_H__ #define __VVCAM_ISP_CCM_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_CCM_ENABLE (VVCAM_ISP_CID_CCM_BASE + 0x0000) #define VVCAM_ISP_CID_CCM_RESET (VVCAM_ISP_CID_CCM_BASE + 0x0001) #define VVCAM_ISP_CID_CCM_MATRIX (VVCAM_ISP_CID_CCM_BASE + 0x0002) #define VVCAM_ISP_CID_CCM_OFFSET (VVCAM_ISP_CID_CCM_BASE + 0x0003) +#define VVCAM_ISP_CID_CCM_STAT_MATRIX (VVCAM_ISP_CID_CCM_BASE + 0x0004) +#define VVCAM_ISP_CID_CCM_STAT_OFFSET (VVCAM_ISP_CID_CCM_BASE + 0x0005) +#ifdef __KERNEL__ int vvcam_isp_ccm_ctrl_count(void); int vvcam_isp_ccm_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif #endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v1/vvcam_isp_cnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v1/vvcam_isp_cnr.c index 48df079..48c8755 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v1/vvcam_isp_cnr.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v1/vvcam_isp_cnr.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -94,6 +96,9 @@ static int vvcam_isp_cnr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_CNR_MANU_LINE_WIDTH: case VVCAM_ISP_CID_CNR_MANU_THRESHOLD1: case VVCAM_ISP_CID_CNR_MANU_THRESHOLD2: + case VVCAM_ISP_CID_CNR_STAT_LINE_WIDTH: + case VVCAM_ISP_CID_CNR_STAT_THRESHOLD1: + case VVCAM_ISP_CID_CNR_STAT_THRESHOLD2: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -161,9 +166,42 @@ const struct v4l2_ctrl_config vvcam_isp_cnr_ctrls[] = { .name = "isp_cnr_manu_threshold2", .step = 1, .min = 0, + .max = 16383, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_STAT_LINE_WIDTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_stat_line_width", + .step = 1, + .min = 0, + .max = 16383, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_STAT_THRESHOLD1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_stat_threshold1", + .step = 1, + .min = 0, .max = 32767, .dims = {1, 0, 0, 0}, }, + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_STAT_THRESHOLD2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_stat_threshold2", + .step = 1, + .min = 0, + .max = 16383, + .dims = {1, 0, 0, 0}, + }, }; int vvcam_isp_cnr_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v1/vvcam_isp_cnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v1/vvcam_isp_cnr.h index 9f825df..e8804d7 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v1/vvcam_isp_cnr.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v1/vvcam_isp_cnr.h @@ -1,66 +1,75 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_CNR_H__ #define __VVCAM_ISP_CNR_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_CNR_ENABLE (VVCAM_ISP_CID_CNR_BASE + 0x0000) #define VVCAM_ISP_CID_CNR_RESET (VVCAM_ISP_CID_CNR_BASE + 0x0001) #define VVCAM_ISP_CID_CNR_MANU_LINE_WIDTH (VVCAM_ISP_CID_CNR_BASE + 0x0002) #define VVCAM_ISP_CID_CNR_MANU_THRESHOLD1 (VVCAM_ISP_CID_CNR_BASE + 0x0003) #define VVCAM_ISP_CID_CNR_MANU_THRESHOLD2 (VVCAM_ISP_CID_CNR_BASE + 0x0004) +#define VVCAM_ISP_CID_CNR_STAT_LINE_WIDTH (VVCAM_ISP_CID_CNR_BASE + 0x0005) +#define VVCAM_ISP_CID_CNR_STAT_THRESHOLD1 (VVCAM_ISP_CID_CNR_BASE + 0x0006) +#define VVCAM_ISP_CID_CNR_STAT_THRESHOLD2 (VVCAM_ISP_CID_CNR_BASE + 0x0007) +#ifdef __KERNEL__ int vvcam_isp_cnr_ctrl_count(void); int vvcam_isp_cnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif #endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_1/vvcam_isp_cnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_1/vvcam_isp_cnr.c new file mode 100644 index 0000000..4391332 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_1/vvcam_isp_cnr.c @@ -0,0 +1,412 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_cnr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_cnr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_CNR_ENABLE: + case VVCAM_ISP_CID_CNR_RESET: + case VVCAM_ISP_CID_CNR_MODE: + case VVCAM_ISP_CID_CNR_AUTO_LEVEL: + case VVCAM_ISP_CID_CNR_AUTO_GAIN: + case VVCAM_ISP_CID_CNR_AUTO_ENABLE_TBL: + case VVCAM_ISP_CID_CNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_CNR_AUTO_STRENGTH2: + case VVCAM_ISP_CID_CNR_AUTO_TEXTURE_MASK: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER0: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER1: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER2: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER3: + case VVCAM_ISP_CID_CNR_MANU_SIGMA_LAYER: + case VVCAM_ISP_CID_CNR_MANU_STRENGTH: + case VVCAM_ISP_CID_CNR_MANU_STRENGTH2: + case VVCAM_ISP_CID_CNR_MANU_TEXTURE_MASK: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_cnr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_CNR_ENABLE: + case VVCAM_ISP_CID_CNR_RESET: + case VVCAM_ISP_CID_CNR_MODE: + case VVCAM_ISP_CID_CNR_AUTO_LEVEL: + case VVCAM_ISP_CID_CNR_AUTO_GAIN: + case VVCAM_ISP_CID_CNR_AUTO_ENABLE_TBL: + case VVCAM_ISP_CID_CNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_CNR_AUTO_STRENGTH2: + case VVCAM_ISP_CID_CNR_AUTO_TEXTURE_MASK: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER0: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER1: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER2: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER3: + case VVCAM_ISP_CID_CNR_MANU_SIGMA_LAYER: + case VVCAM_ISP_CID_CNR_MANU_STRENGTH: + case VVCAM_ISP_CID_CNR_MANU_STRENGTH2: + case VVCAM_ISP_CID_CNR_MANU_TEXTURE_MASK: + case VVCAM_ISP_CID_CNR_STAT_SIGMA_LAYER: + case VVCAM_ISP_CID_CNR_STAT_STRENGTH: + case VVCAM_ISP_CID_CNR_STAT_STRENGTH2: + case VVCAM_ISP_CID_CNR_STAT_TEXTURE_MASK: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_cnr_ctrl_ops = { + .s_ctrl = vvcam_isp_cnr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_cnr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_cnr_ctrls[] = { + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t 20x array */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_ENABLE_TBL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_enable_tbl", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_STRENGTH2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_strength2", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_TEXTURE_MASK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_texture_mask", + .step = 1, + .min = 0, + .max = 8, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array 1.0 ~ 48.0 */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER0, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_sigma_layer0", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array 1.0 ~ 48.0 */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER1, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_sigma_layer1", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array 1.0 ~ 48.0 */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER2, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_sigma_layer2", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array 1.0 ~ 48.0 */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER3, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_sigma_layer3", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 4x array 1.0 ~ 48.0*/ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_MANU_SIGMA_LAYER, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_manu_sigma_layer", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_MANU_STRENGTH2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_manu_strength2", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_MANU_TEXTURE_MASK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_manu_texture_mask", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + /* float 4x array 1.0 ~ 48.0*/ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_STAT_SIGMA_LAYER, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_stat_sigma_layer", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_STAT_STRENGTH2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_stat_strength2", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_STAT_TEXTURE_MASK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_stat_texture_mask", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_cnr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_cnr_ctrls); +} + +int vvcam_isp_cnr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_cnr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_cnr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp cnr ctrl %s failed %d.\n", + vvcam_isp_cnr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_1/vvcam_isp_cnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_1/vvcam_isp_cnr.h new file mode 100644 index 0000000..d6ede46 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_1/vvcam_isp_cnr.h @@ -0,0 +1,89 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_CNR_H__ +#define __VVCAM_ISP_CNR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_CNR_ENABLE (VVCAM_ISP_CID_CNR_BASE + 0x0000) +#define VVCAM_ISP_CID_CNR_RESET (VVCAM_ISP_CID_CNR_BASE + 0x0001) +#define VVCAM_ISP_CID_CNR_MODE (VVCAM_ISP_CID_CNR_BASE + 0x0002) +#define VVCAM_ISP_CID_CNR_AUTO_LEVEL (VVCAM_ISP_CID_CNR_BASE + 0x0003) +#define VVCAM_ISP_CID_CNR_AUTO_GAIN (VVCAM_ISP_CID_CNR_BASE + 0x0004) +#define VVCAM_ISP_CID_CNR_AUTO_ENABLE_TBL (VVCAM_ISP_CID_CNR_BASE + 0x0005) +#define VVCAM_ISP_CID_CNR_AUTO_STRENGTH (VVCAM_ISP_CID_CNR_BASE + 0x0006) +#define VVCAM_ISP_CID_CNR_AUTO_STRENGTH2 (VVCAM_ISP_CID_CNR_BASE + 0x0007) +#define VVCAM_ISP_CID_CNR_AUTO_TEXTURE_MASK (VVCAM_ISP_CID_CNR_BASE + 0x0008) +#define VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER0 (VVCAM_ISP_CID_CNR_BASE + 0x0009) +#define VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER1 (VVCAM_ISP_CID_CNR_BASE + 0x000A) +#define VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER2 (VVCAM_ISP_CID_CNR_BASE + 0x000B) +#define VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER3 (VVCAM_ISP_CID_CNR_BASE + 0x000C) +#define VVCAM_ISP_CID_CNR_MANU_SIGMA_LAYER (VVCAM_ISP_CID_CNR_BASE + 0x000D) +#define VVCAM_ISP_CID_CNR_MANU_STRENGTH (VVCAM_ISP_CID_CNR_BASE + 0x000E) +#define VVCAM_ISP_CID_CNR_MANU_STRENGTH2 (VVCAM_ISP_CID_CNR_BASE + 0x000F) +#define VVCAM_ISP_CID_CNR_MANU_TEXTURE_MASK (VVCAM_ISP_CID_CNR_BASE + 0x0010) +#define VVCAM_ISP_CID_CNR_STAT_SIGMA_LAYER (VVCAM_ISP_CID_CNR_BASE + 0x0011) +#define VVCAM_ISP_CID_CNR_STAT_STRENGTH (VVCAM_ISP_CID_CNR_BASE + 0x0012) +#define VVCAM_ISP_CID_CNR_STAT_STRENGTH2 (VVCAM_ISP_CID_CNR_BASE + 0x0013) +#define VVCAM_ISP_CID_CNR_STAT_TEXTURE_MASK (VVCAM_ISP_CID_CNR_BASE + 0x0014) + + +#ifdef __KERNEL__ +int vvcam_isp_cnr_ctrl_count(void); +int vvcam_isp_cnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_2/vvcam_isp_cnr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_2/vvcam_isp_cnr.c new file mode 100644 index 0000000..f343d0c --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_2/vvcam_isp_cnr.c @@ -0,0 +1,357 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_cnr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_cnr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_CNR_ENABLE: + case VVCAM_ISP_CID_CNR_RESET: + case VVCAM_ISP_CID_CNR_MODE: + case VVCAM_ISP_CID_CNR_AUTO_LEVEL: + case VVCAM_ISP_CID_CNR_AUTO_GAIN: + case VVCAM_ISP_CID_CNR_AUTO_ENABLE_TBL: + case VVCAM_ISP_CID_CNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_CNR_AUTO_TEXTURE_MASK: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER0: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER1: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER2: + case VVCAM_ISP_CID_CNR_MANU_SIGMA_LAYER: + case VVCAM_ISP_CID_CNR_MANU_STRENGTH: + case VVCAM_ISP_CID_CNR_MANU_TEXTURE_MASK: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_cnr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_CNR_ENABLE: + case VVCAM_ISP_CID_CNR_RESET: + case VVCAM_ISP_CID_CNR_MODE: + case VVCAM_ISP_CID_CNR_AUTO_LEVEL: + case VVCAM_ISP_CID_CNR_AUTO_GAIN: + case VVCAM_ISP_CID_CNR_AUTO_ENABLE_TBL: + case VVCAM_ISP_CID_CNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_CNR_AUTO_TEXTURE_MASK: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER0: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER1: + case VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER2: + case VVCAM_ISP_CID_CNR_MANU_SIGMA_LAYER: + case VVCAM_ISP_CID_CNR_MANU_STRENGTH: + case VVCAM_ISP_CID_CNR_MANU_TEXTURE_MASK: + case VVCAM_ISP_CID_CNR_STAT_SIGMA_LAYER: + case VVCAM_ISP_CID_CNR_STAT_STRENGTH: + case VVCAM_ISP_CID_CNR_STAT_TEXTURE_MASK: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_cnr_ctrl_ops = { + .s_ctrl = vvcam_isp_cnr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_cnr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_cnr_ctrls[] = { + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint32_t 20x array */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_ENABLE_TBL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_enable_tbl", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_TEXTURE_MASK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_texture_mask", + .step = 1, + .min = 0, + .max = 8, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array 1.0 ~ 96.0 */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER0, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_sigma_layer0", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array 1.0 ~ 96.0 */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER1, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_sigma_layer1", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array 1.0 ~ 96.0 */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER2, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_auto_sigma_layer2", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 3x array 1.0 ~ 96.0 */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_MANU_SIGMA_LAYER, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_manu_sigma_layer", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_MANU_TEXTURE_MASK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_manu_texture_mask", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + /* float 3x array 1.0 ~ 96.0*/ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_STAT_SIGMA_LAYER, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_stat_sigma_layer", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_cnr_ctrl_ops, + .id = VVCAM_ISP_CID_CNR_STAT_TEXTURE_MASK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cnr_stat_texture_mask", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_cnr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_cnr_ctrls); +} + +int vvcam_isp_cnr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_cnr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_cnr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp cnr ctrl %s failed %d.\n", + vvcam_isp_cnr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_2/vvcam_isp_cnr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_2/vvcam_isp_cnr.h new file mode 100644 index 0000000..61736c3 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cnr/cnr_v2_2/vvcam_isp_cnr.h @@ -0,0 +1,84 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_CNR_H__ +#define __VVCAM_ISP_CNR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_CNR_ENABLE (VVCAM_ISP_CID_CNR_BASE + 0x0000) +#define VVCAM_ISP_CID_CNR_RESET (VVCAM_ISP_CID_CNR_BASE + 0x0001) +#define VVCAM_ISP_CID_CNR_MODE (VVCAM_ISP_CID_CNR_BASE + 0x0002) +#define VVCAM_ISP_CID_CNR_AUTO_LEVEL (VVCAM_ISP_CID_CNR_BASE + 0x0003) +#define VVCAM_ISP_CID_CNR_AUTO_GAIN (VVCAM_ISP_CID_CNR_BASE + 0x0004) +#define VVCAM_ISP_CID_CNR_AUTO_ENABLE_TBL (VVCAM_ISP_CID_CNR_BASE + 0x0005) +#define VVCAM_ISP_CID_CNR_AUTO_STRENGTH (VVCAM_ISP_CID_CNR_BASE + 0x0006) +#define VVCAM_ISP_CID_CNR_AUTO_TEXTURE_MASK (VVCAM_ISP_CID_CNR_BASE + 0x0007) +#define VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER0 (VVCAM_ISP_CID_CNR_BASE + 0x0008) +#define VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER1 (VVCAM_ISP_CID_CNR_BASE + 0x0009) +#define VVCAM_ISP_CID_CNR_AUTO_SIGMA_LAYER2 (VVCAM_ISP_CID_CNR_BASE + 0x000A) +#define VVCAM_ISP_CID_CNR_MANU_SIGMA_LAYER (VVCAM_ISP_CID_CNR_BASE + 0x000B) +#define VVCAM_ISP_CID_CNR_MANU_STRENGTH (VVCAM_ISP_CID_CNR_BASE + 0x000C) +#define VVCAM_ISP_CID_CNR_MANU_TEXTURE_MASK (VVCAM_ISP_CID_CNR_BASE + 0x000D) +#define VVCAM_ISP_CID_CNR_STAT_SIGMA_LAYER (VVCAM_ISP_CID_CNR_BASE + 0x000E) +#define VVCAM_ISP_CID_CNR_STAT_STRENGTH (VVCAM_ISP_CID_CNR_BASE + 0x000F) +#define VVCAM_ISP_CID_CNR_STAT_TEXTURE_MASK (VVCAM_ISP_CID_CNR_BASE + 0x0010) + +#ifdef __KERNEL__ +int vvcam_isp_cnr_ctrl_count(void); +int vvcam_isp_cnr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1/vvcam_isp_cpd.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1/vvcam_isp_cpd.c new file mode 100644 index 0000000..56bd7ac --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1/vvcam_isp_cpd.c @@ -0,0 +1,225 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_cpd.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_cpd_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_CPD_ENABLE: + case VVCAM_ISP_CID_CPD_RESET: + case VVCAM_ISP_CID_CPD_CURVE_X: + case VVCAM_ISP_CID_CPD_CURVE_Y: + case VVCAM_ISP_CID_CPD_USE_OUT_Y_CURVE: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_cpd_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_CPD_ENABLE: + case VVCAM_ISP_CID_CPD_RESET: + case VVCAM_ISP_CID_CPD_CURVE_X: + case VVCAM_ISP_CID_CPD_CURVE_Y: + case VVCAM_ISP_CID_CPD_USE_OUT_Y_CURVE: + case VVCAM_ISP_CID_CPD_STAT_CURVE_X: + case VVCAM_ISP_CID_CPD_STAT_CURVE_Y: + case VVCAM_ISP_CID_CPD_STAT_USE_OUT_Y_CURVE: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_cpd_ctrl_ops = { + .s_ctrl = vvcam_isp_cpd_s_ctrl, + .g_volatile_ctrl = vvcam_isp_cpd_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_cpd_ctrls[] = { + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_CURVE_X, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_curve_x", + .step = 1, + .min = 0, + .max = 31, + .dims = {64}, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_CURVE_Y, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_curve_y", + .step = 1, + .min = 0, + .max = 1048575, + .dims = {64}, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_USE_OUT_Y_CURVE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_use_out_y_curve", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_STAT_CURVE_X, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_stat_curve_x", + .step = 1, + .min = 0, + .max = 31, + .dims = {64}, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_STAT_CURVE_Y, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_stat_curve_y", + .step = 1, + .min = 0, + .max = 1048575, + .dims = {64}, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_STAT_USE_OUT_Y_CURVE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_stat_use_out_y_curve", + .step = 1, + .min = 0, + .max = 1, + }, +}; + +int vvcam_isp_cpd_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_cpd_ctrls); +} + +int vvcam_isp_cpd_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_cpd_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_cpd_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp cpd ctrl %s failed %d.\n", + vvcam_isp_cpd_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1/vvcam_isp_cpd.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1/vvcam_isp_cpd.h new file mode 100644 index 0000000..4ee457c --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1/vvcam_isp_cpd.h @@ -0,0 +1,77 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_CPD_H__ +#define __VVCAM_ISP_CPD_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_CPD_ENABLE (VVCAM_ISP_CID_CPD_BASE + 0x0000) +#define VVCAM_ISP_CID_CPD_RESET (VVCAM_ISP_CID_CPD_BASE + 0x0001) +#define VVCAM_ISP_CID_CPD_CURVE_X (VVCAM_ISP_CID_CPD_BASE + 0x0002) +#define VVCAM_ISP_CID_CPD_CURVE_Y (VVCAM_ISP_CID_CPD_BASE + 0x0003) +#define VVCAM_ISP_CID_CPD_USE_OUT_Y_CURVE (VVCAM_ISP_CID_CPD_BASE + 0x0004) +#define VVCAM_ISP_CID_CPD_STAT_CURVE_X (VVCAM_ISP_CID_CPD_BASE + 0x0005) +#define VVCAM_ISP_CID_CPD_STAT_CURVE_Y (VVCAM_ISP_CID_CPD_BASE + 0x0006) +#define VVCAM_ISP_CID_CPD_STAT_USE_OUT_Y_CURVE \ + (VVCAM_ISP_CID_CPD_BASE + 0x0007) + + +#ifdef __KERNEL__ +int vvcam_isp_cpd_ctrl_count(void); +int vvcam_isp_cpd_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1_1/vvcam_isp_cpd.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1_1/vvcam_isp_cpd.c new file mode 100644 index 0000000..83b4e58 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1_1/vvcam_isp_cpd.c @@ -0,0 +1,225 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_cpd.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_cpd_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_CPD_ENABLE: + case VVCAM_ISP_CID_CPD_RESET: + case VVCAM_ISP_CID_CPD_CURVE_X: + case VVCAM_ISP_CID_CPD_CURVE_Y: + case VVCAM_ISP_CID_CPD_USE_OUT_Y_CURVE: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_cpd_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_CPD_ENABLE: + case VVCAM_ISP_CID_CPD_RESET: + case VVCAM_ISP_CID_CPD_CURVE_X: + case VVCAM_ISP_CID_CPD_CURVE_Y: + case VVCAM_ISP_CID_CPD_USE_OUT_Y_CURVE: + case VVCAM_ISP_CID_CPD_STAT_CURVE_X: + case VVCAM_ISP_CID_CPD_STAT_CURVE_Y: + case VVCAM_ISP_CID_CPD_STAT_USE_OUT_Y_CURVE: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_cpd_ctrl_ops = { + .s_ctrl = vvcam_isp_cpd_s_ctrl, + .g_volatile_ctrl = vvcam_isp_cpd_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_cpd_ctrls[] = { + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_CURVE_X, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_curve_x", + .step = 1, + .min = 0, + .max = 31, + .dims = {64}, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_CURVE_Y, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_curve_y", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {64}, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_USE_OUT_Y_CURVE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_use_out_y_curve", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_STAT_CURVE_X, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_stat_curve_x", + .step = 1, + .min = 0, + .max = 31, + .dims = {64}, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_STAT_CURVE_Y, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_stat_curve_y", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {64}, + }, + { + .ops = &vvcam_isp_cpd_ctrl_ops, + .id = VVCAM_ISP_CID_CPD_STAT_USE_OUT_Y_CURVE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cpd_stat_use_out_y_curve", + .step = 1, + .min = 0, + .max = 1, + }, +}; + +int vvcam_isp_cpd_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_cpd_ctrls); +} + +int vvcam_isp_cpd_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_cpd_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_cpd_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp cpd ctrl %s failed %d.\n", + vvcam_isp_cpd_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1_1/vvcam_isp_cpd.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1_1/vvcam_isp_cpd.h new file mode 100644 index 0000000..4ee457c --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cpd/cpd_v1_1/vvcam_isp_cpd.h @@ -0,0 +1,77 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_CPD_H__ +#define __VVCAM_ISP_CPD_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_CPD_ENABLE (VVCAM_ISP_CID_CPD_BASE + 0x0000) +#define VVCAM_ISP_CID_CPD_RESET (VVCAM_ISP_CID_CPD_BASE + 0x0001) +#define VVCAM_ISP_CID_CPD_CURVE_X (VVCAM_ISP_CID_CPD_BASE + 0x0002) +#define VVCAM_ISP_CID_CPD_CURVE_Y (VVCAM_ISP_CID_CPD_BASE + 0x0003) +#define VVCAM_ISP_CID_CPD_USE_OUT_Y_CURVE (VVCAM_ISP_CID_CPD_BASE + 0x0004) +#define VVCAM_ISP_CID_CPD_STAT_CURVE_X (VVCAM_ISP_CID_CPD_BASE + 0x0005) +#define VVCAM_ISP_CID_CPD_STAT_CURVE_Y (VVCAM_ISP_CID_CPD_BASE + 0x0006) +#define VVCAM_ISP_CID_CPD_STAT_USE_OUT_Y_CURVE \ + (VVCAM_ISP_CID_CPD_BASE + 0x0007) + + +#ifdef __KERNEL__ +int vvcam_isp_cpd_ctrl_count(void); +int vvcam_isp_cpd_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cproc/cproc/vvcam_isp_cproc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cproc/cproc/vvcam_isp_cproc.c index 664d76d..692f16a 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cproc/cproc/vvcam_isp_cproc.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cproc/cproc/vvcam_isp_cproc.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -112,6 +114,10 @@ static int vvcam_isp_cproc_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_CPROC_MANU_BRIGHT: case VVCAM_ISP_CID_CPROC_MANU_SATURATION: case VVCAM_ISP_CID_CPROC_MANU_HUE: + case VVCAM_ISP_CID_CPROC_STAT_CONTRAST: + case VVCAM_ISP_CID_CPROC_STAT_BRIGHT: + case VVCAM_ISP_CID_CPROC_STAT_SATURATION: + case VVCAM_ISP_CID_CPROC_STAT_HUE: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -160,30 +166,6 @@ const struct v4l2_ctrl_config vvcam_isp_cproc_ctrls[] = { .max = 2, .def = 1, }, -/* - { - .ops = &vvcam_isp_cproc_ctrl_ops, - .id = VVCAM_ISP_CID_CPROC_LUMA_IN_TYPE, - .type = V4L2_CTRL_TYPE_INTEGER, - .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_cproc_luma_in_type", - .step = 1, - .min = 1, - .max = 2, - .def = 1, - }, - { - .ops = &vvcam_isp_cproc_ctrl_ops, - .id = VVCAM_ISP_CID_CPROC_LUMA_OUT_TYPE, - .type = V4L2_CTRL_TYPE_INTEGER, - .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_cproc_luma_out_type", - .step = 1, - .min = 1, - .max = 2, - .def = 1, - }, -*/ { /* manual/auto */ .ops = &vvcam_isp_cproc_ctrl_ops, @@ -268,7 +250,7 @@ const struct v4l2_ctrl_config vvcam_isp_cproc_ctrls[] = { .dims = {20} }, { - /* float [0,1.992] */ + /* float [0,1.992] ratio 128:1 */ .ops = &vvcam_isp_cproc_ctrl_ops, .id = VVCAM_ISP_CID_CPROC_MANU_CONTRAST, .type = V4L2_CTRL_TYPE_INTEGER, @@ -279,18 +261,19 @@ const struct v4l2_ctrl_config vvcam_isp_cproc_ctrls[] = { .max = 255, }, { - /* float [-127, 127] */ + /* float [-128, 127] */ .ops = &vvcam_isp_cproc_ctrl_ops, .id = VVCAM_ISP_CID_CPROC_MANU_BRIGHT, .type = V4L2_CTRL_TYPE_INTEGER, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_cproc_manu_bright", .step = 1, - .min = -127, + .min = -128, .max = 127, + .def = 0, }, { - /* float [0,1.992] */ + /* float [0,1.992] ratio 128:1 */ .ops = &vvcam_isp_cproc_ctrl_ops, .id = VVCAM_ISP_CID_CPROC_MANU_SATURATION, .type = V4L2_CTRL_TYPE_INTEGER, @@ -301,7 +284,7 @@ const struct v4l2_ctrl_config vvcam_isp_cproc_ctrls[] = { .max = 255, }, { - /* float [-90, 90] */ + /* float [-90, 87] */ .ops = &vvcam_isp_cproc_ctrl_ops, .id = VVCAM_ISP_CID_CPROC_MANU_HUE, .type = V4L2_CTRL_TYPE_INTEGER, @@ -309,7 +292,54 @@ const struct v4l2_ctrl_config vvcam_isp_cproc_ctrls[] = { .name = "isp_cproc_manu_hue", .step = 1, .min = -90, - .max = 90, + .max = 87, + .def = 0, + }, + { + /* float [0,1.992] ratio 128:1 */ + .ops = &vvcam_isp_cproc_ctrl_ops, + .id = VVCAM_ISP_CID_CPROC_STAT_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cproc_stat_contrast", + .step = 1, + .min = 0, + .max = 255, + }, + { + /* float [-128, 127] */ + .ops = &vvcam_isp_cproc_ctrl_ops, + .id = VVCAM_ISP_CID_CPROC_STAT_BRIGHT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cproc_stat_bright", + .step = 1, + .min = -128, + .max = 127, + .def = 0, + }, + { + /* float [0,1.992] ratio 128:1 */ + .ops = &vvcam_isp_cproc_ctrl_ops, + .id = VVCAM_ISP_CID_CPROC_STAT_SATURATION, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cproc_stat_saturation", + .step = 1, + .min = 0, + .max = 255, + }, + { + /* float [-90, 87] */ + .ops = &vvcam_isp_cproc_ctrl_ops, + .id = VVCAM_ISP_CID_CPROC_STAT_HUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_cproc_stat_hue", + .step = 1, + .min = -90, + .max = 87, + .def = 0, }, }; diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cproc/cproc/vvcam_isp_cproc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cproc/cproc/vvcam_isp_cproc.h index 6a61b6d..964f617 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cproc/cproc/vvcam_isp_cproc.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/cproc/cproc/vvcam_isp_cproc.h @@ -1,79 +1,86 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_CPROC_H__ #define __VVCAM_ISP_CPROC_H__ -#define VVCAM_ISP_CID_CPROC_ENABLE (VVCAM_ISP_CID_CPROC_BASE + 0x0000) -#define VVCAM_ISP_CID_CPROC_RESET (VVCAM_ISP_CID_CPROC_BASE + 0x0001) -#define VVCAM_ISP_CID_CPROC_CHROMA_OUT_TYPE (VVCAM_ISP_CID_CPROC_BASE + 0x0002) -// #define VVCAM_ISP_CID_CPROC_LUMA_IN_TYPE (VVCAM_ISP_CID_CPROC_BASE + 0x0003) -// #define VVCAM_ISP_CID_CPROC_LUMA_OUT_TYPE (VVCAM_ISP_CID_CPROC_BASE + 0x0004) -#define VVCAM_ISP_CID_CPROC_MODE (VVCAM_ISP_CID_CPROC_BASE + 0x0005) -#define VVCAM_ISP_CID_CPROC_AUTO_LEVEL (VVCAM_ISP_CID_CPROC_BASE + 0x0006) -#define VVCAM_ISP_CID_CPROC_AUTO_GAIN (VVCAM_ISP_CID_CPROC_BASE + 0x0007) -#define VVCAM_ISP_CID_CPROC_AUTO_CONTRAST (VVCAM_ISP_CID_CPROC_BASE + 0x0008) -#define VVCAM_ISP_CID_CPROC_AUTO_BRIGHT (VVCAM_ISP_CID_CPROC_BASE + 0x0009) -#define VVCAM_ISP_CID_CPROC_AUTO_SATURATION (VVCAM_ISP_CID_CPROC_BASE + 0x000A) -#define VVCAM_ISP_CID_CPROC_AUTO_HUE (VVCAM_ISP_CID_CPROC_BASE + 0x000B) -#define VVCAM_ISP_CID_CPROC_MANU_CONTRAST (VVCAM_ISP_CID_CPROC_BASE + 0x000C) -#define VVCAM_ISP_CID_CPROC_MANU_BRIGHT (VVCAM_ISP_CID_CPROC_BASE + 0x000D) -#define VVCAM_ISP_CID_CPROC_MANU_SATURATION \ - (VVCAM_ISP_CID_CPROC_BASE + 0x000E) -#define VVCAM_ISP_CID_CPROC_MANU_HUE (VVCAM_ISP_CID_CPROC_BASE + 0x000F) +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_CPROC_ENABLE (VVCAM_ISP_CID_CPROC_BASE + 0x0000) +#define VVCAM_ISP_CID_CPROC_RESET (VVCAM_ISP_CID_CPROC_BASE + 0x0001) +#define VVCAM_ISP_CID_CPROC_CHROMA_OUT_TYPE (VVCAM_ISP_CID_CPROC_BASE + 0x0002) +#define VVCAM_ISP_CID_CPROC_MODE (VVCAM_ISP_CID_CPROC_BASE + 0x0003) +#define VVCAM_ISP_CID_CPROC_AUTO_LEVEL (VVCAM_ISP_CID_CPROC_BASE + 0x0004) +#define VVCAM_ISP_CID_CPROC_AUTO_GAIN (VVCAM_ISP_CID_CPROC_BASE + 0x0005) +#define VVCAM_ISP_CID_CPROC_AUTO_CONTRAST (VVCAM_ISP_CID_CPROC_BASE + 0x0006) +#define VVCAM_ISP_CID_CPROC_AUTO_BRIGHT (VVCAM_ISP_CID_CPROC_BASE + 0x0007) +#define VVCAM_ISP_CID_CPROC_AUTO_SATURATION (VVCAM_ISP_CID_CPROC_BASE + 0x0008) +#define VVCAM_ISP_CID_CPROC_AUTO_HUE (VVCAM_ISP_CID_CPROC_BASE + 0x0009) +#define VVCAM_ISP_CID_CPROC_MANU_CONTRAST (VVCAM_ISP_CID_CPROC_BASE + 0x000A) +#define VVCAM_ISP_CID_CPROC_MANU_BRIGHT (VVCAM_ISP_CID_CPROC_BASE + 0x000B) +#define VVCAM_ISP_CID_CPROC_MANU_SATURATION (VVCAM_ISP_CID_CPROC_BASE + 0x000C) +#define VVCAM_ISP_CID_CPROC_MANU_HUE (VVCAM_ISP_CID_CPROC_BASE + 0x000D) +#define VVCAM_ISP_CID_CPROC_STAT_CONTRAST (VVCAM_ISP_CID_CPROC_BASE + 0x000E) +#define VVCAM_ISP_CID_CPROC_STAT_BRIGHT (VVCAM_ISP_CID_CPROC_BASE + 0x000F) +#define VVCAM_ISP_CID_CPROC_STAT_SATURATION (VVCAM_ISP_CID_CPROC_BASE + 0x0010) +#define VVCAM_ISP_CID_CPROC_STAT_HUE (VVCAM_ISP_CID_CPROC_BASE + 0x0011) +#ifdef __KERNEL__ int vvcam_isp_cproc_ctrl_count(void); int vvcam_isp_cproc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dg/dg_v1/vvcam_isp_dg.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dg/dg_v1/vvcam_isp_dg.c new file mode 100644 index 0000000..aaf4c65 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dg/dg_v1/vvcam_isp_dg.c @@ -0,0 +1,259 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_dg.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_dg_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_DG_ENABLE: + case VVCAM_ISP_CID_DG_RESET: + case VVCAM_ISP_CID_DG_MANU_B_GAIN: + case VVCAM_ISP_CID_DG_MANU_GB_GAIN: + case VVCAM_ISP_CID_DG_MANU_GR_GAIN: + case VVCAM_ISP_CID_DG_MANU_R_GAIN: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_dg_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_DG_ENABLE: + case VVCAM_ISP_CID_DG_RESET: + case VVCAM_ISP_CID_DG_MANU_B_GAIN: + case VVCAM_ISP_CID_DG_MANU_GB_GAIN: + case VVCAM_ISP_CID_DG_MANU_GR_GAIN: + case VVCAM_ISP_CID_DG_MANU_R_GAIN: + case VVCAM_ISP_CID_DG_STAT_B_GAIN: + case VVCAM_ISP_CID_DG_STAT_GB_GAIN: + case VVCAM_ISP_CID_DG_STAT_GR_GAIN: + case VVCAM_ISP_CID_DG_STAT_R_GAIN: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_dg_ctrl_ops = { + .s_ctrl = vvcam_isp_dg_s_ctrl, + .g_volatile_ctrl = vvcam_isp_dg_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_dg_ctrls[] = { + { + .ops = &vvcam_isp_dg_ctrl_ops, + .id = VVCAM_ISP_CID_DG_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dg_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dg_ctrl_ops, + .id = VVCAM_ISP_CID_DG_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dg_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float [1.0,255.0] */ + .ops = &vvcam_isp_dg_ctrl_ops, + .id = VVCAM_ISP_CID_DG_MANU_B_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dg_manu_b_gain", + .step = 1, + .min = 256, + .max = 65280, + .def = 256, + }, + { + /* float [1.0,255.0] */ + .ops = &vvcam_isp_dg_ctrl_ops, + .id = VVCAM_ISP_CID_DG_MANU_GB_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dg_manu_gb_gain", + .step = 1, + .min = 256, + .max = 65280, + .def = 256, + }, + { + /* float [1.0,255.0] */ + .ops = &vvcam_isp_dg_ctrl_ops, + .id = VVCAM_ISP_CID_DG_MANU_GR_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dg_manu_gr_gain", + .step = 1, + .min = 256, + .max = 65280, + .def = 256, + }, + { + /* float [1.0,255.0] */ + .ops = &vvcam_isp_dg_ctrl_ops, + .id = VVCAM_ISP_CID_DG_MANU_R_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dg_manu_r_gain", + .step = 1, + .min = 256, + .max = 65280, + .def = 256, + }, + { + /* float [1.0,255.0] */ + .ops = &vvcam_isp_dg_ctrl_ops, + .id = VVCAM_ISP_CID_DG_STAT_B_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dg_stat_b_gain", + .step = 1, + .min = 256, + .max = 65280, + .def = 256, + }, + { + /* float [1.0,255.0] */ + .ops = &vvcam_isp_dg_ctrl_ops, + .id = VVCAM_ISP_CID_DG_STAT_GB_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dg_stat_gb_gain", + .step = 1, + .min = 256, + .max = 65280, + .def = 256, + }, + { + /* float [1.0,255.0] */ + .ops = &vvcam_isp_dg_ctrl_ops, + .id = VVCAM_ISP_CID_DG_STAT_GR_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dg_stat_gr_gain", + .step = 1, + .min = 256, + .max = 65280, + .def = 256, + }, + { + /* float [1.0,255.0] */ + .ops = &vvcam_isp_dg_ctrl_ops, + .id = VVCAM_ISP_CID_DG_STAT_R_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dg_stat_r_gain", + .step = 1, + .min = 256, + .max = 65280, + .def = 256, + }, +}; + +int vvcam_isp_dg_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_dg_ctrls); +} + +int vvcam_isp_dg_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_dg_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_dg_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp dg ctrl %s failed %d.\n", + vvcam_isp_dg_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dg/dg_v1/vvcam_isp_dg.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dg/dg_v1/vvcam_isp_dg.h new file mode 100644 index 0000000..01c7d04 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dg/dg_v1/vvcam_isp_dg.h @@ -0,0 +1,77 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_DG_H__ +#define __VVCAM_ISP_DG_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_DG_ENABLE (VVCAM_ISP_CID_DG_BASE + 0x0000) +#define VVCAM_ISP_CID_DG_RESET (VVCAM_ISP_CID_DG_BASE + 0x0001) +#define VVCAM_ISP_CID_DG_MANU_B_GAIN (VVCAM_ISP_CID_DG_BASE + 0x0002) +#define VVCAM_ISP_CID_DG_MANU_GB_GAIN (VVCAM_ISP_CID_DG_BASE + 0x0003) +#define VVCAM_ISP_CID_DG_MANU_GR_GAIN (VVCAM_ISP_CID_DG_BASE + 0x0004) +#define VVCAM_ISP_CID_DG_MANU_R_GAIN (VVCAM_ISP_CID_DG_BASE + 0x0005) +#define VVCAM_ISP_CID_DG_STAT_B_GAIN (VVCAM_ISP_CID_DG_BASE + 0x0006) +#define VVCAM_ISP_CID_DG_STAT_GB_GAIN (VVCAM_ISP_CID_DG_BASE + 0x0007) +#define VVCAM_ISP_CID_DG_STAT_GR_GAIN (VVCAM_ISP_CID_DG_BASE + 0x0008) +#define VVCAM_ISP_CID_DG_STAT_R_GAIN (VVCAM_ISP_CID_DG_BASE + 0x0009) + +#ifdef __KERNEL__ +int vvcam_isp_dg_ctrl_count(void); +int vvcam_isp_dg_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v1/vvcam_isp_dmsc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v1/vvcam_isp_dmsc.c index 030dad0..05b07cb 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v1/vvcam_isp_dmsc.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v1/vvcam_isp_dmsc.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -118,6 +120,19 @@ static int vvcam_isp_dmsc_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_DMSC_MANU_CAC_C_RED: case VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_H_OFFSET: case VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_V_OFFSET: + case VVCAM_ISP_CID_DMSC_STAT_FILTER_DENOISE_LEVEL: + case VVCAM_ISP_CID_DMSC_STAT_FILTER_SHARPEN_LEVEL: + case VVCAM_ISP_CID_DMSC_STAT_FILTER_V_MODE: + case VVCAM_ISP_CID_DMSC_STAT_FILTER_H_MODE: + case VVCAM_ISP_CID_DMSC_STAT_CAC_A_BLUE: + case VVCAM_ISP_CID_DMSC_STAT_CAC_A_RED: + case VVCAM_ISP_CID_DMSC_STAT_CAC_B_BLUE: + case VVCAM_ISP_CID_DMSC_STAT_CAC_B_RED: + case VVCAM_ISP_CID_DMSC_STAT_CAC_C_BLUE: + case VVCAM_ISP_CID_DMSC_STAT_CAC_C_RED: + case VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_H_OFFSET: + case VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_V_OFFSET: + case VVCAM_ISP_CID_DMSC_STAT_THRESHOLD: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -316,6 +331,147 @@ const struct v4l2_ctrl_config vvcam_isp_dmsc_ctrls[] = { .min = -32768, .max = 32767, }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_THRESHOLD, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_threshold", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_FILTER_DENOISE_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_filt_denoise_lvl", + .step = 1, + .min = 0, + .max = 11, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_FILTER_SHARPEN_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_filt_sharpen_lvl", + .step = 1, + .min = 0, + .max = 11, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_FILTER_V_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_filt_v_mode", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_FILTER_H_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_filt_h_mode", + .step = 1, + .min = 0, + .max = 3, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_A_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_a_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_A_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_a_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_B_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_b_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_B_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_b_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_C_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_c_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_C_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_c_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* according to image width */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_H_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_ctr_h_offset", + .step = 1, + .min = -32768, + .max = 32767, + }, + { + /* according to image height */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_V_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_ctr_v_offset", + .step = 1, + .min = -32768, + .max = 32767, + }, }; int vvcam_isp_dmsc_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v1/vvcam_isp_dmsc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v1/vvcam_isp_dmsc.h index 107016f..7215fd9 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v1/vvcam_isp_dmsc.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v1/vvcam_isp_dmsc.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_DMSC_H__ #define __VVCAM_ISP_DMSC_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_DMSC_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0000) #define VVCAM_ISP_CID_DMSC_CAC_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0001) #define VVCAM_ISP_CID_DMSC_FILTER_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0002) @@ -77,8 +81,29 @@ (VVCAM_ISP_CID_DMSC_BASE + 0x000F) #define VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_V_OFFSET \ (VVCAM_ISP_CID_DMSC_BASE + 0x0010) +#define VVCAM_ISP_CID_DMSC_STAT_FILTER_DENOISE_LEVEL \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0011) +#define VVCAM_ISP_CID_DMSC_STAT_FILTER_SHARPEN_LEVEL \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0012) +#define VVCAM_ISP_CID_DMSC_STAT_FILTER_V_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0013) +#define VVCAM_ISP_CID_DMSC_STAT_FILTER_H_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0014) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_A_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0015) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_A_RED (VVCAM_ISP_CID_DMSC_BASE + 0x0016) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_B_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0017) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_B_RED (VVCAM_ISP_CID_DMSC_BASE + 0x0018) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_C_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0019) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_C_RED (VVCAM_ISP_CID_DMSC_BASE + 0x001A) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_H_OFFSET \ + (VVCAM_ISP_CID_DMSC_BASE + 0x001B) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_V_OFFSET \ + (VVCAM_ISP_CID_DMSC_BASE + 0x001C) +#define VVCAM_ISP_CID_DMSC_STAT_THRESHOLD (VVCAM_ISP_CID_DMSC_BASE + 0x001D) +#ifdef __KERNEL__ int vvcam_isp_dmsc_ctrl_count(void); int vvcam_isp_dmsc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v2/vvcam_isp_dmsc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v2/vvcam_isp_dmsc.c index 6385bf7..92147a9 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v2/vvcam_isp_dmsc.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v2/vvcam_isp_dmsc.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -238,6 +240,54 @@ static int vvcam_isp_dmsc_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_DMSC_MANU_CAC_C_RED: case VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_H_OFFSET: case VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_V_OFFSET: + case VVCAM_ISP_CID_DMSC_STAT_THRESHOLD: + case VVCAM_ISP_CID_DMSC_STAT_DIR_THR_MAX: + case VVCAM_ISP_CID_DMSC_STAT_DIR_THR_MIN: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_T1: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_R1: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_R2: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_R1: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_R2: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_T1: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_AREA_THR: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_SAT_SHRINK: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_BLACK: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_WHITE: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_BLACK: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_WHITE: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_R1: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_R2: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_R3: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T1: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T3: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_SIZE: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T4_SHIFT: + case VVCAM_ISP_CID_DMSC_STAT_DENOISE_STRENGTH: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R1: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R2: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_STRENGTH: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_THRESHOLD: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_THR_SHIFT1: + case VVCAM_ISP_CID_DMSC_STAT_SKIN_CB_THR_MAX: + case VVCAM_ISP_CID_DMSC_STAT_SKIN_CB_THR_MIN: + case VVCAM_ISP_CID_DMSC_STAT_SKIN_CR_THR_MAX: + case VVCAM_ISP_CID_DMSC_STAT_SKIN_CR_THR_MIN: + case VVCAM_ISP_CID_DMSC_STAT_SKIN_Y_THR_MAX: + case VVCAM_ISP_CID_DMSC_STAT_SKIN_Y_THR_MIN: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CBCR_MODE: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_SAT_SHRINK: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_THR: + case VVCAM_ISP_CID_DMSC_STAT_CAC_A_BLUE: + case VVCAM_ISP_CID_DMSC_STAT_CAC_A_RED: + case VVCAM_ISP_CID_DMSC_STAT_CAC_B_BLUE: + case VVCAM_ISP_CID_DMSC_STAT_CAC_B_RED: + case VVCAM_ISP_CID_DMSC_STAT_CAC_C_BLUE: + case VVCAM_ISP_CID_DMSC_STAT_CAC_C_RED: + case VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_H_OFFSET: + case VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_V_OFFSET: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -582,7 +632,8 @@ const struct v4l2_ctrl_config vvcam_isp_dmsc_ctrls[] = { .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_dmsc_auto_dpl_threshold", .step = 1, - .min = 0, + .def = 8, + .min = 8, .max = 255, .dims = {20, 0, 0, 0}, }, @@ -1019,7 +1070,8 @@ const struct v4l2_ctrl_config vvcam_isp_dmsc_ctrls[] = { .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_dmsc_manu_dpl_thr", .step = 1, - .min = 0, + .def = 8, + .min = 8, .max = 255, .dims = {1, 0, 0, 0}, }, @@ -1111,6 +1163,532 @@ const struct v4l2_ctrl_config vvcam_isp_dmsc_ctrls[] = { .min = -32768, .max = 32767, }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_THRESHOLD, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_threshold", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DIR_THR_MAX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dir_thr_max", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DIR_THR_MIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dir_thr_min", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_T1, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_t1", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_T2_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_t2_shift", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_edge_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_edge_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_T1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_edge_t1", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_T2_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_edge_t2_shift", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_AREA_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_area_thr", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_SAT_SHRINK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_sat_shrink", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_BLACK, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_clip_blk", + .step = 1, + .min = 0, + .max = 2047, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_WHITE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_clip_wht", + .step = 1, + .min = 0, + .max = 2047, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_BLACK, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_fac_blk", + .step = 1, + .min = 0, + .max = 511, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_WHITE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_fac_wht", + .step = 1, + .min = 0, + .max = 511, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_R3, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_r3", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_t1", + .step = 1, + .min = 0, + .max = 2047, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T3, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_t3", + .step = 1, + .min = 0, + .max = 2047, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_SIZE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_size", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T2_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_t2_shift", + .step = 1, + .min = 0, + .max = 11, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T4_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_t4_shift", + .step = 1, + .min = 0, + .max = 11, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DENOISE_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_denoise_str", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_line_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_line_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_line_str", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_line_thr", + .step = 1, + .min = 0, + .max = 2047, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_THR_SHIFT1, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_line_t_t1", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + /* int16_t */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SKIN_CB_THR_MAX, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_skin_cb_thr_max", + .step = 1, + .min = -2047, + .max = 2047, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SKIN_CB_THR_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_skin_cb_thr_min", + .step = 1, + .min = -2047, + .max = 2047, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SKIN_CR_THR_MAX, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_skin_cr_thr_max", + .step = 1, + .min = -2047, + .max = 2047, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SKIN_CR_THR_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_skin_cr_thr_min", + .step = 1, + .min = -2047, + .max = 2047, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SKIN_Y_THR_MAX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_skin_y_thr_max", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SKIN_Y_THR_MIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_skin_y_thr_min", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CBCR_MODE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_cbcr_mode", + .step = 1, + .min = 0, + .max = 3, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_SAT_SHRINK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_sat_shrink", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_thr", + .step = 1, + .def = 8, + .min = 8, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_A_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_a_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_A_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_a_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_B_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_b_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_B_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_b_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_C_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_c_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_C_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_c_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* according to image width */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_H_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_ctr_h_offset", + .step = 1, + .min = -32768, + .max = 32767, + }, + { + /* according to image height */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_V_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_ctr_v_offset", + .step = 1, + .min = -32768, + .max = 32767, + }, }; int vvcam_isp_dmsc_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v2/vvcam_isp_dmsc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v2/vvcam_isp_dmsc.h index 860c700..67d0602 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v2/vvcam_isp_dmsc.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v2/vvcam_isp_dmsc.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_DMSC_H__ #define __VVCAM_ISP_DMSC_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_DMSC_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0000) #define VVCAM_ISP_CID_DMSC_CAC_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0001) #define VVCAM_ISP_CID_DMSC_DEMOIRE_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0002) @@ -97,20 +101,14 @@ (VVCAM_ISP_CID_DMSC_BASE + 0x001B) #define VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_THRESHOLD \ (VVCAM_ISP_CID_DMSC_BASE + 0x001C) -#define VVCAM_ISP_CID_DMSC_MANU_THRESHOLD \ - (VVCAM_ISP_CID_DMSC_BASE + 0x001D) -#define VVCAM_ISP_CID_DMSC_MANU_DIR_THR_MAX \ - (VVCAM_ISP_CID_DMSC_BASE + 0x001E) -#define VVCAM_ISP_CID_DMSC_MANU_DIR_THR_MIN \ - (VVCAM_ISP_CID_DMSC_BASE + 0x001F) -#define VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_T1 \ - (VVCAM_ISP_CID_DMSC_BASE + 0x0020) +#define VVCAM_ISP_CID_DMSC_MANU_THRESHOLD (VVCAM_ISP_CID_DMSC_BASE + 0x001D) +#define VVCAM_ISP_CID_DMSC_MANU_DIR_THR_MAX (VVCAM_ISP_CID_DMSC_BASE + 0x001E) +#define VVCAM_ISP_CID_DMSC_MANU_DIR_THR_MIN (VVCAM_ISP_CID_DMSC_BASE + 0x001F) +#define VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_T1 (VVCAM_ISP_CID_DMSC_BASE + 0x0020) #define VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_T2_SHIFT \ (VVCAM_ISP_CID_DMSC_BASE + 0x0021) -#define VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_R1 \ - (VVCAM_ISP_CID_DMSC_BASE + 0x0022) -#define VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_R2 \ - (VVCAM_ISP_CID_DMSC_BASE + 0x0023) +#define VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_R1 (VVCAM_ISP_CID_DMSC_BASE + 0x0022) +#define VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_R2 (VVCAM_ISP_CID_DMSC_BASE + 0x0023) #define VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_EDGE_R1 \ (VVCAM_ISP_CID_DMSC_BASE + 0x0024) #define VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_EDGE_R2 \ @@ -131,16 +129,11 @@ (VVCAM_ISP_CID_DMSC_BASE + 0x002C) #define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_FACTOR_WHITE \ (VVCAM_ISP_CID_DMSC_BASE + 0x002D) -#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_R1 \ - (VVCAM_ISP_CID_DMSC_BASE + 0x002E) -#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_R2 \ - (VVCAM_ISP_CID_DMSC_BASE + 0x002F) -#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_R3 \ - (VVCAM_ISP_CID_DMSC_BASE + 0x0030) -#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_T1 \ - (VVCAM_ISP_CID_DMSC_BASE + 0x0031) -#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_T3 \ - (VVCAM_ISP_CID_DMSC_BASE + 0x0032) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_R1 (VVCAM_ISP_CID_DMSC_BASE + 0x002E) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_R2 (VVCAM_ISP_CID_DMSC_BASE + 0x002F) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_R3 (VVCAM_ISP_CID_DMSC_BASE + 0x0030) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_T1 (VVCAM_ISP_CID_DMSC_BASE + 0x0031) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_T3 (VVCAM_ISP_CID_DMSC_BASE + 0x0032) #define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_SIZE \ (VVCAM_ISP_CID_DMSC_BASE + 0x0033) #define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_T2_SHIFT \ @@ -177,21 +170,99 @@ (VVCAM_ISP_CID_DMSC_BASE + 0x0043) #define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_THR \ (VVCAM_ISP_CID_DMSC_BASE + 0x0044) -#define VVCAM_ISP_CID_DMSC_MANU_CAC_A_BLUE \ - (VVCAM_ISP_CID_DMSC_BASE + 0x0045) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_A_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0045) #define VVCAM_ISP_CID_DMSC_MANU_CAC_A_RED (VVCAM_ISP_CID_DMSC_BASE + 0x0046) -#define VVCAM_ISP_CID_DMSC_MANU_CAC_B_BLUE \ - (VVCAM_ISP_CID_DMSC_BASE + 0x0047) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_B_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0047) #define VVCAM_ISP_CID_DMSC_MANU_CAC_B_RED (VVCAM_ISP_CID_DMSC_BASE + 0x0048) -#define VVCAM_ISP_CID_DMSC_MANU_CAC_C_BLUE \ - (VVCAM_ISP_CID_DMSC_BASE + 0x0049) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_C_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0049) #define VVCAM_ISP_CID_DMSC_MANU_CAC_C_RED (VVCAM_ISP_CID_DMSC_BASE + 0x004A) #define VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_H_OFFSET \ (VVCAM_ISP_CID_DMSC_BASE + 0x004B) #define VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_V_OFFSET \ (VVCAM_ISP_CID_DMSC_BASE + 0x004C) +#define VVCAM_ISP_CID_DMSC_STAT_THRESHOLD (VVCAM_ISP_CID_DMSC_BASE + 0x004D) +#define VVCAM_ISP_CID_DMSC_STAT_DIR_THR_MAX (VVCAM_ISP_CID_DMSC_BASE + 0x004E) +#define VVCAM_ISP_CID_DMSC_STAT_DIR_THR_MIN (VVCAM_ISP_CID_DMSC_BASE + 0x004F) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_T1 (VVCAM_ISP_CID_DMSC_BASE + 0x0050) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_T2_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0051) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_R1 (VVCAM_ISP_CID_DMSC_BASE + 0x0052) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_R2 (VVCAM_ISP_CID_DMSC_BASE + 0x0053) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_R1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0054) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_R2 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0055) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_T1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0056) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_EDGE_T2_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0057) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_AREA_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0058) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_SAT_SHRINK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0059) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_BLACK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x005A) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_WHITE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x005B) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_BLACK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x005C) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_WHITE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x005D) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_R1 (VVCAM_ISP_CID_DMSC_BASE + 0x005E) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_R2 (VVCAM_ISP_CID_DMSC_BASE + 0x005F) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_R3 (VVCAM_ISP_CID_DMSC_BASE + 0x0060) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T1 (VVCAM_ISP_CID_DMSC_BASE + 0x0061) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T3 (VVCAM_ISP_CID_DMSC_BASE + 0x0062) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_SIZE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0063) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T2_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0064) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_T4_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0065) +#define VVCAM_ISP_CID_DMSC_STAT_DENOISE_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0066) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0067) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R2 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0068) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0069) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_THRESHOLD \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006A) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_THR_SHIFT1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006B) +#define VVCAM_ISP_CID_DMSC_STAT_SKIN_CB_THR_MAX \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006C) +#define VVCAM_ISP_CID_DMSC_STAT_SKIN_CB_THR_MIN \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006D) +#define VVCAM_ISP_CID_DMSC_STAT_SKIN_CR_THR_MAX \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006E) +#define VVCAM_ISP_CID_DMSC_STAT_SKIN_CR_THR_MIN \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006F) +#define VVCAM_ISP_CID_DMSC_STAT_SKIN_Y_THR_MAX \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0070) +#define VVCAM_ISP_CID_DMSC_STAT_SKIN_Y_THR_MIN \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0071) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CBCR_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0072) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_SAT_SHRINK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0073) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0074) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_A_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0075) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_A_RED (VVCAM_ISP_CID_DMSC_BASE + 0x0076) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_B_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0077) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_B_RED (VVCAM_ISP_CID_DMSC_BASE + 0x0078) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_C_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0079) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_C_RED (VVCAM_ISP_CID_DMSC_BASE + 0x007A) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_H_OFFSET \ + (VVCAM_ISP_CID_DMSC_BASE + 0x007B) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_V_OFFSET \ + (VVCAM_ISP_CID_DMSC_BASE + 0x007C) +#ifdef __KERNEL__ int vvcam_isp_dmsc_ctrl_count(void); int vvcam_isp_dmsc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v3/vvcam_isp_dmsc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v3/vvcam_isp_dmsc.c new file mode 100644 index 0000000..ecbb615 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v3/vvcam_isp_dmsc.c @@ -0,0 +1,2241 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_dmsc.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_dmsc_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_DMSC_ENABLE: + case VVCAM_ISP_CID_DMSC_CAC_ENABLE: + case VVCAM_ISP_CID_DMSC_DEMOIRE_ENABLE: + case VVCAM_ISP_CID_DMSC_DEPURPLE_ENABLE: + case VVCAM_ISP_CID_DMSC_SHARPEN_ENABLE: + case VVCAM_ISP_CID_DMSC_SHARPEN_LINE_ENABLE: + case VVCAM_ISP_CID_DMSC_DEFALSE_ENABLE: + case VVCAM_ISP_CID_DMSC_INTERP_CORNER_ENABLE: + case VVCAM_ISP_CID_DMSC_DECLINE_ENABLE: + case VVCAM_ISP_CID_DMSC_RESET: + case VVCAM_ISP_CID_DMSC_MODE: + case VVCAM_ISP_CID_DMSC_AUTO_LEVEL: + case VVCAM_ISP_CID_DMSC_AUTO_GAIN: + case VVCAM_ISP_CID_DMSC_AUTO_INTERP_DIR_STRENGTH: + case VVCAM_ISP_CID_DMSC_AUTO_INTERP_LARGE_STRENGTH: + case VVCAM_ISP_CID_DMSC_AUTO_DECLINE_ENABLE: + case VVCAM_ISP_CID_DMSC_AUTO_HIGH_LIGHT_THRESHOLD: + case VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_ENABLE: + case VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_THRESHOLD: + case VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_SAT_SHRINK: + case VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_CBCR_RANGE: + case VVCAM_ISP_CID_DMSC_AUTO_DENOISE_STRENGTH: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_ENABLE: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_FACTOR: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CLIP: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T3: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T4_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R2: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R3: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T3: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T4_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R2: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R3: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T3: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T4_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R2: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R3: + case VVCAM_ISP_CID_DMSC_MANU_GRAD_THR_MIN: + case VVCAM_ISP_CID_DMSC_MANU_GRAD_THR_MAX: + case VVCAM_ISP_CID_DMSC_MANU_DIFF_COLOR_COEF: + case VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MODE: + case VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_THR_LOW: + case VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_THR_SHIFT: + case VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MIN: + case VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MAX: + case VVCAM_ISP_CID_DMSC_MANU_HIGH_LIGH_CONTROL_THR: + case VVCAM_ISP_CID_DMSC_MANU_HIGH_LIGH_CONTROL_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_DEBURST_MODE: + case VVCAM_ISP_CID_DMSC_MANU_PURE_G_WEIGHT: + case VVCAM_ISP_CID_DMSC_MANU_PURE_RB_WEIGHT: + case VVCAM_ISP_CID_DMSC_MANU_PURE_G_WEIGHT_ISO: + case VVCAM_ISP_CID_DMSC_MANU_PURE_RB_WEIGHT_ISO: + case VVCAM_ISP_CID_DMSC_MANU_CAC_A_BLUE: + case VVCAM_ISP_CID_DMSC_MANU_CAC_A_RED: + case VVCAM_ISP_CID_DMSC_MANU_CAC_B_BLUE: + case VVCAM_ISP_CID_DMSC_MANU_CAC_B_RED: + case VVCAM_ISP_CID_DMSC_MANU_CAC_C_BLUE: + case VVCAM_ISP_CID_DMSC_MANU_CAC_C_RED: + case VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_H_OFFSET: + case VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_V_OFFSET: + case VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_REFINE_G_THR: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_T1: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_SHIFT1: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_R1: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_R2: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_DENOISE_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_FACTOR_WHITE: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_FACTOR_BLACK: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CLIP_WHITE: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CLIP_BLACK: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T1: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T3: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T4_SHIFT: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R1: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R2: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R3: + case VVCAM_ISP_CID_DMSC_MANU_DEFALSE_COLOR_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_DEFALSE_CBCR_CLASS_THR: + case VVCAM_ISP_CID_DMSC_MANU_DEFALSE_GRAY_PROTECT_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_GRAD_CONTROL: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_PROTECT_THR_LOW: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_PROTECT_SHIFT: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_THR: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CBCR_MODE: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_SAT_SHRINK: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_COLOR_RANGE_MODE: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CB_LOW_THR: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CB_HIGH_THR: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CR_LOW_THR: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CR_HIGH_THR: + case VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_DIR_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_LARGE_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_DIR0_INTERP_TYPE: + case VVCAM_ISP_CID_DMSC_MANU_DECLINE_CORNER_LOW_THR: + case VVCAM_ISP_CID_DMSC_MANU_DECLINE_CORNER_SHIFT: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_dmsc_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_DMSC_ENABLE: + case VVCAM_ISP_CID_DMSC_CAC_ENABLE: + case VVCAM_ISP_CID_DMSC_DEMOIRE_ENABLE: + case VVCAM_ISP_CID_DMSC_DEPURPLE_ENABLE: + case VVCAM_ISP_CID_DMSC_SHARPEN_ENABLE: + case VVCAM_ISP_CID_DMSC_SHARPEN_LINE_ENABLE: + case VVCAM_ISP_CID_DMSC_DEFALSE_ENABLE: + case VVCAM_ISP_CID_DMSC_INTERP_CORNER_ENABLE: + case VVCAM_ISP_CID_DMSC_DECLINE_ENABLE: + case VVCAM_ISP_CID_DMSC_RESET: + case VVCAM_ISP_CID_DMSC_MODE: + case VVCAM_ISP_CID_DMSC_AUTO_LEVEL: + case VVCAM_ISP_CID_DMSC_AUTO_GAIN: + case VVCAM_ISP_CID_DMSC_AUTO_INTERP_DIR_STRENGTH: + case VVCAM_ISP_CID_DMSC_AUTO_INTERP_LARGE_STRENGTH: + case VVCAM_ISP_CID_DMSC_AUTO_DECLINE_ENABLE: + case VVCAM_ISP_CID_DMSC_AUTO_HIGH_LIGHT_THRESHOLD: + case VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_ENABLE: + case VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_THRESHOLD: + case VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_SAT_SHRINK: + case VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_CBCR_RANGE: + case VVCAM_ISP_CID_DMSC_AUTO_DENOISE_STRENGTH: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_ENABLE: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_FACTOR: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CLIP: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T3: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T4_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R2: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R3: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T3: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T4_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R2: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R3: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T3: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T4_SHIFT: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R1: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R2: + case VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R3: + case VVCAM_ISP_CID_DMSC_MANU_GRAD_THR_MIN: + case VVCAM_ISP_CID_DMSC_MANU_GRAD_THR_MAX: + case VVCAM_ISP_CID_DMSC_MANU_DIFF_COLOR_COEF: + case VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MODE: + case VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_THR_LOW: + case VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_THR_SHIFT: + case VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MIN: + case VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MAX: + case VVCAM_ISP_CID_DMSC_MANU_HIGH_LIGH_CONTROL_THR: + case VVCAM_ISP_CID_DMSC_MANU_HIGH_LIGH_CONTROL_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_DEBURST_MODE: + case VVCAM_ISP_CID_DMSC_MANU_PURE_G_WEIGHT: + case VVCAM_ISP_CID_DMSC_MANU_PURE_RB_WEIGHT: + case VVCAM_ISP_CID_DMSC_MANU_PURE_G_WEIGHT_ISO: + case VVCAM_ISP_CID_DMSC_MANU_PURE_RB_WEIGHT_ISO: + case VVCAM_ISP_CID_DMSC_MANU_CAC_A_BLUE: + case VVCAM_ISP_CID_DMSC_MANU_CAC_A_RED: + case VVCAM_ISP_CID_DMSC_MANU_CAC_B_BLUE: + case VVCAM_ISP_CID_DMSC_MANU_CAC_B_RED: + case VVCAM_ISP_CID_DMSC_MANU_CAC_C_BLUE: + case VVCAM_ISP_CID_DMSC_MANU_CAC_C_RED: + case VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_H_OFFSET: + case VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_V_OFFSET: + case VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_REFINE_G_THR: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_T1: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_SHIFT1: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_R1: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_R2: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_DENOISE_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_FACTOR_WHITE: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_FACTOR_BLACK: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CLIP_WHITE: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CLIP_BLACK: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T1: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T3: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T4_SHIFT: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R1: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R2: + case VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R3: + case VVCAM_ISP_CID_DMSC_MANU_DEFALSE_COLOR_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_DEFALSE_CBCR_CLASS_THR: + case VVCAM_ISP_CID_DMSC_MANU_DEFALSE_GRAY_PROTECT_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_GRAD_CONTROL: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_PROTECT_THR_LOW: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_PROTECT_SHIFT: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_THR: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CBCR_MODE: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_SAT_SHRINK: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_COLOR_RANGE_MODE: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CB_LOW_THR: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CB_HIGH_THR: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CR_LOW_THR: + case VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CR_HIGH_THR: + case VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_DIR_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_LARGE_STRENGTH: + case VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_DIR0_INTERP_TYPE: + case VVCAM_ISP_CID_DMSC_MANU_DECLINE_CORNER_LOW_THR: + case VVCAM_ISP_CID_DMSC_MANU_DECLINE_CORNER_SHIFT: + case VVCAM_ISP_CID_DMSC_STAT_GRAD_THR_MIN: + case VVCAM_ISP_CID_DMSC_STAT_GRAD_THR_MAX: + case VVCAM_ISP_CID_DMSC_STAT_DIFF_COLOR_COEF: + case VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_MODE: + case VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_THR_LOW: + case VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_THR_SHIFT: + case VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_MIN: + case VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_MAX: + case VVCAM_ISP_CID_DMSC_STAT_HIGH_LIGH_CONTROL_THR: + case VVCAM_ISP_CID_DMSC_STAT_HIGH_LIGH_CONTROL_STRENGTH: + case VVCAM_ISP_CID_DMSC_STAT_DEBURST_MODE: + case VVCAM_ISP_CID_DMSC_STAT_PURE_G_WEIGHT: + case VVCAM_ISP_CID_DMSC_STAT_PURE_RB_WEIGHT: + case VVCAM_ISP_CID_DMSC_STAT_PURE_G_WEIGHT_ISO: + case VVCAM_ISP_CID_DMSC_STAT_PURE_RB_WEIGHT_ISO: + case VVCAM_ISP_CID_DMSC_STAT_CAC_A_BLUE: + case VVCAM_ISP_CID_DMSC_STAT_CAC_A_RED: + case VVCAM_ISP_CID_DMSC_STAT_CAC_B_BLUE: + case VVCAM_ISP_CID_DMSC_STAT_CAC_B_RED: + case VVCAM_ISP_CID_DMSC_STAT_CAC_C_BLUE: + case VVCAM_ISP_CID_DMSC_STAT_CAC_C_RED: + case VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_H_OFFSET: + case VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_V_OFFSET: + case VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_REFINE_G_THR: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_STRENGTH: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_T1: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_SHIFT1: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R1: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R2: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_DENOISE_STRENGTH: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_WHITE: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_BLACK: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_WHITE: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_BLACK: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T1: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T2_SHIFT: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T3: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T4_SHIFT: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_R1: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_R2: + case VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_R3: + case VVCAM_ISP_CID_DMSC_STAT_DEFALSE_COLOR_STRENGTH: + case VVCAM_ISP_CID_DMSC_STAT_DEFALSE_CBCR_CLASS_THR: + case VVCAM_ISP_CID_DMSC_STAT_DEFALSE_GRAY_PROTECT_STRENGTH: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_GRAD_CONTROL: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_PROTECT_THR_LOW: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_PROTECT_SHIFT: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_THR: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CBCR_MODE: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_SAT_SHRINK: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_COLOR_RANGE_MODE: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CB_LOW_THR: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CB_HIGH_THR: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CR_LOW_THR: + case VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CR_HIGH_THR: + case VVCAM_ISP_CID_DMSC_STAT_INTERP_CORNER_DIR_STRENGTH: + case VVCAM_ISP_CID_DMSC_STAT_INTERP_CORNER_LARGE_STRENGTH: + case VVCAM_ISP_CID_DMSC_STAT_INTERP_CORNER_DIR0_INTERP_TYPE: + case VVCAM_ISP_CID_DMSC_STAT_DECLINE_CORNER_LOW_THR: + case VVCAM_ISP_CID_DMSC_STAT_DECLINE_CORNER_SHIFT: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_dmsc_ctrl_ops = { + .s_ctrl = vvcam_isp_dmsc_s_ctrl, + .g_volatile_ctrl = vvcam_isp_dmsc_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_dmsc_ctrls[] = { + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_CAC_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_cac_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_DEMOIRE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_demoire_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_DEPURPLE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_dpl_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_SHARPEN_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_sharpen_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_SHARPEN_LINE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_sharpen_line_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_DEFALSE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_defalse_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_INTERP_CORNER_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_interp_corner_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_DECLINE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_decline_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* 0: Manual 1: Auto */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_INTERP_DIR_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_interp_dir_str", + .step = 1, + .min = 0, + .max = 255, + .dims = {20, 4, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_INTERP_LARGE_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_interp_large_str", + .step = 1, + .min = 0, + .max = 16, + .dims = {20, 2, 0, 0}, + }, + { + /* bool 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_DECLINE_ENABLE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_decline_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_HIGH_LIGHT_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_high_light_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {20, 2, 0, 0}, + }, + { + /* bool 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_ENABLE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_dpl_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_dpl_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_SAT_SHRINK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_dpl_sat_shrink", + .step = 1, + .min = 0, + .max = 8, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x8x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_CBCR_RANGE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_dpl_cbcr_range", + .step = 1, + .min = 0, + .max = 255, + .dims = {20, 8, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_DENOISE_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_denoise_str", + .step = 1, + .min = 0, + .max = 32, + .dims = {20, 0, 0, 0}, + }, + { + /* bool 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_ENABLE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x6x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_FACTOR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_fac", + .step = 1, + .min = 0, + .max = 511, + .dims = {20, 6, 0, 0}, + }, + { + /* uint16_t 20x6x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CLIP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_clip", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 6, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv0_t1", + .step = 1, + .min = 0, + .max = 2047, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T2_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv0_t2_s", + .step = 1, + .min = 0, + .max = 11, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T3, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv0_t3", + .step = 1, + .min = 0, + .max = 2047, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T4_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv0_t4_s", + .step = 1, + .min = 0, + .max = 11, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv0_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 1, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv0_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R3, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv0_r3", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv1_t1", + .step = 1, + .min = 0, + .max = 2047, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T2_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv1_t2_s", + .step = 1, + .min = 0, + .max = 11, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T3, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv1_t3", + .step = 1, + .min = 0, + .max = 2047, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T4_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv1_t4_s", + .step = 1, + .min = 0, + .max = 11, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv1_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 1, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv1_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R3, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv1_r3", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv2_t1", + .step = 1, + .min = 0, + .max = 2047, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T2_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv2_t2_s", + .step = 1, + .min = 0, + .max = 11, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T3, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv2_t3", + .step = 1, + .min = 0, + .max = 2047, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T4_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv2_t4_s", + .step = 1, + .min = 0, + .max = 11, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv2_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 1, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv2_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R3, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_auto_sharpen_crv_r3", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_GRAD_THR_MIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_grad_thr_min", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_GRAD_THR_MAX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_grad_thr_max", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DIFF_COLOR_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_diff_color_coef", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_adpt_coef_mode", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_THR_LOW, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_adpt_coef_thr_low", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_THR_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_adpt_coef_thr_st", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_adpt_coef_min", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_adpt_coef_max", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_HIGH_LIGH_CONTROL_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_hl_ctrl_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_HIGH_LIGH_CONTROL_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_hl_ctrl_str", + .step = 1, + .min = 0, + .max = 9, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEBURST_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_deburst_mode", + .step = 1, + .min = 0, + .max = 7, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_PURE_G_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_pure_g_wt", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_PURE_RB_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_pure_rb_wt", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_PURE_G_WEIGHT_ISO, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_pure_g_wt_iso", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_PURE_RB_WEIGHT_ISO, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_pure_rb_wt_iso", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_CAC_A_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_cac_a_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_CAC_A_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_cac_a_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_CAC_B_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_cac_b_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_CAC_B_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_cac_b_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_CAC_C_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_cac_c_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_CAC_C_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_cac_c_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* according to image width */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_H_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_cac_ctr_h_offset", + .step = 1, + .min = -32768, + .max = 32767, + }, + { + /* according to image height */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_V_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_cac_ctr_v_offset", + .step = 1, + .min = -32768, + .max = 32767, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_REFINE_G_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dmr_refine_g_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_line_str", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_T1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_line_t1", + .step = 1, + .min = 0, + .max = 2047, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_SHIFT1, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_line_st1", + .step = 1, + .min = 0, + .max = 11, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_line_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_line_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_DENOISE_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_denoise_str", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_FACTOR_WHITE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_fac_wht", + .step = 1, + .min = 0, + .max = 511, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_FACTOR_BLACK, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_fac_blk", + .step = 1, + .min = 0, + .max = 511, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CLIP_WHITE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_clip_wht", + .step = 1, + .min = 0, + .max = 1024, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CLIP_BLACK, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_clip_blk", + .step = 1, + .min = 0, + .max = 1024, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_curve_t1", + .step = 1, + .min = 0, + .max = 2047, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T2_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_curve_st2", + .step = 1, + .min = 0, + .max = 11, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T3, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_curve_t3", + .step = 1, + .min = 0, + .max = 2047, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T4_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_curve_st4", + .step = 1, + .min = 0, + .max = 11, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_curve_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_curve_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R3, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_sharpen_curve_r3", + .step = 1, + .min = 0, + .max = 256, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEFALSE_COLOR_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_defalse_color_str", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEFALSE_CBCR_CLASS_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_defalse_cbcr_ct", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEFALSE_GRAY_PROTECT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_defalse_gps", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_GRAD_CONTROL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_grad_ctrl", + .step = 1, + .min = 0, + .max = 1, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_PROTECT_THR_LOW, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_prot_thr_low", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_PROTECT_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_prot_shift", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CBCR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_cbcr_mode", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_SAT_SHRINK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_sat_shrink", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_COLOR_RANGE_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_crm", + .step = 1, + .min = 0, + .max = 7, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CB_LOW_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_cb_low_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CB_HIGH_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_cb_high_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CR_LOW_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_cr_low_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CR_HIGH_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dpl_cr_high_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_DIR_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_ic_dir_str", + .step = 1, + .min = 0, + .max = 255, + .dims = {4, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_LARGE_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_ic_large_str", + .step = 1, + .min = 0, + .max = 16, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_DIR0_INTERP_TYPE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_ic_dir0_int_type", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DECLINE_CORNER_LOW_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dc_cor_low_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_MANU_DECLINE_CORNER_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_manu_dc_cor_shift", + .step = 1, + .min = 0, + .max = 12, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_GRAD_THR_MIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_grad_thr_min", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_GRAD_THR_MAX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_grad_thr_max", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DIFF_COLOR_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_diff_color_coef", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_adpt_coef_mode", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_THR_LOW, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_adpt_coef_thr_low", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_THR_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_adpt_coef_thr_st", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_adpt_coef_min", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_adpt_coef_max", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_HIGH_LIGH_CONTROL_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_hl_ctrl_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_HIGH_LIGH_CONTROL_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_hl_ctrl_str", + .step = 1, + .min = 0, + .max = 9, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEBURST_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_deburst_mode", + .step = 1, + .min = 0, + .max = 7, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_PURE_G_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_pure_g_wt", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_PURE_RB_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_pure_rb_wt", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_PURE_G_WEIGHT_ISO, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_pure_g_wt_iso", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_PURE_RB_WEIGHT_ISO, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_pure_rb_wt_iso", + .step = 1, + .min = 0, + .max = 16, + .dims = {1, 0, 0, 0}, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_A_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_a_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_A_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_a_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_B_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_b_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_B_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_b_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_C_BLUE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_c_blue", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* float -16.0~15.9375*/ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_C_RED, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_c_red", + .step = 1, + .min = -256, + .max = 255, + }, + { + /* according to image width */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_H_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_ctr_h_offset", + .step = 1, + .min = -32768, + .max = 32767, + }, + { + /* according to image height */ + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_V_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_cac_ctr_v_offset", + .step = 1, + .min = -32768, + .max = 32767, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_REFINE_G_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dmr_refine_g_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_line_str", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_T1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_line_t1", + .step = 1, + .min = 0, + .max = 2047, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_SHIFT1, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_line_st1", + .step = 1, + .min = 0, + .max = 11, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_line_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_line_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_DENOISE_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_denoise_str", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_WHITE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_fac_wht", + .step = 1, + .min = 0, + .max = 511, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_BLACK, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_fac_blk", + .step = 1, + .min = 0, + .max = 511, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_WHITE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_clip_wht", + .step = 1, + .min = 0, + .max = 1024, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_BLACK, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_clip_blk", + .step = 1, + .min = 0, + .max = 1024, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_curve_t1", + .step = 1, + .min = 0, + .max = 2047, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T2_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_curve_st2", + .step = 1, + .min = 0, + .max = 11, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T3, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_curve_t3", + .step = 1, + .min = 0, + .max = 2047, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T4_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_curve_st4", + .step = 1, + .min = 0, + .max = 11, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_R1, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_curve_r1", + .step = 1, + .min = 0, + .max = 256, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_R2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_curve_r2", + .step = 1, + .min = 0, + .max = 256, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_R3, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_sharpen_curve_r3", + .step = 1, + .min = 0, + .max = 256, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEFALSE_COLOR_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_defalse_color_str", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEFALSE_CBCR_CLASS_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_defalse_cbcr_ct", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEFALSE_GRAY_PROTECT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_defalse_gps", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_GRAD_CONTROL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_grad_ctrl", + .step = 1, + .min = 0, + .max = 1, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_PROTECT_THR_LOW, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_prot_thr_low", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_PROTECT_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_prot_shift", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CBCR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_cbcr_mode", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_SAT_SHRINK, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_sat_shrink", + .step = 1, + .min = 0, + .max = 8, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_COLOR_RANGE_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_crm", + .step = 1, + .min = 0, + .max = 7, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CB_LOW_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_cb_low_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CB_HIGH_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_cb_high_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CR_LOW_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_cr_low_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CR_HIGH_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dpl_cr_high_thr", + .step = 1, + .min = 0, + .max = 255, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_INTERP_CORNER_DIR_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_ic_dir_str", + .step = 1, + .min = 0, + .max = 255, + .dims = {4, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_INTERP_CORNER_LARGE_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_ic_large_str", + .step = 1, + .min = 0, + .max = 16, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_INTERP_CORNER_DIR0_INTERP_TYPE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_ic_dir0_int_type", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DECLINE_CORNER_LOW_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dc_cor_low_thr", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_dmsc_ctrl_ops, + .id = VVCAM_ISP_CID_DMSC_STAT_DECLINE_CORNER_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dmsc_stat_dc_cor_shift", + .step = 1, + .min = 0, + .max = 12, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_dmsc_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_dmsc_ctrls); +} + +int vvcam_isp_dmsc_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_dmsc_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_dmsc_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp dmsc ctrl %s failed %d.\n", + vvcam_isp_dmsc_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v3/vvcam_isp_dmsc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v3/vvcam_isp_dmsc.h new file mode 100644 index 0000000..9f35980 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dmsc/dmsc_v3/vvcam_isp_dmsc.h @@ -0,0 +1,376 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_DMSC_H__ +#define __VVCAM_ISP_DMSC_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_DMSC_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0000) +#define VVCAM_ISP_CID_DMSC_CAC_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0001) +#define VVCAM_ISP_CID_DMSC_DEMOIRE_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0002) +#define VVCAM_ISP_CID_DMSC_DEPURPLE_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0003) +#define VVCAM_ISP_CID_DMSC_SHARPEN_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0004) +#define VVCAM_ISP_CID_DMSC_SHARPEN_LINE_ENABLE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0005) +#define VVCAM_ISP_CID_DMSC_DEFALSE_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0006) +#define VVCAM_ISP_CID_DMSC_INTERP_CORNER_ENABLE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0007) +#define VVCAM_ISP_CID_DMSC_DECLINE_ENABLE (VVCAM_ISP_CID_DMSC_BASE + 0x0008) +#define VVCAM_ISP_CID_DMSC_RESET (VVCAM_ISP_CID_DMSC_BASE + 0x0009) +#define VVCAM_ISP_CID_DMSC_MODE (VVCAM_ISP_CID_DMSC_BASE + 0x000A) +#define VVCAM_ISP_CID_DMSC_AUTO_LEVEL (VVCAM_ISP_CID_DMSC_BASE + 0x000B) +#define VVCAM_ISP_CID_DMSC_AUTO_GAIN (VVCAM_ISP_CID_DMSC_BASE + 0x000C) +#define VVCAM_ISP_CID_DMSC_AUTO_INTERP_DIR_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x000D) +#define VVCAM_ISP_CID_DMSC_AUTO_INTERP_LARGE_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x000E) +#define VVCAM_ISP_CID_DMSC_AUTO_DECLINE_ENABLE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x000F) +#define VVCAM_ISP_CID_DMSC_AUTO_HIGH_LIGHT_THRESHOLD \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0010) +#define VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_ENABLE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0011) +#define VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_THRESHOLD \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0012) +#define VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_SAT_SHRINK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0013) +#define VVCAM_ISP_CID_DMSC_AUTO_DEPURPLE_CBCR_RANGE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0014) +#define VVCAM_ISP_CID_DMSC_AUTO_DENOISE_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0015) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_ENABLE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0016) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_FACTOR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0017) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CLIP \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0018) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0019) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T2_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x001A) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T3 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x001B) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_T4_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x001C) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x001D) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R2 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x001E) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE0_R3 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x001F) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0020) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T2_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0021) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T3 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0022) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_T4_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0023) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0024) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R2 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0025) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE1_R3 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0026) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0027) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T2_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0028) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T3 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0029) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_T4_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x002A) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x002B) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R2 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x002C) +#define VVCAM_ISP_CID_DMSC_AUTO_SHARPEN_CURVE2_R3 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x002D) +#define VVCAM_ISP_CID_DMSC_MANU_GRAD_THR_MIN \ + (VVCAM_ISP_CID_DMSC_BASE + 0x002E) +#define VVCAM_ISP_CID_DMSC_MANU_GRAD_THR_MAX \ + (VVCAM_ISP_CID_DMSC_BASE + 0x002F) +#define VVCAM_ISP_CID_DMSC_MANU_DIFF_COLOR_COEF \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0030) +#define VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0031) +#define VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_THR_LOW \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0032) +#define VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_THR_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0033) +#define VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MIN \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0034) +#define VVCAM_ISP_CID_DMSC_MANU_ADAP_COEF_MAX \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0035) +#define VVCAM_ISP_CID_DMSC_MANU_HIGH_LIGH_CONTROL_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0036) +#define VVCAM_ISP_CID_DMSC_MANU_HIGH_LIGH_CONTROL_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0037) +#define VVCAM_ISP_CID_DMSC_MANU_DEBURST_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0038) +#define VVCAM_ISP_CID_DMSC_MANU_PURE_G_WEIGHT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0039) +#define VVCAM_ISP_CID_DMSC_MANU_PURE_RB_WEIGHT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x003A) +#define VVCAM_ISP_CID_DMSC_MANU_PURE_G_WEIGHT_ISO \ + (VVCAM_ISP_CID_DMSC_BASE + 0x003B) +#define VVCAM_ISP_CID_DMSC_MANU_PURE_RB_WEIGHT_ISO \ + (VVCAM_ISP_CID_DMSC_BASE + 0x003C) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_A_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x003D) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_A_RED (VVCAM_ISP_CID_DMSC_BASE + 0x003E) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_B_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x003F) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_B_RED (VVCAM_ISP_CID_DMSC_BASE + 0x0040) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_C_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0041) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_C_RED (VVCAM_ISP_CID_DMSC_BASE + 0x0042) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_H_OFFSET \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0043) +#define VVCAM_ISP_CID_DMSC_MANU_CAC_CENTER_V_OFFSET \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0044) +#define VVCAM_ISP_CID_DMSC_MANU_DEMOIRE_REFINE_G_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0045) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0046) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_T1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0047) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_SHIFT1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0048) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_R1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0049) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_LINE_R2 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x004A) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_DENOISE_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x004B) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_FACTOR_WHITE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x004C) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_FACTOR_BLACK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x004D) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CLIP_WHITE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x004E) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CLIP_BLACK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x004F) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0050) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T2_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0051) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T3 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0052) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_T4_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0053) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0054) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R2 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0055) +#define VVCAM_ISP_CID_DMSC_MANU_SHARPEN_CURVE_R3 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0056) +#define VVCAM_ISP_CID_DMSC_MANU_DEFALSE_COLOR_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0057) +#define VVCAM_ISP_CID_DMSC_MANU_DEFALSE_CBCR_CLASS_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0058) +#define VVCAM_ISP_CID_DMSC_MANU_DEFALSE_GRAY_PROTECT_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0059) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_GRAD_CONTROL \ + (VVCAM_ISP_CID_DMSC_BASE + 0x005A) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_PROTECT_THR_LOW \ + (VVCAM_ISP_CID_DMSC_BASE + 0x005B) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_PROTECT_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x005C) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x005D) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CBCR_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x005E) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_SAT_SHRINK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x005F) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_COLOR_RANGE_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0060) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CB_LOW_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0061) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CB_HIGH_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0062) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CR_LOW_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0063) +#define VVCAM_ISP_CID_DMSC_MANU_DEPURPLE_CR_HIGH_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0064) +#define VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_DIR_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0065) +#define VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_LARGE_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0066) +#define VVCAM_ISP_CID_DMSC_MANU_INTERP_CORNER_DIR0_INTERP_TYPE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0067) +#define VVCAM_ISP_CID_DMSC_MANU_DECLINE_CORNER_LOW_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0068) +#define VVCAM_ISP_CID_DMSC_MANU_DECLINE_CORNER_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0069) +#define VVCAM_ISP_CID_DMSC_STAT_GRAD_THR_MIN \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006A) +#define VVCAM_ISP_CID_DMSC_STAT_GRAD_THR_MAX \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006B) +#define VVCAM_ISP_CID_DMSC_STAT_DIFF_COLOR_COEF \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006C) +#define VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006D) +#define VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_THR_LOW \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006E) +#define VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_THR_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x006F) +#define VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_MIN \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0070) +#define VVCAM_ISP_CID_DMSC_STAT_ADAP_COEF_MAX \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0071) +#define VVCAM_ISP_CID_DMSC_STAT_HIGH_LIGH_CONTROL_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0072) +#define VVCAM_ISP_CID_DMSC_STAT_HIGH_LIGH_CONTROL_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0073) +#define VVCAM_ISP_CID_DMSC_STAT_DEBURST_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0074) +#define VVCAM_ISP_CID_DMSC_STAT_PURE_G_WEIGHT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0075) +#define VVCAM_ISP_CID_DMSC_STAT_PURE_RB_WEIGHT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0076) +#define VVCAM_ISP_CID_DMSC_STAT_PURE_G_WEIGHT_ISO \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0077) +#define VVCAM_ISP_CID_DMSC_STAT_PURE_RB_WEIGHT_ISO \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0078) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_A_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x0079) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_A_RED (VVCAM_ISP_CID_DMSC_BASE + 0x007A) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_B_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x007B) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_B_RED (VVCAM_ISP_CID_DMSC_BASE + 0x007C) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_C_BLUE (VVCAM_ISP_CID_DMSC_BASE + 0x007D) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_C_RED (VVCAM_ISP_CID_DMSC_BASE + 0x007E) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_H_OFFSET\ + (VVCAM_ISP_CID_DMSC_BASE + 0x007F) +#define VVCAM_ISP_CID_DMSC_STAT_CAC_CENTER_V_OFFSET \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0080) +#define VVCAM_ISP_CID_DMSC_STAT_DEMOIRE_REFINE_G_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0081) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0082) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_T1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0083) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_SHIFT1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0084) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0085) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_LINE_R2 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0086) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_DENOISE_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0087) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_WHITE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0088) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_FACTOR_BLACK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0089) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_WHITE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x008A) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CLIP_BLACK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x008B) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x008C) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T2_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x008D) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T3 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x008E) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_T4_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x008F) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_R1 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0090) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_R2 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0091) +#define VVCAM_ISP_CID_DMSC_STAT_SHARPEN_CURVE_R3 \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0092) +#define VVCAM_ISP_CID_DMSC_STAT_DEFALSE_COLOR_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0093) +#define VVCAM_ISP_CID_DMSC_STAT_DEFALSE_CBCR_CLASS_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0094) +#define VVCAM_ISP_CID_DMSC_STAT_DEFALSE_GRAY_PROTECT_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0095) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_GRAD_CONTROL \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0096) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_PROTECT_THR_LOW \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0097) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_PROTECT_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0098) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x0099) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CBCR_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x009A) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_SAT_SHRINK \ + (VVCAM_ISP_CID_DMSC_BASE + 0x009B) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_COLOR_RANGE_MODE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x009C) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CB_LOW_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x009D) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CB_HIGH_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x009E) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CR_LOW_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x009F) +#define VVCAM_ISP_CID_DMSC_STAT_DEPURPLE_CR_HIGH_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x00A0) +#define VVCAM_ISP_CID_DMSC_STAT_INTERP_CORNER_DIR_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x00A1) +#define VVCAM_ISP_CID_DMSC_STAT_INTERP_CORNER_LARGE_STRENGTH \ + (VVCAM_ISP_CID_DMSC_BASE + 0x00A2) +#define VVCAM_ISP_CID_DMSC_STAT_INTERP_CORNER_DIR0_INTERP_TYPE \ + (VVCAM_ISP_CID_DMSC_BASE + 0x00A3) +#define VVCAM_ISP_CID_DMSC_STAT_DECLINE_CORNER_LOW_THR \ + (VVCAM_ISP_CID_DMSC_BASE + 0x00A4) +#define VVCAM_ISP_CID_DMSC_STAT_DECLINE_CORNER_SHIFT \ + (VVCAM_ISP_CID_DMSC_BASE + 0x00A5) + +#ifdef __KERNEL__ +int vvcam_isp_dmsc_ctrl_count(void); +int vvcam_isp_dmsc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpcc/dpcc/vvcam_isp_dpcc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpcc/dpcc/vvcam_isp_dpcc.c index 860af38..e10ff8d 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpcc/dpcc/vvcam_isp_dpcc.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpcc/dpcc/vvcam_isp_dpcc.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -144,6 +146,21 @@ static int vvcam_isp_dpcc_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_DPCC_MANU_RND_OFFSETS: case VVCAM_ISP_CID_DPCC_MANU_RND_THRESHOLD: case VVCAM_ISP_CID_DPCC_MANU_RO_LIMITS: + case VVCAM_ISP_CID_DPCC_STAT_BPT_ENABLE: + case VVCAM_ISP_CID_DPCC_STAT_BPT_NUM: + case VVCAM_ISP_CID_DPCC_STAT_BPT_OUT_MODE: + case VVCAM_ISP_CID_DPCC_STAT_OUT_MODE: + case VVCAM_ISP_CID_DPCC_STAT_SET_USE: + case VVCAM_ISP_CID_DPCC_STAT_BPT_POS_X: + case VVCAM_ISP_CID_DPCC_STAT_BPT_POS_Y: + case VVCAM_ISP_CID_DPCC_STAT_METHODS_SET: + case VVCAM_ISP_CID_DPCC_STAT_LINE_MAD_FACTOR: + case VVCAM_ISP_CID_DPCC_STAT_LINE_THRESHOLD: + case VVCAM_ISP_CID_DPCC_STAT_PG_FACTOR: + case VVCAM_ISP_CID_DPCC_STAT_RG_FACTOR: + case VVCAM_ISP_CID_DPCC_STAT_RND_OFFSETS: + case VVCAM_ISP_CID_DPCC_STAT_RND_THRESHOLD: + case VVCAM_ISP_CID_DPCC_STAT_RO_LIMITS: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -500,6 +517,170 @@ const struct v4l2_ctrl_config vvcam_isp_dpcc_ctrls[] = { .max = 3, .dims = {2, 3, 0, 0}, }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_BPT_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_bpt_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_BPT_NUM, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_bpt_num", + .step = 1, + .min = 0, + .max = 2048, + .dims = {1}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_BPT_OUT_MODE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_bpt_out_mode", + .step = 1, + .min = 0, + .max = 14, + .dims = {1}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_OUT_MODE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_out_mode", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_SET_USE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_set_use", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_BPT_POS_X, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_bpt_pos_x", + .step = 1, + .min = 0, + .max = 65535, + .dims = {2048}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_BPT_POS_Y, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_bpt_pos_y", + .step = 1, + .min = 0, + .max = 65535, + .dims = {2048}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_METHODS_SET, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_methods_set", + .step = 1, + .min = 0, + .max = 8191, + .dims = {3}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_LINE_MAD_FACTOR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_line_mad_factor", + .step = 1, + .min = 0, + .max = 63, + .dims = {2, 3, 0, 0}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_LINE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_line_threshold", + .step = 1, + .min = 0, + .max = 255, + .dims = {2, 3, 0, 0}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_PG_FACTOR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_pg_factor", + .step = 1, + .min = 0, + .max = 63, + .dims = {2, 3, 0, 0}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_RG_FACTOR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_rg_factor", + .step = 1, + .min = 0, + .max = 63, + .dims = {2, 3, 0, 0}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_RND_OFFSETS, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_rnd_offsets", + .step = 1, + .min = 0, + .max = 3, + .dims = {2, 3, 0, 0}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_RND_THRESHOLD, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_rnd_threshold", + .step = 1, + .min = 0, + .max = 63, + .dims = {2, 3, 0, 0}, + }, + { + .ops = &vvcam_isp_dpcc_ctrl_ops, + .id = VVCAM_ISP_CID_DPCC_STAT_RO_LIMITS, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpcc_stat_ro_limits", + .step = 1, + .min = 0, + .max = 3, + .dims = {2, 3, 0, 0}, + }, }; int vvcam_isp_dpcc_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpcc/dpcc/vvcam_isp_dpcc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpcc/dpcc/vvcam_isp_dpcc.h index 69c8a0c..01cba5f 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpcc/dpcc/vvcam_isp_dpcc.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpcc/dpcc/vvcam_isp_dpcc.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_DPCC_H__ #define __VVCAM_ISP_DPCC_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_DPCC_ENABLE (VVCAM_ISP_CID_DPCC_BASE + 0x0000) #define VVCAM_ISP_CID_DPCC_RESET (VVCAM_ISP_CID_DPCC_BASE + 0x0001) #define VVCAM_ISP_CID_DPCC_MODE (VVCAM_ISP_CID_DPCC_BASE + 0x0002) @@ -91,8 +95,29 @@ #define VVCAM_ISP_CID_DPCC_MANU_RND_THRESHOLD \ (VVCAM_ISP_CID_DPCC_BASE + 0x001C) #define VVCAM_ISP_CID_DPCC_MANU_RO_LIMITS (VVCAM_ISP_CID_DPCC_BASE + 0x001D) +#define VVCAM_ISP_CID_DPCC_STAT_BPT_ENABLE (VVCAM_ISP_CID_DPCC_BASE + 0x001E) +#define VVCAM_ISP_CID_DPCC_STAT_BPT_NUM (VVCAM_ISP_CID_DPCC_BASE + 0x001F) +#define VVCAM_ISP_CID_DPCC_STAT_BPT_OUT_MODE \ + (VVCAM_ISP_CID_DPCC_BASE + 0x0020) +#define VVCAM_ISP_CID_DPCC_STAT_OUT_MODE (VVCAM_ISP_CID_DPCC_BASE + 0x0021) +#define VVCAM_ISP_CID_DPCC_STAT_SET_USE (VVCAM_ISP_CID_DPCC_BASE + 0x0022) +#define VVCAM_ISP_CID_DPCC_STAT_BPT_POS_X (VVCAM_ISP_CID_DPCC_BASE + 0x0023) +#define VVCAM_ISP_CID_DPCC_STAT_BPT_POS_Y (VVCAM_ISP_CID_DPCC_BASE + 0x0024) +#define VVCAM_ISP_CID_DPCC_STAT_METHODS_SET (VVCAM_ISP_CID_DPCC_BASE + 0x0025) +#define VVCAM_ISP_CID_DPCC_STAT_LINE_MAD_FACTOR \ + (VVCAM_ISP_CID_DPCC_BASE + 0x0026) +#define VVCAM_ISP_CID_DPCC_STAT_LINE_THRESHOLD \ + (VVCAM_ISP_CID_DPCC_BASE + 0x0027) +#define VVCAM_ISP_CID_DPCC_STAT_PG_FACTOR (VVCAM_ISP_CID_DPCC_BASE + 0x0028) +#define VVCAM_ISP_CID_DPCC_STAT_RG_FACTOR (VVCAM_ISP_CID_DPCC_BASE + 0x0029) +#define VVCAM_ISP_CID_DPCC_STAT_RND_OFFSETS (VVCAM_ISP_CID_DPCC_BASE + 0x002A) +#define VVCAM_ISP_CID_DPCC_STAT_RND_THRESHOLD \ + (VVCAM_ISP_CID_DPCC_BASE + 0x002B) +#define VVCAM_ISP_CID_DPCC_STAT_RO_LIMITS (VVCAM_ISP_CID_DPCC_BASE + 0x002C) +#ifdef __KERNEL__ int vvcam_isp_dpcc_ctrl_count(void); int vvcam_isp_dpcc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif #endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpf/dpf_v1/vvcam_isp_dpf.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpf/dpf_v1/vvcam_isp_dpf.c index 8ef453d..7b37fdd 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpf/dpf_v1/vvcam_isp_dpf.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpf/dpf_v1/vvcam_isp_dpf.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -124,6 +126,14 @@ static int vvcam_isp_dpf_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_DPF_MANU_SIGMA_G: case VVCAM_ISP_CID_DPF_MANU_SIGMA_RB: case VVCAM_ISP_CID_DPF_MANU_NOISE_CURVE: + case VVCAM_ISP_CID_DPF_STAT_GAIN: + case VVCAM_ISP_CID_DPF_STAT_GRADIENT: + case VVCAM_ISP_CID_DPF_STAT_OFFSET: + case VVCAM_ISP_CID_DPF_STAT_MIN: + case VVCAM_ISP_CID_DPF_STAT_DIV: + case VVCAM_ISP_CID_DPF_STAT_SIGMA_G: + case VVCAM_ISP_CID_DPF_STAT_SIGMA_RB: + case VVCAM_ISP_CID_DPF_STAT_NOISE_CURVE: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -280,7 +290,6 @@ const struct v4l2_ctrl_config vvcam_isp_dpf_ctrls[] = { .max = 0xFFFFFFFF, .dims = {20, 17, 0, 0}, }, - /* { .ops = &vvcam_isp_dpf_ctrl_ops, .id = VVCAM_ISP_CID_DPF_MANU_GAIN, @@ -290,7 +299,8 @@ const struct v4l2_ctrl_config vvcam_isp_dpf_ctrls[] = { .step = 1, .min = 10, .max = 10000, - },*/ + .def = 10, + }, { /* float 0.1 ~ 128.0 */ .ops = &vvcam_isp_dpf_ctrl_ops, @@ -335,7 +345,7 @@ const struct v4l2_ctrl_config vvcam_isp_dpf_ctrls[] = { .name = "isp_dpf_manu_div", .step = 1, .min = 10, - .max = 640, + .max = 650, .def = 10, }, { @@ -374,6 +384,100 @@ const struct v4l2_ctrl_config vvcam_isp_dpf_ctrls[] = { .max = 0xFFFFFFFF, .dims = {17, 0, 0, 0}, }, + { + .ops = &vvcam_isp_dpf_ctrl_ops, + .id = VVCAM_ISP_CID_DPF_STAT_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpf_stat_gain", + .step = 1, + .min = 10, + .max = 10000, + .def = 10, + }, + { + /* float 0.1 ~ 128.0 */ + .ops = &vvcam_isp_dpf_ctrl_ops, + .id = VVCAM_ISP_CID_DPF_STAT_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpf_stat_gradient", + .step = 1, + .min = 1, + .max = 1280, + .def = 1, + }, + { + /* float 0.0 ~ 128.0 */ + .ops = &vvcam_isp_dpf_ctrl_ops, + .id = VVCAM_ISP_CID_DPF_STAT_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpf_stat_offset", + .step = 1, + .min = 0, + .max = 1280, + }, + { + /* float 1.0 ~ 128.0 */ + .ops = &vvcam_isp_dpf_ctrl_ops, + .id = VVCAM_ISP_CID_DPF_STAT_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpf_stat_min", + .step = 1, + .min = 10, + .max = 1280, + .def = 10, + }, + { + /* float 1.0 ~ 64.0 */ + .ops = &vvcam_isp_dpf_ctrl_ops, + .id = VVCAM_ISP_CID_DPF_STAT_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpf_stat_div", + .step = 1, + .min = 10, + .max = 650, + .def = 10, + }, + { + /* float 1.0 ~ 128.0 */ + .ops = &vvcam_isp_dpf_ctrl_ops, + .id = VVCAM_ISP_CID_DPF_STAT_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpf_stat_sigma_g", + .step = 1, + .min = 10, + .max = 1280, + .def = 10, + }, + { + /* float 1.0 ~ 128.0 */ + .ops = &vvcam_isp_dpf_ctrl_ops, + .id = VVCAM_ISP_CID_DPF_STAT_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpf_stat_sigma_rb", + .step = 1, + .min = 10, + .max = 1280, + .def = 10, + }, + { + /* float 17x array 0.0 ~ 4095.0 */ + .ops = &vvcam_isp_dpf_ctrl_ops, + .id = VVCAM_ISP_CID_DPF_STAT_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_dpf_stat_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, }; int vvcam_isp_dpf_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpf/dpf_v1/vvcam_isp_dpf.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpf/dpf_v1/vvcam_isp_dpf.h index feb15a1..7a04d10 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpf/dpf_v1/vvcam_isp_dpf.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/dpf/dpf_v1/vvcam_isp_dpf.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_DPF_H__ #define __VVCAM_ISP_DPF_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_DPF_ENABLE (VVCAM_ISP_CID_DPF_BASE + 0x0000) #define VVCAM_ISP_CID_DPF_RESET (VVCAM_ISP_CID_DPF_BASE + 0x0001) #define VVCAM_ISP_CID_DPF_MODE (VVCAM_ISP_CID_DPF_BASE + 0x0002) @@ -74,8 +78,18 @@ #define VVCAM_ISP_CID_DPF_MANU_SIGMA_G (VVCAM_ISP_CID_DPF_BASE + 0x0011) #define VVCAM_ISP_CID_DPF_MANU_SIGMA_RB (VVCAM_ISP_CID_DPF_BASE + 0x0012) #define VVCAM_ISP_CID_DPF_MANU_NOISE_CURVE (VVCAM_ISP_CID_DPF_BASE + 0x0013) +#define VVCAM_ISP_CID_DPF_STAT_GAIN (VVCAM_ISP_CID_DPF_BASE + 0x0014) +#define VVCAM_ISP_CID_DPF_STAT_GRADIENT (VVCAM_ISP_CID_DPF_BASE + 0x0015) +#define VVCAM_ISP_CID_DPF_STAT_OFFSET (VVCAM_ISP_CID_DPF_BASE + 0x0016) +#define VVCAM_ISP_CID_DPF_STAT_MIN (VVCAM_ISP_CID_DPF_BASE + 0x0017) +#define VVCAM_ISP_CID_DPF_STAT_DIV (VVCAM_ISP_CID_DPF_BASE + 0x0018) +#define VVCAM_ISP_CID_DPF_STAT_SIGMA_G (VVCAM_ISP_CID_DPF_BASE + 0x0019) +#define VVCAM_ISP_CID_DPF_STAT_SIGMA_RB (VVCAM_ISP_CID_DPF_BASE + 0x001A) +#define VVCAM_ISP_CID_DPF_STAT_NOISE_CURVE (VVCAM_ISP_CID_DPF_BASE + 0x001B) +#ifdef __KERNEL__ int vvcam_isp_dpf_ctrl_count(void); int vvcam_isp_dpf_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif #endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v1/vvcam_isp_ee.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v1/vvcam_isp_ee.c index 5745d31..f783448 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v1/vvcam_isp_ee.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v1/vvcam_isp_ee.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -118,6 +120,12 @@ static int vvcam_isp_ee_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_EE_MANU_UV_GAIN: case VVCAM_ISP_CID_EE_MANU_Y_GAIN_UP: case VVCAM_ISP_CID_EE_MANU_Y_GAIN_DOWN: + case VVCAM_ISP_CID_EE_STAT_EDGE_GAIN: + case VVCAM_ISP_CID_EE_STAT_STRENGTH: + case VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH: + case VVCAM_ISP_CID_EE_STAT_UV_GAIN: + case VVCAM_ISP_CID_EE_STAT_Y_GAIN_UP: + case VVCAM_ISP_CID_EE_STAT_Y_GAIN_DOWN: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -328,6 +336,72 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .max = 65535, .dims = {1, 0, 0, 0}, }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_EDGE_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_edge_gain", + .step = 1, + .min = 0, + .max = 65535, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_src_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_UV_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_uv_gain", + .step = 1, + .min = 0, + .max = 65535, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_Y_GAIN_UP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_y_gain_up", + .step = 1, + .min = 0, + .max = 65535, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_Y_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_y_gain_down", + .step = 1, + .min = 0, + .max = 65535, + .dims = {1, 0, 0, 0}, + }, }; int vvcam_isp_ee_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v1/vvcam_isp_ee.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v1/vvcam_isp_ee.h index 8ec7bc0..b2cb371 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v1/vvcam_isp_ee.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v1/vvcam_isp_ee.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_EE_H__ #define __VVCAM_ISP_EE_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_EE_ENABLE (VVCAM_ISP_CID_EE_BASE + 0x0000) #define VVCAM_ISP_CID_EE_RESET (VVCAM_ISP_CID_EE_BASE + 0x0001) #define VVCAM_ISP_CID_EE_MODE (VVCAM_ISP_CID_EE_BASE + 0x0002) @@ -67,13 +71,20 @@ #define VVCAM_ISP_CID_EE_AUTO_EDGE_GAIN (VVCAM_ISP_CID_EE_BASE + 0x000A) #define VVCAM_ISP_CID_EE_MANU_EDGE_GAIN (VVCAM_ISP_CID_EE_BASE + 0x000B) #define VVCAM_ISP_CID_EE_MANU_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x000C) -#define VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH \ - (VVCAM_ISP_CID_EE_BASE + 0x000D) +#define VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x000D) #define VVCAM_ISP_CID_EE_MANU_UV_GAIN (VVCAM_ISP_CID_EE_BASE + 0x000E) #define VVCAM_ISP_CID_EE_MANU_Y_GAIN_UP (VVCAM_ISP_CID_EE_BASE + 0x000F) #define VVCAM_ISP_CID_EE_MANU_Y_GAIN_DOWN (VVCAM_ISP_CID_EE_BASE + 0x0010) +#define VVCAM_ISP_CID_EE_STAT_EDGE_GAIN (VVCAM_ISP_CID_EE_BASE + 0x0011) +#define VVCAM_ISP_CID_EE_STAT_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x0012) +#define VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x0013) +#define VVCAM_ISP_CID_EE_STAT_UV_GAIN (VVCAM_ISP_CID_EE_BASE + 0x0014) +#define VVCAM_ISP_CID_EE_STAT_Y_GAIN_UP (VVCAM_ISP_CID_EE_BASE + 0x0015) +#define VVCAM_ISP_CID_EE_STAT_Y_GAIN_DOWN (VVCAM_ISP_CID_EE_BASE + 0x0016) +#ifdef __KERNEL__ int vvcam_isp_ee_ctrl_count(void); int vvcam_isp_ee_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v2/vvcam_isp_ee.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v2/vvcam_isp_ee.c index ad0986b..8f2eed9 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v2/vvcam_isp_ee.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v2/vvcam_isp_ee.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -138,6 +140,15 @@ static int vvcam_isp_ee_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_EE_MANU_CA_MODE: case VVCAM_ISP_CID_EE_MANU_CA_CURVE: case VVCAM_ISP_CID_EE_MANU_DCI_CURVE: + case VVCAM_ISP_CID_EE_STAT_EDGE_GAIN: + case VVCAM_ISP_CID_EE_STAT_STRENGTH: + case VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH: + case VVCAM_ISP_CID_EE_STAT_UV_GAIN: + case VVCAM_ISP_CID_EE_STAT_Y_GAIN_UP: + case VVCAM_ISP_CID_EE_STAT_Y_GAIN_DOWN: + case VVCAM_ISP_CID_EE_STAT_CA_MODE: + case VVCAM_ISP_CID_EE_STAT_CA_CURVE: + case VVCAM_ISP_CID_EE_STAT_DCI_CURVE: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -249,7 +260,7 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .name = "isp_ee_auto_strength", .step = 1, .min = 0, - .max = 0xFF, + .max = 128, .dims = {20} }, { @@ -261,7 +272,7 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .name = "isp_ee_auto_src_strength", .step = 1, .min = 0, - .max = 0xFF, + .max = 128, .dims = {20} }, { @@ -273,7 +284,7 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .name = "isp_ee_auto_y_gain_up", .step = 1, .min = 0, - .max = 0xFFFFFFFF, + .max = 65535, .dims = {20} }, { @@ -285,7 +296,7 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .name = "isp_ee_auto_y_gain_down", .step = 1, .min = 0, - .max = 0xFFFFFFFF, + .max = 65535, .dims = {20} }, { @@ -297,7 +308,7 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .name = "isp_ee_auto_uv_gain", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 1024, .dims = {20} }, { @@ -309,7 +320,7 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .name = "isp_ee_auto_edge_gain", .step = 1, .min = 0, - .max = 0xFFFFFFFF, + .max = 65535, .dims = {20} }, { @@ -321,7 +332,7 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .name = "isp_ee_auto_ca_enable_tbl", .step = 1, .min = 0, - .max = 0x1, + .max = 1, .dims = {20}, }, { @@ -333,7 +344,7 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .name = "isp_ee_auto_ca_curve", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 1024, .dims = {20, 65}, }, { @@ -345,7 +356,7 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .name = "isp_ee_auto_dci_enable_tbl", .step = 1, .min = 0, - .max = 0x1, + .max = 1, .dims = {20}, }, { @@ -357,7 +368,7 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .name = "isp_ee_auto_dci_curve", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 1024, .dims = {20, 65}, }, { @@ -460,6 +471,106 @@ const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { .max = 1024, .dims = {65}, }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_EDGE_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_edge_gain", + .step = 1, + .min = 0, + .max = 65535, + .dims = {1}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_src_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_UV_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_uv_gain", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_Y_GAIN_UP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_y_gain_up", + .step = 1, + .min = 0, + .max = 65535, + .dims = {1}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_Y_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_y_gain_down", + .step = 1, + .min = 0, + .max = 65535, + .dims = {1}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_CA_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_ca_mode", + .step = 1, + .min = 0, + .max = 2, + }, + { + /* uint16_t 65x array */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_CA_CURVE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_ca_curve", + .step = 1, + .min = 0, + .max = 1024, + .dims = {65}, + }, + { + /* uint16_t 65x array */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DCI_CURVE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dci_curve", + .step = 1, + .min = 0, + .max = 1024, + .dims = {65}, + }, }; int vvcam_isp_ee_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v2/vvcam_isp_ee.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v2/vvcam_isp_ee.h index c355457..f6dfac8 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v2/vvcam_isp_ee.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v2/vvcam_isp_ee.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_EE_H__ #define __VVCAM_ISP_EE_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_EE_ENABLE (VVCAM_ISP_CID_EE_BASE + 0x0000) #define VVCAM_ISP_CID_EE_RESET (VVCAM_ISP_CID_EE_BASE + 0x0001) #define VVCAM_ISP_CID_EE_ENABLE_CURVE (VVCAM_ISP_CID_EE_BASE + 0x0002) @@ -75,16 +79,26 @@ #define VVCAM_ISP_CID_EE_AUTO_DCI_CURVE (VVCAM_ISP_CID_EE_BASE + 0x0011) #define VVCAM_ISP_CID_EE_MANU_EDGE_GAIN (VVCAM_ISP_CID_EE_BASE + 0x0012) #define VVCAM_ISP_CID_EE_MANU_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x0013) -#define VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH \ - (VVCAM_ISP_CID_EE_BASE + 0x0014) +#define VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x0014) #define VVCAM_ISP_CID_EE_MANU_UV_GAIN (VVCAM_ISP_CID_EE_BASE + 0x0015) #define VVCAM_ISP_CID_EE_MANU_Y_GAIN_UP (VVCAM_ISP_CID_EE_BASE + 0x0016) #define VVCAM_ISP_CID_EE_MANU_Y_GAIN_DOWN (VVCAM_ISP_CID_EE_BASE + 0x0017) #define VVCAM_ISP_CID_EE_MANU_CA_MODE (VVCAM_ISP_CID_EE_BASE + 0x0018) #define VVCAM_ISP_CID_EE_MANU_CA_CURVE (VVCAM_ISP_CID_EE_BASE + 0x0019) #define VVCAM_ISP_CID_EE_MANU_DCI_CURVE (VVCAM_ISP_CID_EE_BASE + 0x001A) +#define VVCAM_ISP_CID_EE_STAT_EDGE_GAIN (VVCAM_ISP_CID_EE_BASE + 0x001B) +#define VVCAM_ISP_CID_EE_STAT_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x001C) +#define VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x001D) +#define VVCAM_ISP_CID_EE_STAT_UV_GAIN (VVCAM_ISP_CID_EE_BASE + 0x001E) +#define VVCAM_ISP_CID_EE_STAT_Y_GAIN_UP (VVCAM_ISP_CID_EE_BASE + 0x001F) +#define VVCAM_ISP_CID_EE_STAT_Y_GAIN_DOWN (VVCAM_ISP_CID_EE_BASE + 0x0020) +#define VVCAM_ISP_CID_EE_STAT_CA_MODE (VVCAM_ISP_CID_EE_BASE + 0x0021) +#define VVCAM_ISP_CID_EE_STAT_CA_CURVE (VVCAM_ISP_CID_EE_BASE + 0x0022) +#define VVCAM_ISP_CID_EE_STAT_DCI_CURVE (VVCAM_ISP_CID_EE_BASE + 0x0023) +#ifdef __KERNEL__ int vvcam_isp_ee_ctrl_count(void); int vvcam_isp_ee_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v3/vvcam_isp_ee.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v3/vvcam_isp_ee.c new file mode 100644 index 0000000..edbcdfb --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v3/vvcam_isp_ee.c @@ -0,0 +1,2063 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_ee.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_ee_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_EE_ENABLE: + case VVCAM_ISP_CID_EE_RESET: + case VVCAM_ISP_CID_EE_CURVE_ENABLE: + case VVCAM_ISP_CID_EE_CA_ENABLE: + case VVCAM_ISP_CID_EE_DEPURPLE_ENABLE: + case VVCAM_ISP_CID_EE_DCI_ENABLE: + case VVCAM_ISP_CID_EE_YUV_DOMAIN_ENABLE: + case VVCAM_ISP_CID_EE_SHARPEN_LIMIT_ENABLE: + case VVCAM_ISP_CID_EE_SKIN_PROC_ENABLE: + case VVCAM_ISP_CID_EE_MODE: + case VVCAM_ISP_CID_EE_AUTO_LEVEL: + case VVCAM_ISP_CID_EE_AUTO_GAIN: + case VVCAM_ISP_CID_EE_AUTO_EE_EN: + case VVCAM_ISP_CID_EE_AUTO_STRENGTH: + case VVCAM_ISP_CID_EE_AUTO_SRC_STRENGTH: + case VVCAM_ISP_CID_EE_AUTO_SRC_STRENGTH_SKIN: + case VVCAM_ISP_CID_EE_AUTO_EDGE_NR_LEVEL: + case VVCAM_ISP_CID_EE_AUTO_DETAIL_LEVEL: + case VVCAM_ISP_CID_EE_AUTO_DETAIL_PRE_ENHANCE_STR: + case VVCAM_ISP_CID_EE_AUTO_SKIN_PROC_EN: + case VVCAM_ISP_CID_EE_AUTO_SKIN_DETECT_STR: + case VVCAM_ISP_CID_EE_AUTO_SHARP_CURVE_LEVEL: + case VVCAM_ISP_CID_EE_AUTO_SHARP_SKIN_CURVE_LEVEL: + case VVCAM_ISP_CID_EE_AUTO_SHARP_UV_GAIN: + case VVCAM_ISP_CID_EE_AUTO_DEPURPLE_EN: + case VVCAM_ISP_CID_EE_AUTO_DPL_LIMIT: + case VVCAM_ISP_CID_EE_AUTO_DPL_DETECT_LUMA_THR: + case VVCAM_ISP_CID_EE_AUTO_DPL_DETECT_LUMA_DIFF: + case VVCAM_ISP_CID_EE_AUTO_DPL_COMP_LUMA_DIFF: + case VVCAM_ISP_CID_EE_AUTO_DPL_SAT_STR: + case VVCAM_ISP_CID_EE_AUTO_DPL_FIX_STR: + case VVCAM_ISP_CID_EE_AUTO_CA_ENABLE: + case VVCAM_ISP_CID_EE_AUTO_CA_LUT_CHROMA_TBL: + case VVCAM_ISP_CID_EE_AUTO_DCI_EN: + case VVCAM_ISP_CID_EE_AUTO_DCI_CURVE: + case VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH: + case VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH_SKIN: + case VVCAM_ISP_CID_EE_MANU_EDGE_NR_LEVEL: + case VVCAM_ISP_CID_EE_MANU_EDGE_SCALER: + case VVCAM_ISP_CID_EE_MANU_EDGE_USE_AUXI_DIR: + case VVCAM_ISP_CID_EE_MANU_DETAIL_LEVEL: + case VVCAM_ISP_CID_EE_MANU_DETAIL_SCALER: + case VVCAM_ISP_CID_EE_MANU_DETAIL_PRE_ENHANCE_STR: + case VVCAM_ISP_CID_EE_MANU_SKIN_DETECT_STR: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_Y_MIN: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_Y_MAX: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CR_MIN: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CR_MAX: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CB_MIN: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CB_MAX: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T0: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T1_SHIFT: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T2: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T3_SHIFT: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T0: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T1_SHIFT: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T2: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T3_SHIFT: + case VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_EDGE: + case VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_DETAIL: + case VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_EDGE_SKIN: + case VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_DETAIL_SKIN: + case VVCAM_ISP_CID_EE_MANU_ENHANCE_STRENGTH: + case VVCAM_ISP_CID_EE_MANU_SHARP_CURVE_LEVEL: + case VVCAM_ISP_CID_EE_MANU_SHARP_SKIN_CURVE_LEVEL: + case VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_UP: + case VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_DOWN: + case VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_SKIN_UP: + case VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_SKIN_DOWN: + case VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_UV: + case VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_TYPE: + case VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_UP: + case VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_DOWN: + case VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_SKIN_UP: + case VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_SKIN_DOWN: + case VVCAM_ISP_CID_EE_MANU_DPL_DETECT_RANGE: + case VVCAM_ISP_CID_EE_MANU_DPL_U_LIMIT_UP: + case VVCAM_ISP_CID_EE_MANU_DPL_U_LIMIT_DOWN: + case VVCAM_ISP_CID_EE_MANU_DPL_V_LIMIT_UP: + case VVCAM_ISP_CID_EE_MANU_DPL_V_LIMIT_DOWN: + case VVCAM_ISP_CID_EE_MANU_DPL_DETECT_LUMA_THR: + case VVCAM_ISP_CID_EE_MANU_DPL_DETECT_LUMA_DIFF: + case VVCAM_ISP_CID_EE_MANU_DPL_COMP_LUMA_DIFF: + case VVCAM_ISP_CID_EE_MANU_DPL_SAT_STR: + case VVCAM_ISP_CID_EE_MANU_DPL_FIX_STR: + case VVCAM_ISP_CID_EE_MANU_CA_LUT_CHROMA_TBL: + case VVCAM_ISP_CID_EE_MANU_CA_MODE: + case VVCAM_ISP_CID_EE_MANU_DCI_DEGAMMA: + case VVCAM_ISP_CID_EE_MANU_DCI_LUT_LUMA_TBL: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_ee_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_EE_ENABLE: + case VVCAM_ISP_CID_EE_RESET: + case VVCAM_ISP_CID_EE_CURVE_ENABLE: + case VVCAM_ISP_CID_EE_CA_ENABLE: + case VVCAM_ISP_CID_EE_DEPURPLE_ENABLE: + case VVCAM_ISP_CID_EE_DCI_ENABLE: + case VVCAM_ISP_CID_EE_YUV_DOMAIN_ENABLE: + case VVCAM_ISP_CID_EE_SHARPEN_LIMIT_ENABLE: + case VVCAM_ISP_CID_EE_SKIN_PROC_ENABLE: + case VVCAM_ISP_CID_EE_MODE: + case VVCAM_ISP_CID_EE_AUTO_LEVEL: + case VVCAM_ISP_CID_EE_AUTO_GAIN: + case VVCAM_ISP_CID_EE_AUTO_EE_EN: + case VVCAM_ISP_CID_EE_AUTO_STRENGTH: + case VVCAM_ISP_CID_EE_AUTO_SRC_STRENGTH: + case VVCAM_ISP_CID_EE_AUTO_SRC_STRENGTH_SKIN: + case VVCAM_ISP_CID_EE_AUTO_EDGE_NR_LEVEL: + case VVCAM_ISP_CID_EE_AUTO_DETAIL_LEVEL: + case VVCAM_ISP_CID_EE_AUTO_DETAIL_PRE_ENHANCE_STR: + case VVCAM_ISP_CID_EE_AUTO_SKIN_PROC_EN: + case VVCAM_ISP_CID_EE_AUTO_SKIN_DETECT_STR: + case VVCAM_ISP_CID_EE_AUTO_SHARP_CURVE_LEVEL: + case VVCAM_ISP_CID_EE_AUTO_SHARP_SKIN_CURVE_LEVEL: + case VVCAM_ISP_CID_EE_AUTO_SHARP_UV_GAIN: + case VVCAM_ISP_CID_EE_AUTO_DEPURPLE_EN: + case VVCAM_ISP_CID_EE_AUTO_DPL_LIMIT: + case VVCAM_ISP_CID_EE_AUTO_DPL_DETECT_LUMA_THR: + case VVCAM_ISP_CID_EE_AUTO_DPL_DETECT_LUMA_DIFF: + case VVCAM_ISP_CID_EE_AUTO_DPL_COMP_LUMA_DIFF: + case VVCAM_ISP_CID_EE_AUTO_DPL_SAT_STR: + case VVCAM_ISP_CID_EE_AUTO_DPL_FIX_STR: + case VVCAM_ISP_CID_EE_AUTO_CA_ENABLE: + case VVCAM_ISP_CID_EE_AUTO_CA_LUT_CHROMA_TBL: + case VVCAM_ISP_CID_EE_AUTO_DCI_EN: + case VVCAM_ISP_CID_EE_AUTO_DCI_CURVE: + case VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH: + case VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH_SKIN: + case VVCAM_ISP_CID_EE_MANU_EDGE_NR_LEVEL: + case VVCAM_ISP_CID_EE_MANU_EDGE_SCALER: + case VVCAM_ISP_CID_EE_MANU_EDGE_USE_AUXI_DIR: + case VVCAM_ISP_CID_EE_MANU_DETAIL_LEVEL: + case VVCAM_ISP_CID_EE_MANU_DETAIL_SCALER: + case VVCAM_ISP_CID_EE_MANU_DETAIL_PRE_ENHANCE_STR: + case VVCAM_ISP_CID_EE_MANU_SKIN_DETECT_STR: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_Y_MIN: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_Y_MAX: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CR_MIN: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CR_MAX: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CB_MIN: + case VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CB_MAX: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T0: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T1_SHIFT: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T2: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T3_SHIFT: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T0: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T1_SHIFT: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T2: + case VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T3_SHIFT: + case VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_EDGE: + case VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_DETAIL: + case VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_EDGE_SKIN: + case VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_DETAIL_SKIN: + case VVCAM_ISP_CID_EE_MANU_ENHANCE_STRENGTH: + case VVCAM_ISP_CID_EE_MANU_SHARP_CURVE_LEVEL: + case VVCAM_ISP_CID_EE_MANU_SHARP_SKIN_CURVE_LEVEL: + case VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_UP: + case VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_DOWN: + case VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_SKIN_UP: + case VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_SKIN_DOWN: + case VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_UV: + case VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_TYPE: + case VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_UP: + case VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_DOWN: + case VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_SKIN_UP: + case VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_SKIN_DOWN: + case VVCAM_ISP_CID_EE_MANU_DPL_DETECT_RANGE: + case VVCAM_ISP_CID_EE_MANU_DPL_U_LIMIT_UP: + case VVCAM_ISP_CID_EE_MANU_DPL_U_LIMIT_DOWN: + case VVCAM_ISP_CID_EE_MANU_DPL_V_LIMIT_UP: + case VVCAM_ISP_CID_EE_MANU_DPL_V_LIMIT_DOWN: + case VVCAM_ISP_CID_EE_MANU_DPL_DETECT_LUMA_THR: + case VVCAM_ISP_CID_EE_MANU_DPL_DETECT_LUMA_DIFF: + case VVCAM_ISP_CID_EE_MANU_DPL_COMP_LUMA_DIFF: + case VVCAM_ISP_CID_EE_MANU_DPL_SAT_STR: + case VVCAM_ISP_CID_EE_MANU_DPL_FIX_STR: + case VVCAM_ISP_CID_EE_MANU_CA_LUT_CHROMA_TBL: + case VVCAM_ISP_CID_EE_MANU_CA_MODE: + case VVCAM_ISP_CID_EE_MANU_DCI_DEGAMMA: + case VVCAM_ISP_CID_EE_MANU_DCI_LUT_LUMA_TBL: + case VVCAM_ISP_CID_EE_STAT_SKIN_PROC_ENABLE: + case VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH: + case VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH_SKIN: + case VVCAM_ISP_CID_EE_STAT_EDGE_NR_LEVEL: + case VVCAM_ISP_CID_EE_STAT_EDGE_SCALER: + case VVCAM_ISP_CID_EE_STAT_EDGE_USE_AUXI_DIR: + case VVCAM_ISP_CID_EE_STAT_DETAIL_LEVEL: + case VVCAM_ISP_CID_EE_STAT_DETAIL_SCALER: + case VVCAM_ISP_CID_EE_STAT_DETAIL_PRE_ENHANCE_STR: + case VVCAM_ISP_CID_EE_STAT_SKIN_DETECT_STR: + case VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_Y_MIN: + case VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_Y_MAX: + case VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CR_MIN: + case VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CR_MAX: + case VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CB_MIN: + case VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CB_MAX: + case VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T0: + case VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T1_SHIFT: + case VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T2: + case VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T3_SHIFT: + case VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T0: + case VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T1_SHIFT: + case VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T2: + case VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T3_SHIFT: + case VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_EDGE: + case VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_DETAIL: + case VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_EDGE_SKIN: + case VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_DETAIL_SKIN: + case VVCAM_ISP_CID_EE_STAT_ENHANCE_STRENGTH: + case VVCAM_ISP_CID_EE_STAT_SHARP_CURVE_LEVEL: + case VVCAM_ISP_CID_EE_STAT_SHARP_SKIN_CURVE_LEVEL: + case VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_UP: + case VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_DOWN: + case VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_SKIN_UP: + case VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_SKIN_DOWN: + case VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_UV: + case VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_TYPE: + case VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_UP: + case VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_DOWN: + case VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_SKIN_UP: + case VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_SKIN_DOWN: + case VVCAM_ISP_CID_EE_STAT_DPL_DETECT_RANGE: + case VVCAM_ISP_CID_EE_STAT_DPL_U_LIMIT_UP: + case VVCAM_ISP_CID_EE_STAT_DPL_U_LIMIT_DOWN: + case VVCAM_ISP_CID_EE_STAT_DPL_V_LIMIT_UP: + case VVCAM_ISP_CID_EE_STAT_DPL_V_LIMIT_DOWN: + case VVCAM_ISP_CID_EE_STAT_DPL_DETECT_LUMA_THR: + case VVCAM_ISP_CID_EE_STAT_DPL_DETECT_LUMA_DIFF: + case VVCAM_ISP_CID_EE_STAT_DPL_COMP_LUMA_DIFF: + case VVCAM_ISP_CID_EE_STAT_DPL_SAT_STR: + case VVCAM_ISP_CID_EE_STAT_DPL_FIX_STR: + case VVCAM_ISP_CID_EE_STAT_CA_LUT_CHROMA_TBL: + case VVCAM_ISP_CID_EE_STAT_CA_MODE: + case VVCAM_ISP_CID_EE_STAT_DCI_DEGAMMA: + case VVCAM_ISP_CID_EE_STAT_DCI_LUT_LUMA_TBL: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_ee_ctrl_ops = { + .s_ctrl = vvcam_isp_ee_s_ctrl, + .g_volatile_ctrl = vvcam_isp_ee_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_ee_ctrls[] = { + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_CURVE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_curve_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_CA_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_ca_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_DEPURPLE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_depurple_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_DCI_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_dci_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_YUV_DOMAIN_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_yuv_domain_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_SHARPEN_LIMIT_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_sharpen_lmt_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_SKIN_PROC_ENABLE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_skin_proc_enable", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + /* manual/auto */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float 20 * 32bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* bool 20 * 32bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_EE_EN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_ee_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20*8bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*8bit 0 ~ 256 */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SRC_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_src_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20*8bit 0 ~ 256 */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SRC_STRENGTH_SKIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_src_strength_skin", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20*8bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_EDGE_NR_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_edge_nr_level", + .step = 1, + .min = 0, + .max = 5, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20*8bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DETAIL_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dtl_level", + .step = 1, + .min = 0, + .max = 7, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*8bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DETAIL_PRE_ENHANCE_STR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dtl_pre_enhance_str", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20*8bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SKIN_PROC_EN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_skin_proc_enable", + .step = 1, + .min = 0, + .max = 7, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20*8bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SKIN_DETECT_STR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_skin_detect_str", + .step = 1, + .min = 0, + .max = 255, + .dims = {20, 0, 0, 0}, + }, + { + /* int16_t array 20*6*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SKIN_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_skin_threshold", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {20, 6, 0, 0}, + }, + { + /* uint16_t array 20*4*8bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_HF_MERGE_CURVE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_hf_merge_curve", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 4, 0, 0}, + }, + { + /* uint16_t array 20*4*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_HF_MERGE_CURVE_SKIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_hf_merge_curve_skin", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 4, 0, 0}, + }, + { + /* uint16_t array 20*2*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_GRAD_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_grad_threshold", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 2, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_GRAD_THRESHOLD_SKIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_grad_threshold_skin", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 2, 0, 0}, + }, + { + /* uint8_t array 20*8bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SHARP_CURVE_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_sharp_crv_lv", + .step = 1, + .min = 0, + .max = 7, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t array 20*8bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SHARP_SKIN_CURVE_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_sharp_skin_crv_lv", + .step = 1, + .min = 0, + .max = 7, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*2*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SHARP_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_sharp_gain", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 2, 0, 0}, + }, + { + /* uint16_t array 20*2*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SHARP_SKIN_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_sharp_skin_gain", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 2, 0, 0}, + }, + { + /* uint8_t array 20*8bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SHARP_UV_GAIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_sharp_uv_gain", + .step = 1, + .min = 0, + .max = 255, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*2*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SHARP_LIMIT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_sharp_lmt", + .step = 1, + .min = 0, + .max = 512, + .dims = {20, 2, 0, 0}, + }, + { + /* uint16_t array 20*2*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_SHARP_SKIN_LIMIT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_sharp_skin_limit", + .step = 1, + .min = 0, + .max = 512, + .dims = {20, 2, 0, 0}, + }, + { + /* bool array 20*32bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DEPURPLE_EN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dpl_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*4*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DPL_LIMIT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dpl_lmt_down", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 4, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DPL_DETECT_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dpl_det_luma_thr", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DPL_DETECT_LUMA_DIFF, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dpl_det_luma_diff", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DPL_COMP_LUMA_DIFF, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dpl_comp_luma_diff", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DPL_SAT_STR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dpl_sat_str", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DPL_FIX_STR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dpl_fix_str", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* bool array 20*32bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_CA_ENABLE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_ca_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*65*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_CA_LUT_CHROMA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_ca_lut_chroma_tbl", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 65, 0, 0}, + }, + { + /* bool array 20*32bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DCI_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dci_enable", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t array 20*65*16bit */ + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_AUTO_DCI_CURVE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_auto_dci_curve", + .step = 1, + .min = 0, + .max = 1024, + .dims = {20, 65, 0, 0}, + }, + + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_src_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH_SKIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_src_strength_skin", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_EDGE_NR_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_edge_nr_level", + .step = 1, + .min = 0, + .max = 5, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_EDGE_SCALER, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_edge_scaler", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_EDGE_USE_AUXI_DIR, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_edge_use_auxi_dir", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DETAIL_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dtl_level", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DETAIL_SCALER, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dtl_scaler", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DETAIL_PRE_ENHANCE_STR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dtl_pre_enhance_str", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SKIN_DETECT_STR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_skin_detect_str", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_Y_MIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_skin_h_thr_y_min", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_Y_MAX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_skin_h_thr_y_max", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CR_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_skin_h_thr_cr_min", + .step = 1, + .min = -1024, + .max = 1023, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CR_MAX, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_skin_h_thr_cr_max", + .step = 1, + .min = -1024, + .max = 1023, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CB_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_skin_h_thr_cb_min", + .step = 1, + .min = -1024, + .max = 1023, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CB_MAX, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_skin_h_thr_cb_max", + .step = 1, + .min = -1024, + .max = 1023, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T0, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_hf_mc_t0", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T1_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_hf_mc_t1_shift", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_hf_mc_t2", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T3_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_hf_mc_t3_shift", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T0, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_hf_mc_skin_t0", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T1_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_hf_mc_skin_t1_shift", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_hf_mc_skin_t2", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T3_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_hf_mc_skin_t3_shift", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_EDGE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_grad_thr_edge", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_DETAIL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_grad_thr_dtl", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_EDGE_SKIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_grad_thr_edge_skin", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_DETAIL_SKIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_grad_thr_dtl_skin", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_ENHANCE_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_enhance_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_CURVE_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_crv_level", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_SKIN_CURVE_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_skin_crv_lvl", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_gain_up", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_gain_down", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_SKIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_skin_gain_up", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_SKIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_skin_gain_dwn", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_UV, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_gain_uv", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_TYPE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_lmt_type", + .step = 1, + .min = 0, + .max = 2, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_lmt_up", + .step = 1, + .min = 0, + .max = 512, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_lmt_down", + .step = 1, + .min = 0, + .max = 512, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_SKIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_lmt_skin_up", + .step = 1, + .min = 0, + .max = 512, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_SKIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_sharp_lmt_skin_down", + .step = 1, + .min = 0, + .max = 512, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DPL_DETECT_RANGE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dpl_detect_range", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DPL_U_LIMIT_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dpl_u_lmt_up", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DPL_U_LIMIT_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dpl_u_lmt_down", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DPL_V_LIMIT_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dpl_v_lmt_up", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DPL_V_LIMIT_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dpl_v_lmt_down", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DPL_DETECT_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dpl_detect_luma_thr", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DPL_DETECT_LUMA_DIFF, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dpl_detect_luma_dif", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DPL_COMP_LUMA_DIFF, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dpl_comp_luma_dif", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DPL_SAT_STR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dpl_sat_str", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DPL_FIX_STR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dpl_fix_str", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_CA_LUT_CHROMA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_ca_lut_chroma_tbl", + .step = 1, + .min = 0, + .max = 1024, + .dims = {65, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_CA_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_ca_mode", + .step = 1, + .min = 0, + .max = 2, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DCI_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dci_degamma", + .step = 1, + .def = 100, + .min = 100, + .max = 400, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_MANU_DCI_LUT_LUMA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_manu_dci_lut_luma_tbl", + .step = 1, + .min = 0, + .max = 1024, + .dims = {65, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SKIN_PROC_ENABLE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_skin_proc_enable", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_src_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH_SKIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_src_strength_skin", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_EDGE_NR_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_edge_nr_level", + .step = 1, + .min = 0, + .max = 5, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_EDGE_SCALER, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_edge_scaler", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_EDGE_USE_AUXI_DIR, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_edge_use_auxi_dir", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DETAIL_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dtl_level", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DETAIL_SCALER, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dtl_scaler", + .step = 1, + .min = 0, + .max = 32, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DETAIL_PRE_ENHANCE_STR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dtl_pre_enhance_str", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SKIN_DETECT_STR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_skin_detect_str", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_Y_MIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_skin_h_thr_y_min", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_Y_MAX, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_skin_h_thr_y_max", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CR_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_skin_h_thr_cr_min", + .step = 1, + .min = -1024, + .max = 1023, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CR_MAX, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_skin_h_thr_cr_max", + .step = 1, + .min = -1024, + .max = 1023, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CB_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_skin_h_thr_cb_min", + .step = 1, + .min = -1024, + .max = 1023, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CB_MAX, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_skin_h_thr_cb_max", + .step = 1, + .min = -1024, + .max = 1023, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T0, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_hf_mc_t0", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T1_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_hf_mc_t1_shift", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_hf_mc_t2", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T3_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_hf_mc_t3_shift", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T0, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_hf_mc_skin_t0", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T1_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_hf_mc_skin_t1_shift", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T2, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_hf_mc_skin_t2", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T3_SHIFT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_hf_mc_skin_t3_shift", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_EDGE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_grad_thr_edge", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_DETAIL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_grad_thr_dtl", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_EDGE_SKIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_grad_thr_edge_skin", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_DETAIL_SKIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_grad_thr_dtl_skin", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_ENHANCE_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_enhance_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_CURVE_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_crv_level", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_SKIN_CURVE_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_skin_crv_lvl", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_gain_up", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_gain_down", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_SKIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_skin_gain_up", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_SKIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_skin_gain_dwn", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_UV, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_gain_uv", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_TYPE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_lmt_type", + .step = 1, + .min = 0, + .max = 2, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_lmt_up", + .step = 1, + .min = 0, + .max = 512, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_lmt_down", + .step = 1, + .min = 0, + .max = 512, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_SKIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_lmt_skin_up", + .step = 1, + .min = 0, + .max = 512, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_SKIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_sharp_lmt_skin_down", + .step = 1, + .min = 0, + .max = 512, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DPL_DETECT_RANGE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dpl_det_range", + .step = 1, + .min = 0, + .max = 7, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DPL_U_LIMIT_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dpl_u_lmt_up", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DPL_U_LIMIT_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dpl_u_lmt_down", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DPL_V_LIMIT_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dpl_v_lmt_up", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DPL_V_LIMIT_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dpl_v_lmt_down", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DPL_DETECT_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dpl_det_luma_thr", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DPL_DETECT_LUMA_DIFF, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dpl_det_luma_diff", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DPL_COMP_LUMA_DIFF, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dpl_comp_luma_diff", + .step = 1, + .min = 0, + .max = 1024, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DPL_SAT_STR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dpl_sat_str", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DPL_FIX_STR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dpl_fix_str", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_CA_LUT_CHROMA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_ca_lut_chroma_tbl", + .step = 1, + .min = 0, + .max = 1024, + .dims = {65, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_CA_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_ca_mode", + .step = 1, + .min = 0, + .max = 2, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DCI_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dci_degamma", + .step = 1, + .def = 100, + .min = 100, + .max = 400, + }, + { + .ops = &vvcam_isp_ee_ctrl_ops, + .id = VVCAM_ISP_CID_EE_STAT_DCI_LUT_LUMA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ee_stat_dci_lut_luma_tbl", + .step = 1, + .min = 0, + .max = 1024, + .dims = {65, 0, 0, 0}, + }, +}; + +int vvcam_isp_ee_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_ee_ctrls); +} + +int vvcam_isp_ee_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_ee_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_ee_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp ee ctrl %s failed %d.\n", + vvcam_isp_ee_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v3/vvcam_isp_ee.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v3/vvcam_isp_ee.h new file mode 100644 index 0000000..3ab2484 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ee/ee_v3/vvcam_isp_ee.h @@ -0,0 +1,323 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_EE_H__ +#define __VVCAM_ISP_EE_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_EE_ENABLE (VVCAM_ISP_CID_EE_BASE + 0x0000) +#define VVCAM_ISP_CID_EE_RESET (VVCAM_ISP_CID_EE_BASE + 0x0001) +#define VVCAM_ISP_CID_EE_CURVE_ENABLE (VVCAM_ISP_CID_EE_BASE + 0x0002) +#define VVCAM_ISP_CID_EE_CA_ENABLE (VVCAM_ISP_CID_EE_BASE + 0x0003) +#define VVCAM_ISP_CID_EE_DEPURPLE_ENABLE (VVCAM_ISP_CID_EE_BASE + 0x0004) +#define VVCAM_ISP_CID_EE_DCI_ENABLE (VVCAM_ISP_CID_EE_BASE + 0x0005) +#define VVCAM_ISP_CID_EE_YUV_DOMAIN_ENABLE (VVCAM_ISP_CID_EE_BASE + 0x0006) +#define VVCAM_ISP_CID_EE_SHARPEN_LIMIT_ENABLE \ + (VVCAM_ISP_CID_EE_BASE + 0x0007) +#define VVCAM_ISP_CID_EE_SKIN_PROC_ENABLE (VVCAM_ISP_CID_EE_BASE + 0x0008) +#define VVCAM_ISP_CID_EE_MODE (VVCAM_ISP_CID_EE_BASE + 0x0009) +#define VVCAM_ISP_CID_EE_AUTO_LEVEL (VVCAM_ISP_CID_EE_BASE + 0x000A) +#define VVCAM_ISP_CID_EE_AUTO_GAIN (VVCAM_ISP_CID_EE_BASE + 0x000B) +#define VVCAM_ISP_CID_EE_AUTO_EE_EN (VVCAM_ISP_CID_EE_BASE + 0x000C) +#define VVCAM_ISP_CID_EE_AUTO_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x000D) +#define VVCAM_ISP_CID_EE_AUTO_SRC_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x000E) +#define VVCAM_ISP_CID_EE_AUTO_SRC_STRENGTH_SKIN \ + (VVCAM_ISP_CID_EE_BASE + 0x000F) +#define VVCAM_ISP_CID_EE_AUTO_EDGE_NR_LEVEL (VVCAM_ISP_CID_EE_BASE + 0x0010) +#define VVCAM_ISP_CID_EE_AUTO_DETAIL_LEVEL (VVCAM_ISP_CID_EE_BASE + 0x0011) +#define VVCAM_ISP_CID_EE_AUTO_DETAIL_PRE_ENHANCE_STR \ + (VVCAM_ISP_CID_EE_BASE + 0x0012) +#define VVCAM_ISP_CID_EE_AUTO_SKIN_PROC_EN (VVCAM_ISP_CID_EE_BASE + 0x0013) +#define VVCAM_ISP_CID_EE_AUTO_SKIN_DETECT_STR \ + (VVCAM_ISP_CID_EE_BASE + 0x0014) +#define VVCAM_ISP_CID_EE_AUTO_SKIN_THRESHOLD \ + (VVCAM_ISP_CID_EE_BASE + 0x0015) +#define VVCAM_ISP_CID_EE_AUTO_HF_MERGE_CURVE \ + (VVCAM_ISP_CID_EE_BASE + 0x0016) +#define VVCAM_ISP_CID_EE_AUTO_HF_MERGE_CURVE_SKIN \ + (VVCAM_ISP_CID_EE_BASE + 0x0017) +#define VVCAM_ISP_CID_EE_AUTO_GRAD_THRESHOLD \ + (VVCAM_ISP_CID_EE_BASE + 0x0018) +#define VVCAM_ISP_CID_EE_AUTO_GRAD_THRESHOLD_SKIN \ + (VVCAM_ISP_CID_EE_BASE + 0x0019) +#define VVCAM_ISP_CID_EE_AUTO_SHARP_CURVE_LEVEL \ + (VVCAM_ISP_CID_EE_BASE + 0x001A) +#define VVCAM_ISP_CID_EE_AUTO_SHARP_SKIN_CURVE_LEVEL \ + (VVCAM_ISP_CID_EE_BASE + 0x001B) +#define VVCAM_ISP_CID_EE_AUTO_SHARP_GAIN (VVCAM_ISP_CID_EE_BASE + 0x001C) +#define VVCAM_ISP_CID_EE_AUTO_SHARP_SKIN_GAIN \ + (VVCAM_ISP_CID_EE_BASE + 0x001D) +#define VVCAM_ISP_CID_EE_AUTO_SHARP_UV_GAIN (VVCAM_ISP_CID_EE_BASE + 0x001E) +#define VVCAM_ISP_CID_EE_AUTO_SHARP_LIMIT (VVCAM_ISP_CID_EE_BASE + 0x001F) +#define VVCAM_ISP_CID_EE_AUTO_SHARP_SKIN_LIMIT \ + (VVCAM_ISP_CID_EE_BASE + 0x0020) +#define VVCAM_ISP_CID_EE_AUTO_DEPURPLE_EN (VVCAM_ISP_CID_EE_BASE + 0x0021) +#define VVCAM_ISP_CID_EE_AUTO_DPL_LIMIT (VVCAM_ISP_CID_EE_BASE + 0x0022) +#define VVCAM_ISP_CID_EE_AUTO_DPL_DETECT_LUMA_THR \ + (VVCAM_ISP_CID_EE_BASE + 0x0023) +#define VVCAM_ISP_CID_EE_AUTO_DPL_DETECT_LUMA_DIFF \ + (VVCAM_ISP_CID_EE_BASE + 0x0024) +#define VVCAM_ISP_CID_EE_AUTO_DPL_COMP_LUMA_DIFF \ + (VVCAM_ISP_CID_EE_BASE + 0x0025) +#define VVCAM_ISP_CID_EE_AUTO_DPL_SAT_STR (VVCAM_ISP_CID_EE_BASE + 0x0026) +#define VVCAM_ISP_CID_EE_AUTO_DPL_FIX_STR (VVCAM_ISP_CID_EE_BASE + 0x0027) +#define VVCAM_ISP_CID_EE_AUTO_CA_ENABLE (VVCAM_ISP_CID_EE_BASE + 0x0028) +#define VVCAM_ISP_CID_EE_AUTO_CA_LUT_CHROMA_TBL \ + (VVCAM_ISP_CID_EE_BASE + 0x0029) +#define VVCAM_ISP_CID_EE_AUTO_DCI_EN (VVCAM_ISP_CID_EE_BASE + 0x002A) +#define VVCAM_ISP_CID_EE_AUTO_DCI_CURVE (VVCAM_ISP_CID_EE_BASE + 0x002B) +#define VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x0040) +#define VVCAM_ISP_CID_EE_MANU_SRC_STRENGTH_SKIN \ + (VVCAM_ISP_CID_EE_BASE + 0x0041) +#define VVCAM_ISP_CID_EE_MANU_EDGE_NR_LEVEL (VVCAM_ISP_CID_EE_BASE + 0x0042) +#define VVCAM_ISP_CID_EE_MANU_EDGE_SCALER (VVCAM_ISP_CID_EE_BASE + 0x0043) +#define VVCAM_ISP_CID_EE_MANU_EDGE_USE_AUXI_DIR \ + (VVCAM_ISP_CID_EE_BASE + 0x0044) +#define VVCAM_ISP_CID_EE_MANU_DETAIL_LEVEL (VVCAM_ISP_CID_EE_BASE + 0x0045) +#define VVCAM_ISP_CID_EE_MANU_DETAIL_SCALER (VVCAM_ISP_CID_EE_BASE + 0x0046) +#define VVCAM_ISP_CID_EE_MANU_DETAIL_PRE_ENHANCE_STR \ + (VVCAM_ISP_CID_EE_BASE + 0x0047) +#define VVCAM_ISP_CID_EE_MANU_SKIN_DETECT_STR \ + (VVCAM_ISP_CID_EE_BASE + 0x0048) +#define VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_Y_MIN \ + (VVCAM_ISP_CID_EE_BASE + 0x0049) +#define VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_Y_MAX \ + (VVCAM_ISP_CID_EE_BASE + 0x004A) +#define VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CR_MIN \ + (VVCAM_ISP_CID_EE_BASE + 0x004B) +#define VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CR_MAX \ + (VVCAM_ISP_CID_EE_BASE + 0x004C) +#define VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CB_MIN \ + (VVCAM_ISP_CID_EE_BASE + 0x004D) +#define VVCAM_ISP_CID_EE_MANU_SKIN_H_THR_CB_MAX \ + (VVCAM_ISP_CID_EE_BASE + 0x004E) +#define VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T0 \ + (VVCAM_ISP_CID_EE_BASE + 0x004F) +#define VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T1_SHIFT \ + (VVCAM_ISP_CID_EE_BASE + 0x0050) +#define VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T2 \ + (VVCAM_ISP_CID_EE_BASE + 0x0051) +#define VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_T3_SHIFT \ + (VVCAM_ISP_CID_EE_BASE + 0x0052) +#define VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T0 \ + (VVCAM_ISP_CID_EE_BASE + 0x0053) +#define VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T1_SHIFT \ + (VVCAM_ISP_CID_EE_BASE + 0x0054) +#define VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T2 \ + (VVCAM_ISP_CID_EE_BASE + 0x0055) +#define VVCAM_ISP_CID_EE_MANU_HF_MERGE_CURVE_SKIN_T3_SHIFT \ + (VVCAM_ISP_CID_EE_BASE + 0x0056) +#define VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_EDGE \ + (VVCAM_ISP_CID_EE_BASE + 0x0057) +#define VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_DETAIL \ + (VVCAM_ISP_CID_EE_BASE + 0x0058) +#define VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_EDGE_SKIN \ + (VVCAM_ISP_CID_EE_BASE + 0x0059) +#define VVCAM_ISP_CID_EE_MANU_CUTOFF_GRAD_THR_DETAIL_SKIN \ + (VVCAM_ISP_CID_EE_BASE + 0x005A) +#define VVCAM_ISP_CID_EE_MANU_ENHANCE_STRENGTH \ + (VVCAM_ISP_CID_EE_BASE + 0x005B) +#define VVCAM_ISP_CID_EE_MANU_SHARP_CURVE_LEVEL \ + (VVCAM_ISP_CID_EE_BASE + 0x005C) +#define VVCAM_ISP_CID_EE_MANU_SHARP_SKIN_CURVE_LEVEL \ + (VVCAM_ISP_CID_EE_BASE + 0x005D) +#define VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_UP (VVCAM_ISP_CID_EE_BASE + 0x005E) +#define VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x005F) +#define VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_SKIN_UP \ + (VVCAM_ISP_CID_EE_BASE + 0x0060) +#define VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_SKIN_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x0061) +#define VVCAM_ISP_CID_EE_MANU_SHARP_GAIN_UV (VVCAM_ISP_CID_EE_BASE + 0x0062) +#define VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_TYPE \ + (VVCAM_ISP_CID_EE_BASE + 0x0063) +#define VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_UP \ + (VVCAM_ISP_CID_EE_BASE + 0x0064) +#define VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x0065) +#define VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_SKIN_UP \ + (VVCAM_ISP_CID_EE_BASE + 0x0066) +#define VVCAM_ISP_CID_EE_MANU_SHARP_LIMIT_SKIN_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x0067) +#define VVCAM_ISP_CID_EE_MANU_DPL_DETECT_RANGE \ + (VVCAM_ISP_CID_EE_BASE + 0x0068) +#define VVCAM_ISP_CID_EE_MANU_DPL_U_LIMIT_UP \ + (VVCAM_ISP_CID_EE_BASE + 0x0069) +#define VVCAM_ISP_CID_EE_MANU_DPL_U_LIMIT_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x006A) +#define VVCAM_ISP_CID_EE_MANU_DPL_V_LIMIT_UP \ + (VVCAM_ISP_CID_EE_BASE + 0x006B) +#define VVCAM_ISP_CID_EE_MANU_DPL_V_LIMIT_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x006C) +#define VVCAM_ISP_CID_EE_MANU_DPL_DETECT_LUMA_THR \ + (VVCAM_ISP_CID_EE_BASE + 0x006D) +#define VVCAM_ISP_CID_EE_MANU_DPL_DETECT_LUMA_DIFF \ + (VVCAM_ISP_CID_EE_BASE + 0x006E) +#define VVCAM_ISP_CID_EE_MANU_DPL_COMP_LUMA_DIFF \ + (VVCAM_ISP_CID_EE_BASE + 0x006F) +#define VVCAM_ISP_CID_EE_MANU_DPL_SAT_STR (VVCAM_ISP_CID_EE_BASE + 0x0070) +#define VVCAM_ISP_CID_EE_MANU_DPL_FIX_STR (VVCAM_ISP_CID_EE_BASE + 0x0071) +#define VVCAM_ISP_CID_EE_MANU_CA_LUT_CHROMA_TBL \ + (VVCAM_ISP_CID_EE_BASE + 0x0072) +#define VVCAM_ISP_CID_EE_MANU_CA_MODE (VVCAM_ISP_CID_EE_BASE + 0x0073) +#define VVCAM_ISP_CID_EE_MANU_DCI_DEGAMMA (VVCAM_ISP_CID_EE_BASE + 0x0074) +#define VVCAM_ISP_CID_EE_MANU_DCI_LUT_LUMA_TBL \ + (VVCAM_ISP_CID_EE_BASE + 0x0075) +#define VVCAM_ISP_CID_EE_STAT_SKIN_PROC_ENABLE \ + (VVCAM_ISP_CID_EE_BASE + 0x007F) +#define VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH (VVCAM_ISP_CID_EE_BASE + 0x0080) +#define VVCAM_ISP_CID_EE_STAT_SRC_STRENGTH_SKIN \ + (VVCAM_ISP_CID_EE_BASE + 0x0081) +#define VVCAM_ISP_CID_EE_STAT_EDGE_NR_LEVEL (VVCAM_ISP_CID_EE_BASE + 0x0082) +#define VVCAM_ISP_CID_EE_STAT_EDGE_SCALER (VVCAM_ISP_CID_EE_BASE + 0x0083) +#define VVCAM_ISP_CID_EE_STAT_EDGE_USE_AUXI_DIR \ + (VVCAM_ISP_CID_EE_BASE + 0x0084) +#define VVCAM_ISP_CID_EE_STAT_DETAIL_LEVEL (VVCAM_ISP_CID_EE_BASE + 0x0085) +#define VVCAM_ISP_CID_EE_STAT_DETAIL_SCALER (VVCAM_ISP_CID_EE_BASE + 0x0086) +#define VVCAM_ISP_CID_EE_STAT_DETAIL_PRE_ENHANCE_STR \ + (VVCAM_ISP_CID_EE_BASE + 0x0087) +#define VVCAM_ISP_CID_EE_STAT_SKIN_DETECT_STR \ + (VVCAM_ISP_CID_EE_BASE + 0x0088) +#define VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_Y_MIN \ + (VVCAM_ISP_CID_EE_BASE + 0x0089) +#define VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_Y_MAX \ + (VVCAM_ISP_CID_EE_BASE + 0x008A) +#define VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CR_MIN \ + (VVCAM_ISP_CID_EE_BASE + 0x008B) +#define VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CR_MAX \ + (VVCAM_ISP_CID_EE_BASE + 0x008C) +#define VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CB_MIN \ + (VVCAM_ISP_CID_EE_BASE + 0x008D) +#define VVCAM_ISP_CID_EE_STAT_SKIN_H_THR_CB_MAX \ + (VVCAM_ISP_CID_EE_BASE + 0x008E) +#define VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T0 \ + (VVCAM_ISP_CID_EE_BASE + 0x008F) +#define VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T1_SHIFT \ + (VVCAM_ISP_CID_EE_BASE + 0x0090) +#define VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T2 \ + (VVCAM_ISP_CID_EE_BASE + 0x0091) +#define VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_T3_SHIFT \ + (VVCAM_ISP_CID_EE_BASE + 0x0092) +#define VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T0 \ + (VVCAM_ISP_CID_EE_BASE + 0x0093) +#define VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T1_SHIFT \ + (VVCAM_ISP_CID_EE_BASE + 0x0094) +#define VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T2 \ + (VVCAM_ISP_CID_EE_BASE + 0x0095) +#define VVCAM_ISP_CID_EE_STAT_HF_MERGE_CURVE_SKIN_T3_SHIFT \ + (VVCAM_ISP_CID_EE_BASE + 0x0096) +#define VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_EDGE \ + (VVCAM_ISP_CID_EE_BASE + 0x0097) +#define VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_DETAIL \ + (VVCAM_ISP_CID_EE_BASE + 0x0098) +#define VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_EDGE_SKIN \ + (VVCAM_ISP_CID_EE_BASE + 0x0099) +#define VVCAM_ISP_CID_EE_STAT_CUTOFF_GRAD_THR_DETAIL_SKIN \ + (VVCAM_ISP_CID_EE_BASE + 0x009A) +#define VVCAM_ISP_CID_EE_STAT_ENHANCE_STRENGTH \ + (VVCAM_ISP_CID_EE_BASE + 0x009B) +#define VVCAM_ISP_CID_EE_STAT_SHARP_CURVE_LEVEL \ + (VVCAM_ISP_CID_EE_BASE + 0x009C) +#define VVCAM_ISP_CID_EE_STAT_SHARP_SKIN_CURVE_LEVEL \ + (VVCAM_ISP_CID_EE_BASE + 0x009D) +#define VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_UP (VVCAM_ISP_CID_EE_BASE + 0x009E) +#define VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x009F) +#define VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_SKIN_UP \ + (VVCAM_ISP_CID_EE_BASE + 0x00A0) +#define VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_SKIN_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x00A1) +#define VVCAM_ISP_CID_EE_STAT_SHARP_GAIN_UV (VVCAM_ISP_CID_EE_BASE + 0x00A2) +#define VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_TYPE \ + (VVCAM_ISP_CID_EE_BASE + 0x00A3) +#define VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_UP \ + (VVCAM_ISP_CID_EE_BASE + 0x00A4) +#define VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x00A5) +#define VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_SKIN_UP \ + (VVCAM_ISP_CID_EE_BASE + 0x00A6) +#define VVCAM_ISP_CID_EE_STAT_SHARP_LIMIT_SKIN_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x00A7) +#define VVCAM_ISP_CID_EE_STAT_DPL_DETECT_RANGE \ + (VVCAM_ISP_CID_EE_BASE + 0x00A8) +#define VVCAM_ISP_CID_EE_STAT_DPL_U_LIMIT_UP \ + (VVCAM_ISP_CID_EE_BASE + 0x00A9) +#define VVCAM_ISP_CID_EE_STAT_DPL_U_LIMIT_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x00AA) +#define VVCAM_ISP_CID_EE_STAT_DPL_V_LIMIT_UP \ + (VVCAM_ISP_CID_EE_BASE + 0x00AB) +#define VVCAM_ISP_CID_EE_STAT_DPL_V_LIMIT_DOWN \ + (VVCAM_ISP_CID_EE_BASE + 0x00AC) +#define VVCAM_ISP_CID_EE_STAT_DPL_DETECT_LUMA_THR \ + (VVCAM_ISP_CID_EE_BASE + 0x00AD) +#define VVCAM_ISP_CID_EE_STAT_DPL_DETECT_LUMA_DIFF \ + (VVCAM_ISP_CID_EE_BASE + 0x00AE) +#define VVCAM_ISP_CID_EE_STAT_DPL_COMP_LUMA_DIFF \ + (VVCAM_ISP_CID_EE_BASE + 0x00AF) +#define VVCAM_ISP_CID_EE_STAT_DPL_SAT_STR (VVCAM_ISP_CID_EE_BASE + 0x00B0) +#define VVCAM_ISP_CID_EE_STAT_DPL_FIX_STR (VVCAM_ISP_CID_EE_BASE + 0x00B1) +#define VVCAM_ISP_CID_EE_STAT_CA_LUT_CHROMA_TBL \ + (VVCAM_ISP_CID_EE_BASE + 0x00B2) +#define VVCAM_ISP_CID_EE_STAT_CA_MODE (VVCAM_ISP_CID_EE_BASE + 0x00B3) +#define VVCAM_ISP_CID_EE_STAT_DCI_DEGAMMA (VVCAM_ISP_CID_EE_BASE + 0x00B4) +#define VVCAM_ISP_CID_EE_STAT_DCI_LUT_LUMA_TBL \ + (VVCAM_ISP_CID_EE_BASE + 0x00B5) +#ifdef __KERNEL__ +int vvcam_isp_ee_ctrl_count(void); +int vvcam_isp_ee_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v2/vvcam_isp_exp.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v2/vvcam_isp_exp.c index 757f94b..0b820d4 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v2/vvcam_isp_exp.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v2/vvcam_isp_exp.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v2/vvcam_isp_exp.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v2/vvcam_isp_exp.h index 5b14a91..0a4fa18 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v2/vvcam_isp_exp.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v2/vvcam_isp_exp.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_EXP_H__ #define __VVCAM_ISP_EXP_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_EXP_ENABLE (VVCAM_ISP_CID_EXP_BASE + 0x0000) #define VVCAM_ISP_CID_EXP_RESET (VVCAM_ISP_CID_EXP_BASE + 0x0001) #define VVCAM_ISP_CID_EXP_R_WEIGHT (VVCAM_ISP_CID_EXP_BASE + 0x0002) @@ -66,7 +70,9 @@ #define VVCAM_ISP_CID_EXP_STATISTIC (VVCAM_ISP_CID_EXP_BASE + 0x0009) #define VVCAM_ISP_CID_EXP_STATISTIC_TYPE (VVCAM_ISP_CID_EXP_BASE + 0x000A) +#ifdef __KERNEL__ int vvcam_isp_exp_ctrl_count(void); int vvcam_isp_exp_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v3/vvcam_isp_exp_v3.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v3/vvcam_isp_exp_v3.c new file mode 100644 index 0000000..fd186ae --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v3/vvcam_isp_exp_v3.c @@ -0,0 +1,193 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_exp_v3.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_exp_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_EXP_V3_ENABLE: + case VVCAM_ISP_CID_EXP_V3_AUTO_STOP: + case VVCAM_ISP_CID_EXP_V3_INPUT_SELECT: + case VVCAM_ISP_CID_EXP_V3_MEASURE_WINDOW: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_exp_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_EXP_V3_ENABLE: + case VVCAM_ISP_CID_EXP_V3_AUTO_STOP: + case VVCAM_ISP_CID_EXP_V3_INPUT_SELECT: + case VVCAM_ISP_CID_EXP_V3_MEASURE_WINDOW: + case VVCAM_ISP_CID_EXP_V3_STATISTIC: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_exp_v3_ctrl_ops = { + .s_ctrl = vvcam_isp_exp_s_ctrl, + .g_volatile_ctrl = vvcam_isp_exp_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_exp_v3_ctrls[] = { + { + .ops = &vvcam_isp_exp_v3_ctrl_ops, + .id = VVCAM_ISP_CID_EXP_V3_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_exp_v3_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_exp_v3_ctrl_ops, + .id = VVCAM_ISP_CID_EXP_V3_INPUT_SELECT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_exp_v3_input_select", + .step = 1, + .min = 1, + .max = 4, + .def = 1, + }, + { + .ops = &vvcam_isp_exp_v3_ctrl_ops, + .id = VVCAM_ISP_CID_EXP_V3_AUTO_STOP, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_exp_v3_auto_stop", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint16_t array 25x4x16bit */ + .ops = &vvcam_isp_exp_v3_ctrl_ops, + .id = VVCAM_ISP_CID_EXP_V3_MEASURE_WINDOW, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_exp_v3_measure_window", + .step = 1, + .min = 0, + .max = 65535, + .dims = {25, 4, 0, 0}, + }, + { + /* uint32_t array 25*2*32bit */ + .ops = &vvcam_isp_exp_v3_ctrl_ops, + .id = VVCAM_ISP_CID_EXP_V3_STATISTIC, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_exp_v3_statistic", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {50, 0, 0, 0}, + }, +}; + +int vvcam_isp_exp_v3_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_exp_v3_ctrls); +} + +int vvcam_isp_exp_v3_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_exp_v3_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_exp_v3_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp exp ctrl %s failed %d.\n", + vvcam_isp_exp_v3_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v3/vvcam_isp_exp_v3.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v3/vvcam_isp_exp_v3.h new file mode 100644 index 0000000..4a6a89c --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/exp/exp_v3/vvcam_isp_exp_v3.h @@ -0,0 +1,72 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_EXP_V3_H__ +#define __VVCAM_ISP_EXP_V3_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_EXP_V3_ENABLE (VVCAM_ISP_CID_EXP_V3_BASE + 0x0000) +#define VVCAM_ISP_CID_EXP_V3_AUTO_STOP (VVCAM_ISP_CID_EXP_V3_BASE + 0x0001) +#define VVCAM_ISP_CID_EXP_V3_INPUT_SELECT (VVCAM_ISP_CID_EXP_V3_BASE + 0x0002) +#define VVCAM_ISP_CID_EXP_V3_MEASURE_WINDOW (VVCAM_ISP_CID_EXP_V3_BASE + 0x0003) +#define VVCAM_ISP_CID_EXP_V3_STATISTIC (VVCAM_ISP_CID_EXP_V3_BASE + 0x0004) + +#ifdef __KERNEL__ +int vvcam_isp_exp_v3_ctrl_count(void); +int vvcam_isp_exp_v3_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v1/vvcam_isp_gc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v1/vvcam_isp_gc.c index 95b8cff..ad1396c 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v1/vvcam_isp_gc.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v1/vvcam_isp_gc.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -96,6 +98,10 @@ static int vvcam_isp_gc_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_GC_MANU_STD_VAL: case VVCAM_ISP_CID_GC_MANU_CURVE: case VVCAM_ISP_CID_GC_MANU_CURVE_MODE: + case VVCAM_ISP_CID_GC_STAT_USE_STD: + case VVCAM_ISP_CID_GC_STAT_STD_VAL: + case VVCAM_ISP_CID_GC_STAT_CURVE: + case VVCAM_ISP_CID_GC_STAT_CURVE_MODE: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -178,6 +184,51 @@ const struct v4l2_ctrl_config vvcam_isp_gc_ctrls[] = { .min = 0, .max = 1, }, + { + .ops = &vvcam_isp_gc_ctrl_ops, + .id = VVCAM_ISP_CID_GC_STAT_USE_STD, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gc_stat_use_std", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float 1.0 ~ 4.0 */ + .ops = &vvcam_isp_gc_ctrl_ops, + .id = VVCAM_ISP_CID_GC_STAT_STD_VAL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gc_stat_std_val", + .step = 1, + .min = 100, + .max = 400, + .def = 220, + }, + { + /* uint16_t 17*16bit */ + .ops = &vvcam_isp_gc_ctrl_ops, + .id = VVCAM_ISP_CID_GC_STAT_CURVE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gc_stat_curve", + .step = 1, + .min = 0, + .max = 1023, + .dims = {17, 0, 0, 0}, + }, + { + /* uint32_t array 64*32bit */ + .ops = &vvcam_isp_gc_ctrl_ops, + .id = VVCAM_ISP_CID_GC_STAT_CURVE_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gc_stat_curve_mode", + .step = 1, + .min = 0, + .max = 1, + }, }; int vvcam_isp_gc_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v1/vvcam_isp_gc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v1/vvcam_isp_gc.h index 400bd52..d7bc5dc 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v1/vvcam_isp_gc.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v1/vvcam_isp_gc.h @@ -1,67 +1,77 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_GC_H__ #define __VVCAM_ISP_GC_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_GC_ENABLE (VVCAM_ISP_CID_GC_BASE + 0x0000) #define VVCAM_ISP_CID_GC_RESET (VVCAM_ISP_CID_GC_BASE + 0x0001) #define VVCAM_ISP_CID_GC_MANU_USE_STD (VVCAM_ISP_CID_GC_BASE + 0x0002) #define VVCAM_ISP_CID_GC_MANU_STD_VAL (VVCAM_ISP_CID_GC_BASE + 0x0003) #define VVCAM_ISP_CID_GC_MANU_CURVE (VVCAM_ISP_CID_GC_BASE + 0x0004) #define VVCAM_ISP_CID_GC_MANU_CURVE_MODE (VVCAM_ISP_CID_GC_BASE + 0x0005) +#define VVCAM_ISP_CID_GC_STAT_USE_STD (VVCAM_ISP_CID_GC_BASE + 0x0006) +#define VVCAM_ISP_CID_GC_STAT_STD_VAL (VVCAM_ISP_CID_GC_BASE + 0x0007) +#define VVCAM_ISP_CID_GC_STAT_CURVE (VVCAM_ISP_CID_GC_BASE + 0x0008) +#define VVCAM_ISP_CID_GC_STAT_CURVE_MODE (VVCAM_ISP_CID_GC_BASE + 0x0009) +#ifdef __KERNEL__ int vvcam_isp_gc_ctrl_count(void); int vvcam_isp_gc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v2/vvcam_isp_gc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v2/vvcam_isp_gc.c index 9fe788f..69bf97b 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v2/vvcam_isp_gc.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v2/vvcam_isp_gc.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -105,6 +107,11 @@ static int vvcam_isp_gc_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_GC_MANU_CURVE: case VVCAM_ISP_CID_GC_MANU_USER_X: case VVCAM_ISP_CID_GC_MANU_CURVE_X: + case VVCAM_ISP_CID_GC_STAT_USE_STD: + case VVCAM_ISP_CID_GC_STAT_STD_VAL: + case VVCAM_ISP_CID_GC_STAT_CURVE: + case VVCAM_ISP_CID_GC_STAT_USER_X: + case VVCAM_ISP_CID_GC_STAT_CURVE_X: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -186,7 +193,7 @@ const struct v4l2_ctrl_config vvcam_isp_gc_ctrls[] = { .name = "isp_gc_auto_curve", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 1023, .dims = {20, 64, 0, 0} }, { @@ -245,6 +252,62 @@ const struct v4l2_ctrl_config vvcam_isp_gc_ctrls[] = { .max = 12, .dims = {64}, }, + { + .ops = &vvcam_isp_gc_ctrl_ops, + .id = VVCAM_ISP_CID_GC_STAT_USE_STD, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gc_stat_use_std", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float 1.0 ~ 4.0 */ + .ops = &vvcam_isp_gc_ctrl_ops, + .id = VVCAM_ISP_CID_GC_STAT_STD_VAL, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gc_stat_std_val", + .step = 1, + .min = 100, + .max = 400, + .def = 220, + }, + { + /* uint16_t 64*16bit */ + .ops = &vvcam_isp_gc_ctrl_ops, + .id = VVCAM_ISP_CID_GC_STAT_CURVE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gc_stat_curve", + .step = 1, + .min = 0, + .max = 1023, + .dims = {64}, + }, + { + .ops = &vvcam_isp_gc_ctrl_ops, + .id = VVCAM_ISP_CID_GC_STAT_USER_X, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gc_stat_use_user_x", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint32_t array 64*32bit */ + .ops = &vvcam_isp_gc_ctrl_ops, + .id = VVCAM_ISP_CID_GC_STAT_CURVE_X, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gc_stat_curve_x", + .step = 1, + .min = 0, + .max = 12, + .dims = {64}, + }, }; int vvcam_isp_gc_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v2/vvcam_isp_gc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v2/vvcam_isp_gc.h index 90dce88..3cbe8aa 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v2/vvcam_isp_gc.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gc/gc_v2/vvcam_isp_gc.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_GC_H__ #define __VVCAM_ISP_GC_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_GC_ENABLE (VVCAM_ISP_CID_GC_BASE + 0x0000) #define VVCAM_ISP_CID_GC_RESET (VVCAM_ISP_CID_GC_BASE + 0x0001) #define VVCAM_ISP_CID_GC_MODE (VVCAM_ISP_CID_GC_BASE + 0x0002) @@ -65,8 +69,15 @@ #define VVCAM_ISP_CID_GC_MANU_CURVE (VVCAM_ISP_CID_GC_BASE + 0x0008) #define VVCAM_ISP_CID_GC_MANU_USER_X (VVCAM_ISP_CID_GC_BASE + 0x0009) #define VVCAM_ISP_CID_GC_MANU_CURVE_X (VVCAM_ISP_CID_GC_BASE + 0x000A) +#define VVCAM_ISP_CID_GC_STAT_USE_STD (VVCAM_ISP_CID_GC_BASE + 0x000B) +#define VVCAM_ISP_CID_GC_STAT_STD_VAL (VVCAM_ISP_CID_GC_BASE + 0x000C) +#define VVCAM_ISP_CID_GC_STAT_CURVE (VVCAM_ISP_CID_GC_BASE + 0x000D) +#define VVCAM_ISP_CID_GC_STAT_USER_X (VVCAM_ISP_CID_GC_BASE + 0x000E) +#define VVCAM_ISP_CID_GC_STAT_CURVE_X (VVCAM_ISP_CID_GC_BASE + 0x000F) +#ifdef __KERNEL__ int vvcam_isp_gc_ctrl_count(void); int vvcam_isp_gc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ge/ge/vvcam_isp_ge.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ge/ge/vvcam_isp_ge.c index f637b69..beee7b4 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ge/ge/vvcam_isp_ge.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ge/ge/vvcam_isp_ge.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ge/ge/vvcam_isp_ge.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ge/ge/vvcam_isp_ge.h index 65e232c..57c6f66 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ge/ge/vvcam_isp_ge.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ge/ge/vvcam_isp_ge.h @@ -1,64 +1,71 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_GE_H__ #define __VVCAM_ISP_GE_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_GE_ENABLE (VVCAM_ISP_CID_GE_BASE + 0x0000) #define VVCAM_ISP_CID_GE_RESET (VVCAM_ISP_CID_GE_BASE + 0x0001) #define VVCAM_ISP_CID_GE_THRESHOLD (VVCAM_ISP_CID_GE_BASE + 0x0002) + +#ifdef __KERNEL__ int vvcam_isp_ge_ctrl_count(void); int vvcam_isp_ge_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif #endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gtm/gtm_v1/vvcam_isp_gtm.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gtm/gtm_v1/vvcam_isp_gtm.c index fc4aa49..3b93204 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gtm/gtm_v1/vvcam_isp_gtm.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gtm/gtm_v1/vvcam_isp_gtm.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -71,7 +73,7 @@ static int vvcam_isp_gtm_s_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_GTM_MODE: case VVCAM_ISP_CID_GTM_AUTO_LEVEL: case VVCAM_ISP_CID_GTM_AUTO_GAIN: - case VVCAM_ISP_CID_GTM_AUTO_CURVE_SELECT: + case VVCAM_ISP_CID_GTM_AUTO_USER_CURVE_ENABLE: case VVCAM_ISP_CID_GTM_AUTO_BW_CORRECTION_MIN_LOG: case VVCAM_ISP_CID_GTM_AUTO_BW_CORRECTION_MAX_LOG: case VVCAM_ISP_CID_GTM_AUTO_HIST_CONTRAST_LIMIT_LEVEL: @@ -140,7 +142,7 @@ static int vvcam_isp_gtm_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_GTM_MODE: case VVCAM_ISP_CID_GTM_AUTO_LEVEL: case VVCAM_ISP_CID_GTM_AUTO_GAIN: - case VVCAM_ISP_CID_GTM_AUTO_CURVE_SELECT: + case VVCAM_ISP_CID_GTM_AUTO_USER_CURVE_ENABLE: case VVCAM_ISP_CID_GTM_AUTO_BW_CORRECTION_MIN_LOG: case VVCAM_ISP_CID_GTM_AUTO_BW_CORRECTION_MAX_LOG: case VVCAM_ISP_CID_GTM_AUTO_HIST_CONTRAST_LIMIT_LEVEL: @@ -184,6 +186,22 @@ static int vvcam_isp_gtm_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_GTM_HIST_STATISTIC_MIN: case VVCAM_ISP_CID_GTM_HIST_STATISTIC_MAX: case VVCAM_ISP_CID_GTM_HIST_STATISTIC_DATA: + case VVCAM_ISP_CID_GTM_STAT_RGB_COEF: + case VVCAM_ISP_CID_GTM_STAT_LIGHTNESS_WEIGHT: + case VVCAM_ISP_CID_GTM_STAT_COLOR_WEIGHT: + case VVCAM_ISP_CID_GTM_STAT_BW_COR_MODE: + case VVCAM_ISP_CID_GTM_STAT_BW_COR_MIN_LOG: + case VVCAM_ISP_CID_GTM_STAT_BW_COR_MAX_LOG: + case VVCAM_ISP_CID_GTM_STAT_BW_COR_DAMP_COEF: + case VVCAM_ISP_CID_GTM_STAT_CURVE_SELECT: + case VVCAM_ISP_CID_GTM_STAT_CURVE_SHIFT_BIT: + case VVCAM_ISP_CID_GTM_STAT_PWL_KNEE_X_LOG: + case VVCAM_ISP_CID_GTM_STAT_PWL_KNEE_Y_LOG: + case VVCAM_ISP_CID_GTM_STAT_PWL_MAX_LOG: + case VVCAM_ISP_CID_GTM_STAT_PWL_MIN_LOG: + case VVCAM_ISP_CID_GTM_STAT_LOG_KNEE_X_LOG: + case VVCAM_ISP_CID_GTM_STAT_LOG_KNEE_SLOPE: + case VVCAM_ISP_CID_GTM_STAT_USER_CURVE: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -266,16 +284,6 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .max = 0xFFFFFFFF, .dims = {20, 0, 0, 0}, }, - { - .ops = &vvcam_isp_gtm_ctrl_ops, - .id = VVCAM_ISP_CID_GTM_AUTO_CURVE_SELECT, - .type = V4L2_CTRL_TYPE_INTEGER, - .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_curve_select", - .step = 1, - .min = 0, - .max = 3, - }, { /* uint8_t array 20x */ .ops = &vvcam_isp_gtm_ctrl_ops, @@ -285,7 +293,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .name = "isp_gtm_auto_bw_cor_min_log", .step = 1, .min = 0, - .max = 128, + .max = 24, .dims = {20, 0, 0, 0}, }, { @@ -297,7 +305,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .name = "isp_gtm_auto_bw_cor_max_log", .step = 1, .min = 0, - .max = 128, + .max = 24, .dims = {20, 0, 0, 0}, }, { @@ -306,7 +314,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_HIST_CONTRAST_LIMIT_LEVEL, .type = V4L2_CTRL_TYPE_U8, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_hist_cll", + .name = "isp_gtm_auto_hist_con_lmt_lvl", .step = 1, .min = 0, .max = 16, @@ -318,7 +326,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_HIST_HLC_FACTOR, .type = V4L2_CTRL_TYPE_U32, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_hist_hf", + .name = "isp_gtm_auto_hist_hlc_fac", .step = 1, .min = 0, .max = 0xFFFFFFFF, @@ -330,7 +338,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_HIST_LUMA_PRESERVE_WEIGHT, .type = V4L2_CTRL_TYPE_U32, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_hist_lpw", + .name = "isp_gtm_auto_hist_luma_pres_wt", .step = 1, .min = 0, .max = 0xFFFFFFFF, @@ -342,7 +350,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_HIST_MAX_GAIN, .type = V4L2_CTRL_TYPE_U32, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_hist_maxg", + .name = "isp_gtm_auto_hist_max_gain", .step = 1, .min = 0, .max = 0xFFFFFFFF, @@ -354,7 +362,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_HIST_MIN_GAIN, .type = V4L2_CTRL_TYPE_U32, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_hist_ming", + .name = "isp_gtm_auto_hist_min_gain", .step = 1, .min = 0, .max = 0xFFFFFFFF, @@ -400,7 +408,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { // uint32_t array 20x129 0~1048575 .ops = &vvcam_isp_gtm_ctrl_ops, .id = VVCAM_ISP_CID_GTM_AUTO_USER_CURVE, - .type = V4L2_CTRL_TYPE_U16, + .type = V4L2_CTRL_TYPE_U32, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_gtm_auto_user_curve", .step = 1, @@ -420,14 +428,13 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { }, { .ops = &vvcam_isp_gtm_ctrl_ops, - .id = VVCAM_ISP_CID_GTM_AUTO_EDR_LEVEL, - .type = V4L2_CTRL_TYPE_U8, + .id = VVCAM_ISP_CID_GTM_AUTO_USER_CURVE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_edr_level", + .name = "isp_gtm_auto_user_curve_enable", .step = 1, .min = 0, - .max = 20, - .dims = {1, 0, 0, 0}, + .max = 1, }, { .ops = &vvcam_isp_gtm_ctrl_ops, @@ -458,7 +465,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_LUMA_WEIGHT, .type = V4L2_CTRL_TYPE_U16, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_curve_hist_lw", + .name = "isp_gtm_auto_curve_hist_luma_wt", .step = 1, .min = 0, .max = 1024, @@ -470,10 +477,10 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_HLC_FACTOR, .type = V4L2_CTRL_TYPE_INTEGER, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_curve_hist_hf", + .name = "isp_gtm_auto_curve_hist_hlc_fac", .step = 1, .min = 0, - .max = 100, + .max = 1000, }, { /* float 0.0 ~ 1.0 */ @@ -484,7 +491,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .name = "isp_gtm_auto_curve_hist_lpw", .step = 1, .min = 0, - .max = 10, + .max = 100, }, { /* float 0.0 ~ 1.0 */ @@ -492,10 +499,10 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_COMPRESS_WEIGHT, .type = V4L2_CTRL_TYPE_INTEGER, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_curve_hist_cw", + .name = "isp_gtm_auto_curve_hist_comp_wt", .step = 1, .min = 0, - .max = 10, + .max = 100, }, { /* float 0.0 ~ 1048575.0 */ @@ -503,10 +510,10 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_MAX_GAIN, .type = V4L2_CTRL_TYPE_INTEGER, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_curve_hist_maxg", + .name = "isp_gtm_auto_curve_hist_max_g", .step = 1, .min = 0, - .max = 10485750, + .max = 104857500, }, { /* float 0.0 ~ 1048575.0 */ @@ -514,10 +521,10 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_MIN_GAIN, .type = V4L2_CTRL_TYPE_INTEGER, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_curve_hist_ming", + .name = "isp_gtm_auto_curve_hist_min_g", .step = 1, .min = 0, - .max = 10485750, + .max = 104857500, }, { /* float 0.0 ~ 1.0 */ @@ -528,7 +535,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .name = "isp_gtm_auto_curve_hist_str", .step = 1, .min = 0, - .max = 10, + .max = 100, }, { /* float 0.0 ~ 1.0 */ @@ -536,10 +543,21 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .id = VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_DAMP_COEF, .type = V4L2_CTRL_TYPE_INTEGER, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gtm_auto_curve_hist_dc", + .name = "isp_gtm_auto_curve_hist_damp_c", .step = 1, .min = 0, - .max = 10, + .max = 100, + }, + { + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_AUTO_EDR_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_auto_edr_level", + .step = 1, + .min = 0, + .max = 20, + .dims = {1, 0, 0, 0}, }, { /* float 20x */ @@ -550,7 +568,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .name = "isp_gtm_auto_edr", .step = 1, .min = 0, - .max = 128, + .max = 0xFFFFFFFF, .dims = {20, 0, 0, 0}, }, { @@ -738,6 +756,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .step = 1, .min = 0, .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, }, { .ops = &vvcam_isp_gtm_ctrl_ops, @@ -748,6 +767,7 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .step = 1, .min = 0, .max = 0xFFFFFFFF, + .dims = {1, 0, 0, 0}, }, { /* uint32_t array 128x */ @@ -761,6 +781,182 @@ const struct v4l2_ctrl_config vvcam_isp_gtm_ctrls[] = { .max = 0xFFFFFFFF, .dims = {128, 0, 0, 0}, }, + { + /* uint8_t 3x */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_RGB_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_rgb_coef", + .step = 1, + .min = 0, + .max = 128, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_LIGHTNESS_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_lightness_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 3x */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_color_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {3, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_BW_COR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_bw_cor_mode", + .step = 1, + .min = 0, + .max = 2, + }, + { + /* double 0.0 ~ 24.0 */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_BW_COR_MIN_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_bw_cor_min_log", + .step = 1, + .min = 0, + .max = 240, + }, + { + /* double 0.0 ~ 24.0 */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_BW_COR_MAX_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_bw_cor_max_log", + .step = 1, + .min = 0, + .max = 240, + }, + { + /* double 0.0 ~ 1.0 */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_BW_COR_DAMP_COEF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_bw_cor_damp_coef", + .step = 1, + .min = 0, + .max = 10, + }, + { + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_CURVE_SELECT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_curve_select", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_CURVE_SHIFT_BIT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_curve_shift_bit", + .step = 1, + .min = 0, + .max = 4, + }, + { + /* double 0~24.0 */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_PWL_KNEE_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_pwl_knee_x_log", + .step = 1, + .min = 0, + .max = 240, + }, + { + /* double 0~20.0 */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_PWL_KNEE_Y_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_pwl_knee_y_log", + .step = 1, + .min = 0, + .max = 200, + }, + { + /* double 0~24.0 */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_PWL_MAX_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_pwl_max_log", + .step = 1, + .min = 0, + .max = 240, + }, + { + /* double 0~24.0 */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_PWL_MIN_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_pwl_min_log", + .step = 1, + .min = 0, + .max = 240, + }, + { + /* float 0~24.0 */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_LOG_KNEE_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_log_knee_x_log", + .step = 1, + .min = 0, + .max = 240, + }, + { + /* float 0~24.0 */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_LOG_KNEE_SLOPE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_log_knee_slope", + .step = 1, + .min = 0, + .max = 240, + }, + { + /* uint32_t array 129x */ + .ops = &vvcam_isp_gtm_ctrl_ops, + .id = VVCAM_ISP_CID_GTM_STAT_USER_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gtm_stat_user_curve", + .step = 1, + .min = 0, + .max = 1048575, + .dims = {129, 0, 0, 0}, + }, }; int vvcam_isp_gtm_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gtm/gtm_v1/vvcam_isp_gtm.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gtm/gtm_v1/vvcam_isp_gtm.h index 8a51ff2..463b646 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gtm/gtm_v1/vvcam_isp_gtm.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gtm/gtm_v1/vvcam_isp_gtm.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_GTM_H__ #define __VVCAM_ISP_GTM_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_GTM_ENABLE (VVCAM_ISP_CID_GTM_BASE + 0x0000) #define VVCAM_ISP_CID_GTM_BW_CORRECTION_ENABLE \ (VVCAM_ISP_CID_GTM_BASE + 0x0001) @@ -61,49 +65,50 @@ #define VVCAM_ISP_CID_GTM_MODE (VVCAM_ISP_CID_GTM_BASE + 0x0003) #define VVCAM_ISP_CID_GTM_AUTO_LEVEL (VVCAM_ISP_CID_GTM_BASE + 0x0004) #define VVCAM_ISP_CID_GTM_AUTO_GAIN (VVCAM_ISP_CID_GTM_BASE + 0x0005) -#define VVCAM_ISP_CID_GTM_AUTO_CURVE_SELECT (VVCAM_ISP_CID_GTM_BASE + 0x0006) #define VVCAM_ISP_CID_GTM_AUTO_BW_CORRECTION_MIN_LOG \ - (VVCAM_ISP_CID_GTM_BASE + 0x0007) + (VVCAM_ISP_CID_GTM_BASE + 0x0006) #define VVCAM_ISP_CID_GTM_AUTO_BW_CORRECTION_MAX_LOG \ - (VVCAM_ISP_CID_GTM_BASE + 0x0008) + (VVCAM_ISP_CID_GTM_BASE + 0x0007) #define VVCAM_ISP_CID_GTM_AUTO_HIST_CONTRAST_LIMIT_LEVEL \ - (VVCAM_ISP_CID_GTM_BASE + 0x0009) + (VVCAM_ISP_CID_GTM_BASE + 0x0008) #define VVCAM_ISP_CID_GTM_AUTO_HIST_HLC_FACTOR \ - (VVCAM_ISP_CID_GTM_BASE + 0x000A) + (VVCAM_ISP_CID_GTM_BASE + 0x0009) #define VVCAM_ISP_CID_GTM_AUTO_HIST_LUMA_PRESERVE_WEIGHT \ - (VVCAM_ISP_CID_GTM_BASE + 0x000B) + (VVCAM_ISP_CID_GTM_BASE + 0x000A) #define VVCAM_ISP_CID_GTM_AUTO_HIST_MAX_GAIN \ - (VVCAM_ISP_CID_GTM_BASE + 0x000C) + (VVCAM_ISP_CID_GTM_BASE + 0x000B) #define VVCAM_ISP_CID_GTM_AUTO_HIST_MIN_GAIN \ - (VVCAM_ISP_CID_GTM_BASE + 0x000D) + (VVCAM_ISP_CID_GTM_BASE + 0x000C) #define VVCAM_ISP_CID_GTM_AUTO_HIST_STRENGTH \ - (VVCAM_ISP_CID_GTM_BASE + 0x000E) -#define VVCAM_ISP_CID_GTM_AUTO_COLOR_WEIGHT (VVCAM_ISP_CID_GTM_BASE + 0x000F) + (VVCAM_ISP_CID_GTM_BASE + 0x000D) +#define VVCAM_ISP_CID_GTM_AUTO_COLOR_WEIGHT (VVCAM_ISP_CID_GTM_BASE + 0x000E) #define VVCAM_ISP_CID_GTM_AUTO_HIST_LUMA_WEIGHT \ - (VVCAM_ISP_CID_GTM_BASE + 0x0010) -#define VVCAM_ISP_CID_GTM_AUTO_USER_CURVE (VVCAM_ISP_CID_GTM_BASE + 0x0011) -#define VVCAM_ISP_CID_GTM_AUTO_CURVE_MODE (VVCAM_ISP_CID_GTM_BASE + 0x0012) -#define VVCAM_ISP_CID_GTM_AUTO_EDR_LEVEL (VVCAM_ISP_CID_GTM_BASE + 0x0013) + (VVCAM_ISP_CID_GTM_BASE + 0x000F) +#define VVCAM_ISP_CID_GTM_AUTO_USER_CURVE (VVCAM_ISP_CID_GTM_BASE + 0x0010) +#define VVCAM_ISP_CID_GTM_AUTO_CURVE_MODE (VVCAM_ISP_CID_GTM_BASE + 0x0011) +#define VVCAM_ISP_CID_GTM_AUTO_USER_CURVE_ENABLE \ + (VVCAM_ISP_CID_GTM_BASE + 0x0012) #define VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_CONTRAST_LIMIT_LEVEL \ - (VVCAM_ISP_CID_GTM_BASE + 0x0014) + (VVCAM_ISP_CID_GTM_BASE + 0x0013) #define VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_LUMA_THR_LOG \ - (VVCAM_ISP_CID_GTM_BASE + 0x0015) + (VVCAM_ISP_CID_GTM_BASE + 0x0014) #define VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_LUMA_WEIGHT \ - (VVCAM_ISP_CID_GTM_BASE + 0x0016) + (VVCAM_ISP_CID_GTM_BASE + 0x0015) #define VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_HLC_FACTOR \ - (VVCAM_ISP_CID_GTM_BASE + 0x0017) + (VVCAM_ISP_CID_GTM_BASE + 0x0016) #define VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_LUMA_PRESERVE_WEIGHT \ - (VVCAM_ISP_CID_GTM_BASE + 0x0018) + (VVCAM_ISP_CID_GTM_BASE + 0x0017) #define VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_COMPRESS_WEIGHT \ - (VVCAM_ISP_CID_GTM_BASE + 0x0019) + (VVCAM_ISP_CID_GTM_BASE + 0x0018) #define VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_MAX_GAIN \ - (VVCAM_ISP_CID_GTM_BASE + 0x001A) + (VVCAM_ISP_CID_GTM_BASE + 0x0019) #define VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_MIN_GAIN \ - (VVCAM_ISP_CID_GTM_BASE + 0x001B) + (VVCAM_ISP_CID_GTM_BASE + 0x001A) #define VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_STRENGTH \ - (VVCAM_ISP_CID_GTM_BASE + 0x001C) + (VVCAM_ISP_CID_GTM_BASE + 0x001B) #define VVCAM_ISP_CID_GTM_AUTO_CURVE_HIST_DAMP_COEF \ - (VVCAM_ISP_CID_GTM_BASE + 0x001D) + (VVCAM_ISP_CID_GTM_BASE + 0x001C) +#define VVCAM_ISP_CID_GTM_AUTO_EDR_LEVEL (VVCAM_ISP_CID_GTM_BASE + 0x001D) #define VVCAM_ISP_CID_GTM_AUTO_EDR (VVCAM_ISP_CID_GTM_BASE + 0x001E) #define VVCAM_ISP_CID_GTM_MANU_RGB_COEF (VVCAM_ISP_CID_GTM_BASE + 0x001F) #define VVCAM_ISP_CID_GTM_MANU_LIGHTNESS_WEIGHT \ @@ -141,8 +146,40 @@ (VVCAM_ISP_CID_GTM_BASE + 0x0030) #define VVCAM_ISP_CID_GTM_HIST_STATISTIC_DATA \ (VVCAM_ISP_CID_GTM_BASE + 0x0031) +#define VVCAM_ISP_CID_GTM_STAT_RGB_COEF (VVCAM_ISP_CID_GTM_BASE + 0x0032) +#define VVCAM_ISP_CID_GTM_STAT_LIGHTNESS_WEIGHT \ + (VVCAM_ISP_CID_GTM_BASE + 0x0033) +#define VVCAM_ISP_CID_GTM_STAT_COLOR_WEIGHT \ + (VVCAM_ISP_CID_GTM_BASE + 0x0034) +#define VVCAM_ISP_CID_GTM_STAT_BW_COR_MODE \ + (VVCAM_ISP_CID_GTM_BASE + 0x0035) +#define VVCAM_ISP_CID_GTM_STAT_BW_COR_MIN_LOG \ + (VVCAM_ISP_CID_GTM_BASE + 0x0036) +#define VVCAM_ISP_CID_GTM_STAT_BW_COR_MAX_LOG \ + (VVCAM_ISP_CID_GTM_BASE + 0x0037) +#define VVCAM_ISP_CID_GTM_STAT_BW_COR_DAMP_COEF \ + (VVCAM_ISP_CID_GTM_BASE + 0x0038) +#define VVCAM_ISP_CID_GTM_STAT_CURVE_SELECT \ + (VVCAM_ISP_CID_GTM_BASE + 0x0039) +#define VVCAM_ISP_CID_GTM_STAT_CURVE_SHIFT_BIT \ + (VVCAM_ISP_CID_GTM_BASE + 0x003A) +#define VVCAM_ISP_CID_GTM_STAT_PWL_KNEE_X_LOG \ + (VVCAM_ISP_CID_GTM_BASE + 0x003B) +#define VVCAM_ISP_CID_GTM_STAT_PWL_KNEE_Y_LOG \ + (VVCAM_ISP_CID_GTM_BASE + 0x003C) +#define VVCAM_ISP_CID_GTM_STAT_PWL_MAX_LOG \ + (VVCAM_ISP_CID_GTM_BASE + 0x003D) +#define VVCAM_ISP_CID_GTM_STAT_PWL_MIN_LOG \ + (VVCAM_ISP_CID_GTM_BASE + 0x003E) +#define VVCAM_ISP_CID_GTM_STAT_LOG_KNEE_X_LOG \ + (VVCAM_ISP_CID_GTM_BASE + 0x003F) +#define VVCAM_ISP_CID_GTM_STAT_LOG_KNEE_SLOPE \ + (VVCAM_ISP_CID_GTM_BASE + 0x0040) +#define VVCAM_ISP_CID_GTM_STAT_USER_CURVE (VVCAM_ISP_CID_GTM_BASE + 0x0041) +#ifdef __KERNEL__ int vvcam_isp_gtm_ctrl_count(void); int vvcam_isp_gtm_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gwdr/gwdr_v1/vvcam_isp_gwdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gwdr/gwdr_v1/vvcam_isp_gwdr.c index 83a5d8e..2e21479 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gwdr/gwdr_v1/vvcam_isp_gwdr.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gwdr/gwdr_v1/vvcam_isp_gwdr.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -98,6 +100,11 @@ static int vvcam_isp_gwdr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_GWDR_MANU_LUM_OFFSET: case VVCAM_ISP_CID_GWDR_MANU_GAMMA: case VVCAM_ISP_CID_GWDR_MANU_CURVE: + case VVCAM_ISP_CID_GWDR_STAT_MODE: + case VVCAM_ISP_CID_GWDR_STAT_RGB_OFFSET: + case VVCAM_ISP_CID_GWDR_STAT_LUM_OFFSET: + case VVCAM_ISP_CID_GWDR_STAT_GAMMA: + case VVCAM_ISP_CID_GWDR_STAT_CURVE: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -135,8 +142,7 @@ const struct v4l2_ctrl_config vvcam_isp_gwdr_ctrls[] = { .min = 0, .max = 1, }, - /*{ - // why enum type use 0x87A ?? + { .ops = &vvcam_isp_gwdr_ctrl_ops, .id = VVCAM_ISP_CID_GWDR_MANU_MODE, .type = V4L2_CTRL_TYPE_INTEGER, @@ -144,8 +150,8 @@ const struct v4l2_ctrl_config vvcam_isp_gwdr_ctrls[] = { .name = "isp_gwdr_manu_mode", .step = 1, .min = 0, - .max = 1, - },*/ + .max = 2170, + }, { .ops = &vvcam_isp_gwdr_ctrl_ops, .id = VVCAM_ISP_CID_GWDR_MANU_RGB_OFFSET, @@ -186,7 +192,63 @@ const struct v4l2_ctrl_config vvcam_isp_gwdr_ctrls[] = { .id = VVCAM_ISP_CID_GWDR_MANU_CURVE, .type = V4L2_CTRL_TYPE_U16, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_gwdr_auto_manu_curve", + .name = "isp_gwdr_manu_curve", + .step = 1, + .min = 0, + .max = 4095, + .dims = {33, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_gwdr_ctrl_ops, + .id = VVCAM_ISP_CID_GWDR_STAT_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gwdr_stat_mode", + .step = 1, + .min = 0, + .max = 2170, + }, + { + .ops = &vvcam_isp_gwdr_ctrl_ops, + .id = VVCAM_ISP_CID_GWDR_STAT_RGB_OFFSET, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gwdr_stat_rgb_offset", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_gwdr_ctrl_ops, + .id = VVCAM_ISP_CID_GWDR_STAT_LUM_OFFSET, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gwdr_stat_lum_offset", + .step = 1, + .min = 0, + .max = 4095, + .dims = {1, 0, 0, 0}, + }, + { + /* float 1.0 ~ 4.0 */ + .ops = &vvcam_isp_gwdr_ctrl_ops, + .id = VVCAM_ISP_CID_GWDR_STAT_GAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gwdr_stat_gamma", + .step = 1, + .min = 100, + .max = 400, + .def = 220, + }, + { + /* uint16_t 33x array */ + .ops = &vvcam_isp_gwdr_ctrl_ops, + .id = VVCAM_ISP_CID_GWDR_STAT_CURVE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_gwdr_stat_curve", .step = 1, .min = 0, .max = 4095, diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gwdr/gwdr_v1/vvcam_isp_gwdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gwdr/gwdr_v1/vvcam_isp_gwdr.h index f490de8..4592433 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gwdr/gwdr_v1/vvcam_isp_gwdr.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/gwdr/gwdr_v1/vvcam_isp_gwdr.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_GWDR_H__ #define __VVCAM_ISP_GWDR_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_GWDR_ENABLE (VVCAM_ISP_CID_GWDR_BASE + 0x0000) #define VVCAM_ISP_CID_GWDR_RESET (VVCAM_ISP_CID_GWDR_BASE + 0x0001) #define VVCAM_ISP_CID_GWDR_MANU_MODE (VVCAM_ISP_CID_GWDR_BASE + 0x0002) @@ -61,8 +65,15 @@ #define VVCAM_ISP_CID_GWDR_MANU_LUM_OFFSET (VVCAM_ISP_CID_GWDR_BASE + 0x0004) #define VVCAM_ISP_CID_GWDR_MANU_GAMMA (VVCAM_ISP_CID_GWDR_BASE + 0x0005) #define VVCAM_ISP_CID_GWDR_MANU_CURVE (VVCAM_ISP_CID_GWDR_BASE + 0x0006) +#define VVCAM_ISP_CID_GWDR_STAT_MODE (VVCAM_ISP_CID_GWDR_BASE + 0x0007) +#define VVCAM_ISP_CID_GWDR_STAT_RGB_OFFSET (VVCAM_ISP_CID_GWDR_BASE + 0x0008) +#define VVCAM_ISP_CID_GWDR_STAT_LUM_OFFSET (VVCAM_ISP_CID_GWDR_BASE + 0x0009) +#define VVCAM_ISP_CID_GWDR_STAT_GAMMA (VVCAM_ISP_CID_GWDR_BASE + 0x000A) +#define VVCAM_ISP_CID_GWDR_STAT_CURVE (VVCAM_ISP_CID_GWDR_BASE + 0x000B) +#ifdef __KERNEL__ int vvcam_isp_gwdr_ctrl_count(void); int vvcam_isp_gwdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif #endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v1_3/vvcam_isp_hdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v1_3/vvcam_isp_hdr.c index 06bfd7d..94b7e24 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v1_3/vvcam_isp_hdr.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v1_3/vvcam_isp_hdr.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -65,9 +67,7 @@ static int vvcam_isp_hdr_s_ctrl(struct v4l2_ctrl *ctrl) switch (ctrl->id) { - case VVCAM_ISP_CID_HDR_ENABLE: case VVCAM_ISP_CID_HDR_RESET: - case VVCAM_ISP_CID_HDR_BYPASS_SELECT: case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: case VVCAM_ISP_CID_HDR_RATIO: case VVCAM_ISP_CID_HDR_TRANS_RANGE: @@ -93,11 +93,14 @@ static int vvcam_isp_hdr_g_ctrl(struct v4l2_ctrl *ctrl) { case VVCAM_ISP_CID_HDR_ENABLE: case VVCAM_ISP_CID_HDR_RESET: - case VVCAM_ISP_CID_HDR_BYPASS_SELECT: case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: case VVCAM_ISP_CID_HDR_RATIO: case VVCAM_ISP_CID_HDR_TRANS_RANGE: case VVCAM_ISP_CID_HDR_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_STAT_RATIO: + case VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -135,16 +138,6 @@ const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { .min = 0, .max = 1, }, - { - .ops = &vvcam_isp_hdr_ctrl_ops, - .id = VVCAM_ISP_CID_HDR_BYPASS_SELECT, - .type = V4L2_CTRL_TYPE_INTEGER, - .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_hdr_bypass_select", - .step = 1, - .min = 0, - .max = 2, - }, { /* uint8_t 3x array */ .ops = &vvcam_isp_hdr_ctrl_ops, @@ -158,7 +151,7 @@ const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { .dims = {3, 0, 0, 0}, }, { - /* float 2x array */ + /* float 2x array [1, 256] */ .ops = &vvcam_isp_hdr_ctrl_ops, .id = VVCAM_ISP_CID_HDR_RATIO, .type = V4L2_CTRL_TYPE_U32, @@ -170,7 +163,7 @@ const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { .dims = {2, 0, 0, 0}, }, { - /* float 2x2 array */ + /* float 2x2 array [0, 1.1] */ .ops = &vvcam_isp_hdr_ctrl_ops, .id = VVCAM_ISP_CID_HDR_TRANS_RANGE, .type = V4L2_CTRL_TYPE_U32, @@ -182,7 +175,7 @@ const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { .dims = {2, 2, 0, 0}, }, { - /* int8_t 2x array */ + /* int8_t 2x array [-1, 8] */ .ops = &vvcam_isp_hdr_ctrl_ops, .id = VVCAM_ISP_CID_HDR_EXTEND_BIT, .type = V4L2_CTRL_TYPE_U8, @@ -193,6 +186,54 @@ const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { .max = 0xFF, .dims = {2, 0, 0, 0}, }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float 2x array [1.0, 256.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_ratio", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 0, 0, 0}, + }, + { + /* float 2x2 array [0, 1.1] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 2, 0, 0}, + }, + { + /* int8_t 2x array [-1, 8] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_extend_bit", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {2, 0, 0, 0}, + }, }; int vvcam_isp_hdr_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v1_3/vvcam_isp_hdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v1_3/vvcam_isp_hdr.h index 2ab05a9..7e6f88d 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v1_3/vvcam_isp_hdr.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v1_3/vvcam_isp_hdr.h @@ -1,68 +1,77 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_HDR_H__ #define __VVCAM_ISP_HDR_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_HDR_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0000) #define VVCAM_ISP_CID_HDR_RESET (VVCAM_ISP_CID_HDR_BASE + 0x0001) -#define VVCAM_ISP_CID_HDR_BYPASS_SELECT (VVCAM_ISP_CID_HDR_BASE + 0x0002) -#define VVCAM_ISP_CID_HDR_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0003) -#define VVCAM_ISP_CID_HDR_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0004) -#define VVCAM_ISP_CID_HDR_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0005) -#define VVCAM_ISP_CID_HDR_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x0006) +#define VVCAM_ISP_CID_HDR_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0002) +#define VVCAM_ISP_CID_HDR_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0003) +#define VVCAM_ISP_CID_HDR_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0004) +#define VVCAM_ISP_CID_HDR_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x0005) +#define VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0006) +#define VVCAM_ISP_CID_HDR_STAT_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0007) +#define VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0008) +#define VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x0009) +#ifdef __KERNEL__ int vvcam_isp_hdr_ctrl_count(void); int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2/vvcam_isp_hdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2/vvcam_isp_hdr.c new file mode 100644 index 0000000..1c174a9 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2/vvcam_isp_hdr.c @@ -0,0 +1,1178 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_hdr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_hdr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_HDR_DPF_L_ENABLE: + case VVCAM_ISP_CID_HDR_DPF_S_ENABLE: + case VVCAM_ISP_CID_HDR_DPF_VS_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE: + case VVCAM_ISP_CID_HDR_RESET: + case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_RATIO: + case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_DPF_L_GAIN: + case VVCAM_ISP_CID_HDR_DPF_L_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_L_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_L_MIN: + case VVCAM_ISP_CID_HDR_DPF_L_DIV: + case VVCAM_ISP_CID_HDR_DPF_L_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_L_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_L_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_DPF_S_GAIN: + case VVCAM_ISP_CID_HDR_DPF_S_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_S_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_S_MIN: + case VVCAM_ISP_CID_HDR_DPF_S_DIV: + case VVCAM_ISP_CID_HDR_DPF_S_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_S_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_S_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_DPF_VS_GAIN: + case VVCAM_ISP_CID_HDR_DPF_VS_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_VS_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_VS_MIN: + case VVCAM_ISP_CID_HDR_DPF_VS_DIV: + case VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_VS_NOISE_CURVE: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_hdr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_HDR_ENABLE: + case VVCAM_ISP_CID_HDR_DPF_L_ENABLE: + case VVCAM_ISP_CID_HDR_DPF_S_ENABLE: + case VVCAM_ISP_CID_HDR_DPF_VS_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE: + case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_RATIO: + case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_DPF_L_GAIN: + case VVCAM_ISP_CID_HDR_DPF_L_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_L_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_L_MIN: + case VVCAM_ISP_CID_HDR_DPF_L_DIV: + case VVCAM_ISP_CID_HDR_DPF_L_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_L_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_L_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_DPF_S_GAIN: + case VVCAM_ISP_CID_HDR_DPF_S_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_S_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_S_MIN: + case VVCAM_ISP_CID_HDR_DPF_S_DIV: + case VVCAM_ISP_CID_HDR_DPF_S_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_S_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_S_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_DPF_VS_GAIN: + case VVCAM_ISP_CID_HDR_DPF_VS_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_VS_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_VS_MIN: + case VVCAM_ISP_CID_HDR_DPF_VS_DIV: + case VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_VS_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_STAT_RATIO: + case VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_MOTION_WEIGHT: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_GAIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_GRADIENT: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_OFFSET: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_MIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_DIV: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_G: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_RB: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_GAIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_GRADIENT: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_OFFSET: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_MIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_DIV: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_G: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_RB: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_GAIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_GRADIENT: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_OFFSET: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_MIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_DIV: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_G: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_RB: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_NOISE_CURVE: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_hdr_ctrl_ops = { + .s_ctrl = vvcam_isp_hdr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_hdr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_deghost_ls_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_deghost_lsvs_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float 2x array [1.0, 256.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_ratio", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 0, 0, 0}, + }, + { + /* float 4x2 array [0, 1.1] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4, 2, 0, 0}, + }, + { + /* int8_t 2x array [-1, 8] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_extend_bit", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {2, 0, 0, 0}, + }, + { + /* uint16_t 2x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_motion_weight", + .step = 1, + .min = 0, + .max = 1024, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_motion_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_motion_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_motion_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_motion_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_dark_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_dark_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_dark_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_dark_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float 2x array [1.0, 256.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_ratio", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 0, 0, 0}, + }, + { + /* float 4x2 array [0, 1.1] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4, 2, 0, 0}, + }, + { + /* int8_t 2x array [-1, 8] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_extend_bit", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {2, 0, 0, 0}, + }, + { + /* uint16_t 2x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_MOTION_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_mo_weight", + .step = 1, + .min = 0, + .max = 1024, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_mo_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_mo_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_mo_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_mo_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_dk_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_dk_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_dk_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_dk_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, +}; + +int vvcam_isp_hdr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_hdr_ctrls); +} + +int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_hdr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_hdr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp hdr ctrl %s failed %d.\n", + vvcam_isp_hdr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2/vvcam_isp_hdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2/vvcam_isp_hdr.h new file mode 100644 index 0000000..bfe77d1 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2/vvcam_isp_hdr.h @@ -0,0 +1,185 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_HDR_H__ +#define __VVCAM_ISP_HDR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_HDR_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0000) +#define VVCAM_ISP_CID_HDR_DPF_L_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0001) +#define VVCAM_ISP_CID_HDR_DPF_S_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0002) +#define VVCAM_ISP_CID_HDR_DPF_VS_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0003) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0004) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE \ + (VVCAM_ISP_CID_HDR_BASE + 0x0005) +#define VVCAM_ISP_CID_HDR_RESET (VVCAM_ISP_CID_HDR_BASE + 0x0006) +#define VVCAM_ISP_CID_HDR_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0007) +#define VVCAM_ISP_CID_HDR_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0008) +#define VVCAM_ISP_CID_HDR_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0009) +#define VVCAM_ISP_CID_HDR_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x000A) + +#define VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT \ + (VVCAM_ISP_CID_HDR_BASE + 0x000B) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000C) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000D) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000E) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000F) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0010) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0011) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0012) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0013) +#define VVCAM_ISP_CID_HDR_DPF_L_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x0014) +#define VVCAM_ISP_CID_HDR_DPF_L_GRADIENT (VVCAM_ISP_CID_HDR_BASE + 0x0015) +#define VVCAM_ISP_CID_HDR_DPF_L_OFFSET (VVCAM_ISP_CID_HDR_BASE + 0x0016) +#define VVCAM_ISP_CID_HDR_DPF_L_MIN (VVCAM_ISP_CID_HDR_BASE + 0x0017) +#define VVCAM_ISP_CID_HDR_DPF_L_DIV (VVCAM_ISP_CID_HDR_BASE + 0x0018) +#define VVCAM_ISP_CID_HDR_DPF_L_SIGMA_G (VVCAM_ISP_CID_HDR_BASE + 0x0019) +#define VVCAM_ISP_CID_HDR_DPF_L_SIGMA_RB (VVCAM_ISP_CID_HDR_BASE + 0x001A) +#define VVCAM_ISP_CID_HDR_DPF_L_NOISE_CURVE (VVCAM_ISP_CID_HDR_BASE + 0x001B) +#define VVCAM_ISP_CID_HDR_DPF_S_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x001C) +#define VVCAM_ISP_CID_HDR_DPF_S_GRADIENT (VVCAM_ISP_CID_HDR_BASE + 0x001D) +#define VVCAM_ISP_CID_HDR_DPF_S_OFFSET (VVCAM_ISP_CID_HDR_BASE + 0x001E) +#define VVCAM_ISP_CID_HDR_DPF_S_MIN (VVCAM_ISP_CID_HDR_BASE + 0x001F) +#define VVCAM_ISP_CID_HDR_DPF_S_DIV (VVCAM_ISP_CID_HDR_BASE + 0x0020) +#define VVCAM_ISP_CID_HDR_DPF_S_SIGMA_G (VVCAM_ISP_CID_HDR_BASE + 0x0021) +#define VVCAM_ISP_CID_HDR_DPF_S_SIGMA_RB (VVCAM_ISP_CID_HDR_BASE + 0x0022) +#define VVCAM_ISP_CID_HDR_DPF_S_NOISE_CURVE (VVCAM_ISP_CID_HDR_BASE + 0x0023) +#define VVCAM_ISP_CID_HDR_DPF_VS_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x0024) +#define VVCAM_ISP_CID_HDR_DPF_VS_GRADIENT (VVCAM_ISP_CID_HDR_BASE + 0x0025) +#define VVCAM_ISP_CID_HDR_DPF_VS_OFFSET (VVCAM_ISP_CID_HDR_BASE + 0x0026) +#define VVCAM_ISP_CID_HDR_DPF_VS_MIN (VVCAM_ISP_CID_HDR_BASE + 0x0027) +#define VVCAM_ISP_CID_HDR_DPF_VS_DIV (VVCAM_ISP_CID_HDR_BASE + 0x0028) +#define VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_G (VVCAM_ISP_CID_HDR_BASE + 0x0029) +#define VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_RB (VVCAM_ISP_CID_HDR_BASE + 0x002A) +#define VVCAM_ISP_CID_HDR_DPF_VS_NOISE_CURVE \ + (VVCAM_ISP_CID_HDR_BASE + 0x002B) + +#define VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x002C) +#define VVCAM_ISP_CID_HDR_STAT_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x002D) +#define VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x002E) +#define VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x002F) + +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_MOTION_WEIGHT \ + (VVCAM_ISP_CID_HDR_BASE + 0x0030) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0031) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0032) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0033) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0034) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0035) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0036) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0037) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0038) + +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x0039) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_GRADIENT \ + (VVCAM_ISP_CID_HDR_BASE + 0x003A) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_OFFSET (VVCAM_ISP_CID_HDR_BASE + 0x003B) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_MIN (VVCAM_ISP_CID_HDR_BASE + 0x003C) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_DIV (VVCAM_ISP_CID_HDR_BASE + 0x003D) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_G \ + (VVCAM_ISP_CID_HDR_BASE + 0x003E) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_RB \ + (VVCAM_ISP_CID_HDR_BASE + 0x003F) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_NOISE_CURVE \ + (VVCAM_ISP_CID_HDR_BASE + 0x0040) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x0041) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_GRADIENT \ + (VVCAM_ISP_CID_HDR_BASE + 0x0042) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_OFFSET (VVCAM_ISP_CID_HDR_BASE + 0x0043) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_MIN (VVCAM_ISP_CID_HDR_BASE + 0x0044) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_DIV (VVCAM_ISP_CID_HDR_BASE + 0x0045) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_G \ + (VVCAM_ISP_CID_HDR_BASE + 0x0046) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_RB \ + (VVCAM_ISP_CID_HDR_BASE + 0x0047) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_NOISE_CURVE \ + (VVCAM_ISP_CID_HDR_BASE + 0x0048) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x0049) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_GRADIENT \ + (VVCAM_ISP_CID_HDR_BASE + 0x004A) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_OFFSET \ + (VVCAM_ISP_CID_HDR_BASE + 0x004B) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_MIN (VVCAM_ISP_CID_HDR_BASE + 0x004C) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_DIV (VVCAM_ISP_CID_HDR_BASE + 0x004D) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_G \ + (VVCAM_ISP_CID_HDR_BASE + 0x004E) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_RB \ + (VVCAM_ISP_CID_HDR_BASE + 0x004F) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_NOISE_CURVE \ + (VVCAM_ISP_CID_HDR_BASE + 0x0050) + +#ifdef __KERNEL__ +int vvcam_isp_hdr_ctrl_count(void); +int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1/vvcam_isp_hdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1/vvcam_isp_hdr.c new file mode 100644 index 0000000..3191a3b --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1/vvcam_isp_hdr.c @@ -0,0 +1,259 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_hdr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_hdr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_HDR_RESET: + case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_RATIO: + case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_EXTEND_BIT: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_hdr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_HDR_ENABLE: + case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_RATIO: + case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_STAT_RATIO: + case VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_hdr_ctrl_ops = { + .s_ctrl = vvcam_isp_hdr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_hdr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float 2x array [1.0, 256.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_ratio", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 0, 0, 0}, + }, + { + /* float 4x2 array [0, 1.1] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4, 2, 0, 0}, + }, + { + /* int8_t 2x array [-1, 8] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_extend_bit", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {2, 0, 0, 0}, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float 2x array [1.0, 256.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_ratio", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 0, 0, 0}, + }, + { + /* float 4x2 array [0, 1.1] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4, 2, 0, 0}, + }, + { + /* int8_t 2x array [-1, 8] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_extend_bit", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {2, 0, 0, 0}, + }, +}; + +int vvcam_isp_hdr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_hdr_ctrls); +} + +int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_hdr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_hdr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp hdr ctrl %s failed %d.\n", + vvcam_isp_hdr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1/vvcam_isp_hdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1/vvcam_isp_hdr.h new file mode 100644 index 0000000..eb9dcde --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1/vvcam_isp_hdr.h @@ -0,0 +1,78 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_HDR_H__ +#define __VVCAM_ISP_HDR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_HDR_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0000) +#define VVCAM_ISP_CID_HDR_RESET (VVCAM_ISP_CID_HDR_BASE + 0x0001) +#define VVCAM_ISP_CID_HDR_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0002) +#define VVCAM_ISP_CID_HDR_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0003) +#define VVCAM_ISP_CID_HDR_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0004) +#define VVCAM_ISP_CID_HDR_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x0005) +#define VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0006) +#define VVCAM_ISP_CID_HDR_STAT_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0007) +#define VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0008) +#define VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x0009) + + +#ifdef __KERNEL__ +int vvcam_isp_hdr_ctrl_count(void); +int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1_2dol/vvcam_isp_hdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1_2dol/vvcam_isp_hdr.c new file mode 100644 index 0000000..d207af8 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1_2dol/vvcam_isp_hdr.c @@ -0,0 +1,257 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_hdr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_hdr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_HDR_RESET: + case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_RATIO: + case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_EXTEND_BIT: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_hdr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_HDR_ENABLE: + case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_RATIO: + case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_STAT_RATIO: + case VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_hdr_ctrl_ops = { + .s_ctrl = vvcam_isp_hdr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_hdr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float [1.0, 256.0] ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_ratio", + .step = 1, + .min = 10000, + .max = 2560000, + .def = 10000, + }, + { + /* float 2x2 array [0, 1.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 2, 0, 0}, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_extend_bit", + .step = 1, + .min = -1, + .max = 8, + .def = 0, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float [1.0, 256.0] ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_ratio", + .step = 1, + .min = 10000, + .max = 2560000, + .def = 10000, + }, + { + /* float 2x2 array [0, 1.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 2, 0, 0}, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_extend_bit", + .step = 1, + .min = -1, + .max = 8, + .def = 0, + }, +}; + +int vvcam_isp_hdr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_hdr_ctrls); +} + +int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_hdr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_hdr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp hdr ctrl %s failed %d.\n", + vvcam_isp_hdr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1_2dol/vvcam_isp_hdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1_2dol/vvcam_isp_hdr.h new file mode 100644 index 0000000..7e6f88d --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v2_1_2dol/vvcam_isp_hdr.h @@ -0,0 +1,77 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_HDR_H__ +#define __VVCAM_ISP_HDR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_HDR_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0000) +#define VVCAM_ISP_CID_HDR_RESET (VVCAM_ISP_CID_HDR_BASE + 0x0001) +#define VVCAM_ISP_CID_HDR_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0002) +#define VVCAM_ISP_CID_HDR_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0003) +#define VVCAM_ISP_CID_HDR_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0004) +#define VVCAM_ISP_CID_HDR_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x0005) +#define VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0006) +#define VVCAM_ISP_CID_HDR_STAT_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0007) +#define VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0008) +#define VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x0009) + +#ifdef __KERNEL__ +int vvcam_isp_hdr_ctrl_count(void); +int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3/vvcam_isp_hdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3/vvcam_isp_hdr.c new file mode 100644 index 0000000..1c174a9 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3/vvcam_isp_hdr.c @@ -0,0 +1,1178 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_hdr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_hdr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_HDR_DPF_L_ENABLE: + case VVCAM_ISP_CID_HDR_DPF_S_ENABLE: + case VVCAM_ISP_CID_HDR_DPF_VS_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE: + case VVCAM_ISP_CID_HDR_RESET: + case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_RATIO: + case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_DPF_L_GAIN: + case VVCAM_ISP_CID_HDR_DPF_L_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_L_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_L_MIN: + case VVCAM_ISP_CID_HDR_DPF_L_DIV: + case VVCAM_ISP_CID_HDR_DPF_L_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_L_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_L_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_DPF_S_GAIN: + case VVCAM_ISP_CID_HDR_DPF_S_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_S_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_S_MIN: + case VVCAM_ISP_CID_HDR_DPF_S_DIV: + case VVCAM_ISP_CID_HDR_DPF_S_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_S_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_S_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_DPF_VS_GAIN: + case VVCAM_ISP_CID_HDR_DPF_VS_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_VS_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_VS_MIN: + case VVCAM_ISP_CID_HDR_DPF_VS_DIV: + case VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_VS_NOISE_CURVE: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_hdr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_HDR_ENABLE: + case VVCAM_ISP_CID_HDR_DPF_L_ENABLE: + case VVCAM_ISP_CID_HDR_DPF_S_ENABLE: + case VVCAM_ISP_CID_HDR_DPF_VS_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE: + case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_RATIO: + case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_DPF_L_GAIN: + case VVCAM_ISP_CID_HDR_DPF_L_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_L_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_L_MIN: + case VVCAM_ISP_CID_HDR_DPF_L_DIV: + case VVCAM_ISP_CID_HDR_DPF_L_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_L_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_L_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_DPF_S_GAIN: + case VVCAM_ISP_CID_HDR_DPF_S_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_S_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_S_MIN: + case VVCAM_ISP_CID_HDR_DPF_S_DIV: + case VVCAM_ISP_CID_HDR_DPF_S_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_S_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_S_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_DPF_VS_GAIN: + case VVCAM_ISP_CID_HDR_DPF_VS_GRADIENT: + case VVCAM_ISP_CID_HDR_DPF_VS_OFFSET: + case VVCAM_ISP_CID_HDR_DPF_VS_MIN: + case VVCAM_ISP_CID_HDR_DPF_VS_DIV: + case VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_G: + case VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_RB: + case VVCAM_ISP_CID_HDR_DPF_VS_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_STAT_RATIO: + case VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_MOTION_WEIGHT: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_GAIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_GRADIENT: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_OFFSET: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_MIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_DIV: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_G: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_RB: + case VVCAM_ISP_CID_HDR_STAT_DPF_L_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_GAIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_GRADIENT: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_OFFSET: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_MIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_DIV: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_G: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_RB: + case VVCAM_ISP_CID_HDR_STAT_DPF_S_NOISE_CURVE: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_GAIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_GRADIENT: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_OFFSET: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_MIN: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_DIV: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_G: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_RB: + case VVCAM_ISP_CID_HDR_STAT_DPF_VS_NOISE_CURVE: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_hdr_ctrl_ops = { + .s_ctrl = vvcam_isp_hdr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_hdr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_deghost_ls_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_deghost_lsvs_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float 2x array [1.0, 256.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_ratio", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 0, 0, 0}, + }, + { + /* float 4x2 array [0, 1.1] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4, 2, 0, 0}, + }, + { + /* int8_t 2x array [-1, 8] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_extend_bit", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {2, 0, 0, 0}, + }, + { + /* uint16_t 2x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_motion_weight", + .step = 1, + .min = 0, + .max = 1024, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_motion_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_motion_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_motion_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_motion_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_dark_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_dark_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_dark_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_dark_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_L_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_l_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_S_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_s_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DPF_VS_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dpf_vs_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float 2x array [1.0, 256.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_ratio", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 0, 0, 0}, + }, + { + /* float 4x2 array [0, 1.1] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4, 2, 0, 0}, + }, + { + /* int8_t 2x array [-1, 8] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_extend_bit", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {2, 0, 0, 0}, + }, + { + /* uint16_t 2x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_MOTION_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_mo_weight", + .step = 1, + .min = 0, + .max = 1024, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_mo_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_mo_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_mo_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_mo_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_dk_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_dk_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_dk_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_dk_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_L_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_l_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_S_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_s_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, + { + /* float 1.0 ~ 1000.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_gain", + .step = 1, + .def = 10000, + .min = 10000, + .max = 10000000, + }, + { + /* float 0.1 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_GRADIENT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_gradient", + .step = 1, + .def = 1000, + .min = 1000, + .max = 1280000, + }, + { + /* float 0.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_OFFSET, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_offset", + .step = 1, + .def = 0, + .min = 0, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_MIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_min", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 64.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_DIV, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_div", + .step = 1, + .def = 10000, + .min = 10000, + .max = 640000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_G, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_sigma_g", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 1.0 ~ 128.0, ratio 10000:1 */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_RB, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_sigma_rb", + .step = 1, + .def = 10000, + .min = 10000, + .max = 1280000, + }, + { + /* float 17x array [0, 4095] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DPF_VS_NOISE_CURVE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dpf_vs_noise_curve", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {17, 0, 0, 0}, + }, +}; + +int vvcam_isp_hdr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_hdr_ctrls); +} + +int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_hdr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_hdr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp hdr ctrl %s failed %d.\n", + vvcam_isp_hdr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3/vvcam_isp_hdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3/vvcam_isp_hdr.h new file mode 100644 index 0000000..bfe77d1 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3/vvcam_isp_hdr.h @@ -0,0 +1,185 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_HDR_H__ +#define __VVCAM_ISP_HDR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_HDR_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0000) +#define VVCAM_ISP_CID_HDR_DPF_L_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0001) +#define VVCAM_ISP_CID_HDR_DPF_S_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0002) +#define VVCAM_ISP_CID_HDR_DPF_VS_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0003) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0004) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE \ + (VVCAM_ISP_CID_HDR_BASE + 0x0005) +#define VVCAM_ISP_CID_HDR_RESET (VVCAM_ISP_CID_HDR_BASE + 0x0006) +#define VVCAM_ISP_CID_HDR_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0007) +#define VVCAM_ISP_CID_HDR_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0008) +#define VVCAM_ISP_CID_HDR_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0009) +#define VVCAM_ISP_CID_HDR_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x000A) + +#define VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT \ + (VVCAM_ISP_CID_HDR_BASE + 0x000B) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000C) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000D) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000E) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000F) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0010) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0011) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0012) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0013) +#define VVCAM_ISP_CID_HDR_DPF_L_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x0014) +#define VVCAM_ISP_CID_HDR_DPF_L_GRADIENT (VVCAM_ISP_CID_HDR_BASE + 0x0015) +#define VVCAM_ISP_CID_HDR_DPF_L_OFFSET (VVCAM_ISP_CID_HDR_BASE + 0x0016) +#define VVCAM_ISP_CID_HDR_DPF_L_MIN (VVCAM_ISP_CID_HDR_BASE + 0x0017) +#define VVCAM_ISP_CID_HDR_DPF_L_DIV (VVCAM_ISP_CID_HDR_BASE + 0x0018) +#define VVCAM_ISP_CID_HDR_DPF_L_SIGMA_G (VVCAM_ISP_CID_HDR_BASE + 0x0019) +#define VVCAM_ISP_CID_HDR_DPF_L_SIGMA_RB (VVCAM_ISP_CID_HDR_BASE + 0x001A) +#define VVCAM_ISP_CID_HDR_DPF_L_NOISE_CURVE (VVCAM_ISP_CID_HDR_BASE + 0x001B) +#define VVCAM_ISP_CID_HDR_DPF_S_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x001C) +#define VVCAM_ISP_CID_HDR_DPF_S_GRADIENT (VVCAM_ISP_CID_HDR_BASE + 0x001D) +#define VVCAM_ISP_CID_HDR_DPF_S_OFFSET (VVCAM_ISP_CID_HDR_BASE + 0x001E) +#define VVCAM_ISP_CID_HDR_DPF_S_MIN (VVCAM_ISP_CID_HDR_BASE + 0x001F) +#define VVCAM_ISP_CID_HDR_DPF_S_DIV (VVCAM_ISP_CID_HDR_BASE + 0x0020) +#define VVCAM_ISP_CID_HDR_DPF_S_SIGMA_G (VVCAM_ISP_CID_HDR_BASE + 0x0021) +#define VVCAM_ISP_CID_HDR_DPF_S_SIGMA_RB (VVCAM_ISP_CID_HDR_BASE + 0x0022) +#define VVCAM_ISP_CID_HDR_DPF_S_NOISE_CURVE (VVCAM_ISP_CID_HDR_BASE + 0x0023) +#define VVCAM_ISP_CID_HDR_DPF_VS_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x0024) +#define VVCAM_ISP_CID_HDR_DPF_VS_GRADIENT (VVCAM_ISP_CID_HDR_BASE + 0x0025) +#define VVCAM_ISP_CID_HDR_DPF_VS_OFFSET (VVCAM_ISP_CID_HDR_BASE + 0x0026) +#define VVCAM_ISP_CID_HDR_DPF_VS_MIN (VVCAM_ISP_CID_HDR_BASE + 0x0027) +#define VVCAM_ISP_CID_HDR_DPF_VS_DIV (VVCAM_ISP_CID_HDR_BASE + 0x0028) +#define VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_G (VVCAM_ISP_CID_HDR_BASE + 0x0029) +#define VVCAM_ISP_CID_HDR_DPF_VS_SIGMA_RB (VVCAM_ISP_CID_HDR_BASE + 0x002A) +#define VVCAM_ISP_CID_HDR_DPF_VS_NOISE_CURVE \ + (VVCAM_ISP_CID_HDR_BASE + 0x002B) + +#define VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x002C) +#define VVCAM_ISP_CID_HDR_STAT_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x002D) +#define VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x002E) +#define VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x002F) + +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_MOTION_WEIGHT \ + (VVCAM_ISP_CID_HDR_BASE + 0x0030) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0031) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0032) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0033) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0034) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0035) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0036) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0037) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0038) + +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x0039) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_GRADIENT \ + (VVCAM_ISP_CID_HDR_BASE + 0x003A) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_OFFSET (VVCAM_ISP_CID_HDR_BASE + 0x003B) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_MIN (VVCAM_ISP_CID_HDR_BASE + 0x003C) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_DIV (VVCAM_ISP_CID_HDR_BASE + 0x003D) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_G \ + (VVCAM_ISP_CID_HDR_BASE + 0x003E) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_SIGMA_RB \ + (VVCAM_ISP_CID_HDR_BASE + 0x003F) +#define VVCAM_ISP_CID_HDR_STAT_DPF_L_NOISE_CURVE \ + (VVCAM_ISP_CID_HDR_BASE + 0x0040) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x0041) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_GRADIENT \ + (VVCAM_ISP_CID_HDR_BASE + 0x0042) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_OFFSET (VVCAM_ISP_CID_HDR_BASE + 0x0043) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_MIN (VVCAM_ISP_CID_HDR_BASE + 0x0044) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_DIV (VVCAM_ISP_CID_HDR_BASE + 0x0045) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_G \ + (VVCAM_ISP_CID_HDR_BASE + 0x0046) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_SIGMA_RB \ + (VVCAM_ISP_CID_HDR_BASE + 0x0047) +#define VVCAM_ISP_CID_HDR_STAT_DPF_S_NOISE_CURVE \ + (VVCAM_ISP_CID_HDR_BASE + 0x0048) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_GAIN (VVCAM_ISP_CID_HDR_BASE + 0x0049) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_GRADIENT \ + (VVCAM_ISP_CID_HDR_BASE + 0x004A) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_OFFSET \ + (VVCAM_ISP_CID_HDR_BASE + 0x004B) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_MIN (VVCAM_ISP_CID_HDR_BASE + 0x004C) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_DIV (VVCAM_ISP_CID_HDR_BASE + 0x004D) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_G \ + (VVCAM_ISP_CID_HDR_BASE + 0x004E) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_SIGMA_RB \ + (VVCAM_ISP_CID_HDR_BASE + 0x004F) +#define VVCAM_ISP_CID_HDR_STAT_DPF_VS_NOISE_CURVE \ + (VVCAM_ISP_CID_HDR_BASE + 0x0050) + +#ifdef __KERNEL__ +int vvcam_isp_hdr_ctrl_count(void); +int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_1/vvcam_isp_hdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_1/vvcam_isp_hdr.c index 1d9b693..bab6a3a 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_1/vvcam_isp_hdr.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_1/vvcam_isp_hdr.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -65,9 +67,7 @@ static int vvcam_isp_hdr_s_ctrl(struct v4l2_ctrl *ctrl) switch (ctrl->id) { - case VVCAM_ISP_CID_HDR_ENABLE: case VVCAM_ISP_CID_HDR_RESET: - case VVCAM_ISP_CID_HDR_BYPASS_SELECT: case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: case VVCAM_ISP_CID_HDR_RATIO: case VVCAM_ISP_CID_HDR_TRANS_RANGE: @@ -91,11 +91,12 @@ static int vvcam_isp_hdr_g_ctrl(struct v4l2_ctrl *ctrl) switch (ctrl->id) { case VVCAM_ISP_CID_HDR_ENABLE: - case VVCAM_ISP_CID_HDR_RESET: - case VVCAM_ISP_CID_HDR_BYPASS_SELECT: case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: case VVCAM_ISP_CID_HDR_RATIO: case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_STAT_RATIO: + case VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -133,16 +134,6 @@ const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { .min = 0, .max = 1, }, - { - .ops = &vvcam_isp_hdr_ctrl_ops, - .id = VVCAM_ISP_CID_HDR_BYPASS_SELECT, - .type = V4L2_CTRL_TYPE_INTEGER, - .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_hdr_bypass_select", - .step = 1, - .min = 0, - .max = 3, - }, { /* uint8_t 3x array */ .ops = &vvcam_isp_hdr_ctrl_ops, @@ -179,6 +170,42 @@ const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { .max = 0xFFFFFFFF, .dims = {6, 2, 0, 0}, }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_ratio", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {3, 0, 0, 0}, + }, + { + /* float 6x2 array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {6, 2, 0, 0}, + }, }; int vvcam_isp_hdr_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_1/vvcam_isp_hdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_1/vvcam_isp_hdr.h index c27ccb4..7d7da39 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_1/vvcam_isp_hdr.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_1/vvcam_isp_hdr.h @@ -1,67 +1,74 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_HDR_H__ #define __VVCAM_ISP_HDR_H__ +#include "vvcam_isp_ctrl.h" #define VVCAM_ISP_CID_HDR_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0000) #define VVCAM_ISP_CID_HDR_RESET (VVCAM_ISP_CID_HDR_BASE + 0x0001) -#define VVCAM_ISP_CID_HDR_BYPASS_SELECT (VVCAM_ISP_CID_HDR_BASE + 0x0002) -#define VVCAM_ISP_CID_HDR_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0003) -#define VVCAM_ISP_CID_HDR_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0004) -#define VVCAM_ISP_CID_HDR_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0005) +#define VVCAM_ISP_CID_HDR_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0002) +#define VVCAM_ISP_CID_HDR_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0003) +#define VVCAM_ISP_CID_HDR_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0004) +#define VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0005) +#define VVCAM_ISP_CID_HDR_STAT_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0006) +#define VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0007) +#ifdef __KERNEL__ int vvcam_isp_hdr_ctrl_count(void); int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_2dol/vvcam_isp_hdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_2dol/vvcam_isp_hdr.c new file mode 100644 index 0000000..9450dcb --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_2dol/vvcam_isp_hdr.c @@ -0,0 +1,494 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_hdr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_hdr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE: + case VVCAM_ISP_CID_HDR_RESET: + case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_RATIO: + case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_hdr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_HDR_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE: + case VVCAM_ISP_CID_HDR_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_RATIO: + case VVCAM_ISP_CID_HDR_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT: + case VVCAM_ISP_CID_HDR_STAT_RATIO: + case VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE: + case VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_MOTION_WEIGHT: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_UPPER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_LOWER_THR: + case VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_UPPER_THR: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_hdr_ctrl_ops = { + .s_ctrl = vvcam_isp_hdr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_hdr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_hdr_ctrls[] = { + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_deghost_ls_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_deghost_lsvs_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float 2x array [1.0, 256.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_ratio", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 0, 0, 0}, + }, + { + /* float 4x2 array [0, 1.1] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4, 2, 0, 0}, + }, + { + /* int8_t 2x array [-1, 8] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_extend_bit", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {2, 0, 0, 0}, + }, + { + /* uint16_t 2x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_motion_weight", + .step = 1, + .min = 0, + .max = 1024, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_motion_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_motion_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_motion_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_motion_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_dark_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_ls_dark_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_dark_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_dg_lsvs_dark_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_color_weight", + .step = 1, + .min = 0, + .max = 255, + .dims = {3, 0, 0, 0}, + }, + { + /* float 2x array [1.0, 256.0] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_ratio", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {2, 0, 0, 0}, + }, + { + /* float 4x2 array [0, 1.1] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_trans_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4, 2, 0, 0}, + }, + { + /* int8_t 2x array [-1, 8] */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_extend_bit", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {2, 0, 0, 0}, + }, + { + /* uint16_t 2x array */ + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_MOTION_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_mo_weight", + .step = 1, + .min = 0, + .max = 1024, + .dims = {2, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_mo_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_mo_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_mo_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_mo_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_dk_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_ls_dk_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_LOWER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_dk_lwr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, + { + .ops = &vvcam_isp_hdr_ctrl_ops, + .id = VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_UPPER_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_hdr_stat_dg_lsvs_dk_upr_thr", + .step = 1, + .min = 0, + .max = 4095, + }, +}; + +int vvcam_isp_hdr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_hdr_ctrls); +} + +int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_hdr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_hdr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp hdr ctrl %s failed %d.\n", + vvcam_isp_hdr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_2dol/vvcam_isp_hdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_2dol/vvcam_isp_hdr.h new file mode 100644 index 0000000..a57052d --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/hdr/hdr_v3_2dol/vvcam_isp_hdr.h @@ -0,0 +1,119 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_HDR_H__ +#define __VVCAM_ISP_HDR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_HDR_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0000) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_ENABLE (VVCAM_ISP_CID_HDR_BASE + 0x0001) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_ENABLE \ + (VVCAM_ISP_CID_HDR_BASE + 0x0002) +#define VVCAM_ISP_CID_HDR_RESET (VVCAM_ISP_CID_HDR_BASE + 0x0003) +#define VVCAM_ISP_CID_HDR_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0004) +#define VVCAM_ISP_CID_HDR_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0005) +#define VVCAM_ISP_CID_HDR_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0006) +#define VVCAM_ISP_CID_HDR_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x0007) + +#define VVCAM_ISP_CID_HDR_DEGHOST_MOTION_WEIGHT \ + (VVCAM_ISP_CID_HDR_BASE + 0x0008) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0009) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000A) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000B) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000C) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000D) +#define VVCAM_ISP_CID_HDR_DEGHOST_LS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000E) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x000F) +#define VVCAM_ISP_CID_HDR_DEGHOST_LSVS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0010) + +#define VVCAM_ISP_CID_HDR_STAT_COLOR_WEIGHT (VVCAM_ISP_CID_HDR_BASE + 0x0011) +#define VVCAM_ISP_CID_HDR_STAT_RATIO (VVCAM_ISP_CID_HDR_BASE + 0x0012) +#define VVCAM_ISP_CID_HDR_STAT_TRANS_RANGE (VVCAM_ISP_CID_HDR_BASE + 0x0013) +#define VVCAM_ISP_CID_HDR_STAT_EXTEND_BIT (VVCAM_ISP_CID_HDR_BASE + 0x0014) + +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_MOTION_WEIGHT \ + (VVCAM_ISP_CID_HDR_BASE + 0x0015) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0016) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0017) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0018) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_MOTION_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x0019) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x001A) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x001B) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_LOWER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x001C) +#define VVCAM_ISP_CID_HDR_STAT_DEGHOST_LSVS_DARK_UPPER_THR \ + (VVCAM_ISP_CID_HDR_BASE + 0x001D) + +#ifdef __KERNEL__ +int vvcam_isp_hdr_ctrl_count(void); +int vvcam_isp_hdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v1/vvcam_isp_lsc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v1/vvcam_isp_lsc.c index 198b8ce..d80a8d6 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v1/vvcam_isp_lsc.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v1/vvcam_isp_lsc.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -67,7 +69,6 @@ static int vvcam_isp_lsc_s_ctrl(struct v4l2_ctrl *ctrl) { case VVCAM_ISP_CID_LSC_ENABLE: case VVCAM_ISP_CID_LSC_RESET: - case VVCAM_ISP_CID_LSC_MODE: case VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL: case VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL: case VVCAM_ISP_CID_LSC_MANU_DATA_TBL: @@ -92,10 +93,12 @@ static int vvcam_isp_lsc_g_ctrl(struct v4l2_ctrl *ctrl) { case VVCAM_ISP_CID_LSC_ENABLE: case VVCAM_ISP_CID_LSC_RESET: - case VVCAM_ISP_CID_LSC_MODE: case VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL: case VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL: case VVCAM_ISP_CID_LSC_MANU_DATA_TBL: + case VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL: + case VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL: + case VVCAM_ISP_CID_LSC_STAT_DATA_TBL: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -169,6 +172,42 @@ const struct v4l2_ctrl_config vvcam_isp_lsc_ctrls[] = { .def = 1024, .dims = {4, 17, 17, 0}, }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_x_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {8}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_y_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {8}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_DATA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_data_tbl", + .step = 1, + .min = 1024, + .max = 16383, + .def = 1024, + .dims = {4, 17, 17, 0}, + }, }; int vvcam_isp_lsc_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v1/vvcam_isp_lsc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v1/vvcam_isp_lsc.h index f4cdd1c..d460a0f 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v1/vvcam_isp_lsc.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v1/vvcam_isp_lsc.h @@ -1,67 +1,75 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_LSC_H__ #define __VVCAM_ISP_LSC_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_LSC_ENABLE (VVCAM_ISP_CID_LSC_BASE + 0x0000) #define VVCAM_ISP_CID_LSC_RESET (VVCAM_ISP_CID_LSC_BASE + 0x0001) -#define VVCAM_ISP_CID_LSC_MODE (VVCAM_ISP_CID_LSC_BASE + 0x0002) -#define VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0007) -#define VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0008) -#define VVCAM_ISP_CID_LSC_MANU_DATA_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0009) +#define VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0002) +#define VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0003) +#define VVCAM_ISP_CID_LSC_MANU_DATA_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0004) +#define VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0005) +#define VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0006) +#define VVCAM_ISP_CID_LSC_STAT_DATA_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0007) +#ifdef __KERNEL__ int vvcam_isp_lsc_ctrl_count(void); int vvcam_isp_lsc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif #endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v2/vvcam_isp_lsc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v2/vvcam_isp_lsc.c new file mode 100644 index 0000000..0be4d38 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v2/vvcam_isp_lsc.c @@ -0,0 +1,311 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_lsc.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_lsc_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_LSC_ENABLE: + case VVCAM_ISP_CID_LSC_RESET: + case VVCAM_ISP_CID_LSC_MODE: + case VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL: + case VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL: + case VVCAM_ISP_CID_LSC_MANU_DATA_TBL: + case VVCAM_ISP_CID_LSC_AUTO_LEVEL: + case VVCAM_ISP_CID_LSC_AUTO_GAIN: + case VVCAM_ISP_CID_LSC_AUTO_DAMPING: + case VVCAM_ISP_CID_LSC_AUTO_STRENGTH: + case VVCAM_ISP_CID_LSC_AUTO_INTER_MODE: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_lsc_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_LSC_ENABLE: + case VVCAM_ISP_CID_LSC_RESET: + case VVCAM_ISP_CID_LSC_MODE: + case VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL: + case VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL: + case VVCAM_ISP_CID_LSC_MANU_DATA_TBL: + case VVCAM_ISP_CID_LSC_AUTO_LEVEL: + case VVCAM_ISP_CID_LSC_AUTO_GAIN: + case VVCAM_ISP_CID_LSC_AUTO_DAMPING: + case VVCAM_ISP_CID_LSC_AUTO_STRENGTH: + case VVCAM_ISP_CID_LSC_AUTO_INTER_MODE: + case VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL: + case VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL: + case VVCAM_ISP_CID_LSC_STAT_DATA_TBL: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_lsc_ctrl_ops = { + .s_ctrl = vvcam_isp_lsc_s_ctrl, + .g_volatile_ctrl = vvcam_isp_lsc_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_lsc_ctrls[] = { + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_manu_x_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {8, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_manu_y_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {8, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_MANU_DATA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_manu_data_tbl", + .step = 1, + .min = 1024, + .max = 16383, + .def = 1024, + .dims = {4, 17, 17, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 0 ~ 1.0 */ + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_DAMPING, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_damping", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 20x array 0 ~ 1*/ + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_STRENGTH, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_strength", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_INTER_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_inter_mode", + .step = 1, + .min = 0, + .max = 2, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_x_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {8, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_y_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {8, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_DATA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_data_tbl", + .step = 1, + .min = 1024, + .max = 16383, + .def = 1024, + .dims = {4, 17, 17, 0}, + }, +}; + +int vvcam_isp_lsc_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_lsc_ctrls); +} + +int vvcam_isp_lsc_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_lsc_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_lsc_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp lsc ctrl %s failed %d.\n", + vvcam_isp_lsc_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v2/vvcam_isp_lsc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v2/vvcam_isp_lsc.h new file mode 100644 index 0000000..c1486ed --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v2/vvcam_isp_lsc.h @@ -0,0 +1,81 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_LSC_H__ +#define __VVCAM_ISP_LSC_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_LSC_ENABLE (VVCAM_ISP_CID_LSC_BASE + 0x0000) +#define VVCAM_ISP_CID_LSC_RESET (VVCAM_ISP_CID_LSC_BASE + 0x0001) +#define VVCAM_ISP_CID_LSC_MODE (VVCAM_ISP_CID_LSC_BASE + 0x0002) +#define VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0003) +#define VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0004) +#define VVCAM_ISP_CID_LSC_MANU_DATA_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0005) +#define VVCAM_ISP_CID_LSC_AUTO_LEVEL (VVCAM_ISP_CID_LSC_BASE + 0x0006) +#define VVCAM_ISP_CID_LSC_AUTO_GAIN (VVCAM_ISP_CID_LSC_BASE + 0x0007) +#define VVCAM_ISP_CID_LSC_AUTO_DAMPING (VVCAM_ISP_CID_LSC_BASE + 0x0008) +#define VVCAM_ISP_CID_LSC_AUTO_STRENGTH (VVCAM_ISP_CID_LSC_BASE + 0x0009) +#define VVCAM_ISP_CID_LSC_AUTO_INTER_MODE (VVCAM_ISP_CID_LSC_BASE + 0x000A) +#define VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x000B) +#define VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x000C) +#define VVCAM_ISP_CID_LSC_STAT_DATA_TBL (VVCAM_ISP_CID_LSC_BASE + 0x000D) + +#ifdef __KERNEL__ +int vvcam_isp_lsc_ctrl_count(void); +int vvcam_isp_lsc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v3/vvcam_isp_lsc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v3/vvcam_isp_lsc.c index afe5e7c..a296bb5 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v3/vvcam_isp_lsc.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v3/vvcam_isp_lsc.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -72,6 +74,7 @@ static int vvcam_isp_lsc_s_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_LSC_AUTO_DAMPING: case VVCAM_ISP_CID_LSC_AUTO_GAIN: case VVCAM_ISP_CID_LSC_AUTO_STRENGTH: + case VVCAM_ISP_CID_LSC_AUTO_INTER_MODE: case VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL: case VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL: case VVCAM_ISP_CID_LSC_MANU_DATA_TBL: @@ -101,9 +104,13 @@ static int vvcam_isp_lsc_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_LSC_AUTO_DAMPING: case VVCAM_ISP_CID_LSC_AUTO_GAIN: case VVCAM_ISP_CID_LSC_AUTO_STRENGTH: + case VVCAM_ISP_CID_LSC_AUTO_INTER_MODE: case VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL: case VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL: case VVCAM_ISP_CID_LSC_MANU_DATA_TBL: + case VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL: + case VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL: + case VVCAM_ISP_CID_LSC_STAT_DATA_TBL: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -162,6 +169,7 @@ const struct v4l2_ctrl_config vvcam_isp_lsc_ctrls[] = { .min = 1, .max = 20, .def = 1, + .dims = {1}, }, { /* float 0~1 */ @@ -198,6 +206,16 @@ const struct v4l2_ctrl_config vvcam_isp_lsc_ctrls[] = { .max = 0xFFFFFFFF, .dims = {20}, }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_INTER_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_inter_mode", + .step = 1, + .min = 0, + .max = 2, + }, { .ops = &vvcam_isp_lsc_ctrl_ops, .id = VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL, @@ -234,6 +252,42 @@ const struct v4l2_ctrl_config vvcam_isp_lsc_ctrls[] = { .def = 1024, .dims = {4, 33, 33, 0}, }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_x_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {32}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_y_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {16}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_DATA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_data_tbl", + .step = 1, + .min = 1024, + .max = 16383, + .def = 1024, + .dims = {4, 33, 33, 0}, + }, }; int vvcam_isp_lsc_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v3/vvcam_isp_lsc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v3/vvcam_isp_lsc.h index 1df051a..753fc1f 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v3/vvcam_isp_lsc.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v3/vvcam_isp_lsc.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_LSC_H__ #define __VVCAM_ISP_LSC_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_LSC_ENABLE (VVCAM_ISP_CID_LSC_BASE + 0x0000) #define VVCAM_ISP_CID_LSC_RESET (VVCAM_ISP_CID_LSC_BASE + 0x0001) #define VVCAM_ISP_CID_LSC_MODE (VVCAM_ISP_CID_LSC_BASE + 0x0002) @@ -61,11 +65,17 @@ #define VVCAM_ISP_CID_LSC_AUTO_DAMPING (VVCAM_ISP_CID_LSC_BASE + 0x0004) #define VVCAM_ISP_CID_LSC_AUTO_GAIN (VVCAM_ISP_CID_LSC_BASE + 0x0005) #define VVCAM_ISP_CID_LSC_AUTO_STRENGTH (VVCAM_ISP_CID_LSC_BASE + 0x0006) -#define VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0007) -#define VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0008) -#define VVCAM_ISP_CID_LSC_MANU_DATA_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0009) +#define VVCAM_ISP_CID_LSC_AUTO_INTER_MODE (VVCAM_ISP_CID_LSC_BASE + 0x0007) +#define VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0008) +#define VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0009) +#define VVCAM_ISP_CID_LSC_MANU_DATA_TBL (VVCAM_ISP_CID_LSC_BASE + 0x000A) +#define VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x000B) +#define VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x000C) +#define VVCAM_ISP_CID_LSC_STAT_DATA_TBL (VVCAM_ISP_CID_LSC_BASE + 0x000D) +#ifdef __KERNEL__ int vvcam_isp_lsc_ctrl_count(void); int vvcam_isp_lsc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif #endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v4/vvcam_isp_lsc.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v4/vvcam_isp_lsc.c new file mode 100644 index 0000000..a8de30d --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v4/vvcam_isp_lsc.c @@ -0,0 +1,312 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_lsc.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_lsc_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_LSC_ENABLE: + case VVCAM_ISP_CID_LSC_RESET: + case VVCAM_ISP_CID_LSC_MODE: + case VVCAM_ISP_CID_LSC_AUTO_LEVEL: + case VVCAM_ISP_CID_LSC_AUTO_DAMPING: + case VVCAM_ISP_CID_LSC_AUTO_GAIN: + case VVCAM_ISP_CID_LSC_AUTO_STRENGTH: + case VVCAM_ISP_CID_LSC_AUTO_INTER_MODE: + case VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL: + case VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL: + case VVCAM_ISP_CID_LSC_MANU_DATA_TBL: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_lsc_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_LSC_ENABLE: + case VVCAM_ISP_CID_LSC_RESET: + case VVCAM_ISP_CID_LSC_MODE: + case VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL: + case VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL: + case VVCAM_ISP_CID_LSC_MANU_DATA_TBL: + case VVCAM_ISP_CID_LSC_AUTO_LEVEL: + case VVCAM_ISP_CID_LSC_AUTO_DAMPING: + case VVCAM_ISP_CID_LSC_AUTO_GAIN: + case VVCAM_ISP_CID_LSC_AUTO_STRENGTH: + case VVCAM_ISP_CID_LSC_AUTO_INTER_MODE: + case VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL: + case VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL: + case VVCAM_ISP_CID_LSC_STAT_DATA_TBL: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_lsc_ctrl_ops = { + .s_ctrl = vvcam_isp_lsc_s_ctrl, + .g_volatile_ctrl = vvcam_isp_lsc_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_lsc_ctrls[] = { + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* manual/auto */ + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_manu_x_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {32, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_manu_y_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {32, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_MANU_DATA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_manu_data_tbl", + .step = 1, + .min = 1024, + .max = 16383, + .def = 1024, + .dims = {4, 33, 33, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + /* float 0~1 */ + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_DAMPING, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_damping", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 20x */ + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x 0~1 */ + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_STRENGTH, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_strength", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_AUTO_INTER_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_auto_inter_mode", + .step = 1, + .min = 0, + .max = 2, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_x_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {32, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_y_size_tbl", + .step = 1, + .min = 1, + .max = 0xFFFF, + .def = 1, + .dims = {32, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_lsc_ctrl_ops, + .id = VVCAM_ISP_CID_LSC_STAT_DATA_TBL, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lsc_stat_data_tbl", + .step = 1, + .min = 1024, + .max = 16383, + .def = 1024, + .dims = {4, 33, 33, 0}, + }, +}; + +int vvcam_isp_lsc_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_lsc_ctrls); +} + +int vvcam_isp_lsc_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_lsc_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_lsc_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp lsc ctrl %s failed %d.\n", + vvcam_isp_lsc_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v4/vvcam_isp_lsc.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v4/vvcam_isp_lsc.h new file mode 100644 index 0000000..2b22ec5 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lsc/lsc_v4/vvcam_isp_lsc.h @@ -0,0 +1,81 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_LSC_H__ +#define __VVCAM_ISP_LSC_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_LSC_ENABLE (VVCAM_ISP_CID_LSC_BASE + 0x0000) +#define VVCAM_ISP_CID_LSC_RESET (VVCAM_ISP_CID_LSC_BASE + 0x0001) +#define VVCAM_ISP_CID_LSC_MODE (VVCAM_ISP_CID_LSC_BASE + 0x0002) +#define VVCAM_ISP_CID_LSC_MANU_X_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0003) +#define VVCAM_ISP_CID_LSC_MANU_Y_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0004) +#define VVCAM_ISP_CID_LSC_MANU_DATA_TBL (VVCAM_ISP_CID_LSC_BASE + 0x0005) +#define VVCAM_ISP_CID_LSC_AUTO_LEVEL (VVCAM_ISP_CID_LSC_BASE + 0x0006) +#define VVCAM_ISP_CID_LSC_AUTO_DAMPING (VVCAM_ISP_CID_LSC_BASE + 0x0007) +#define VVCAM_ISP_CID_LSC_AUTO_GAIN (VVCAM_ISP_CID_LSC_BASE + 0x0008) +#define VVCAM_ISP_CID_LSC_AUTO_STRENGTH (VVCAM_ISP_CID_LSC_BASE + 0x0009) +#define VVCAM_ISP_CID_LSC_AUTO_INTER_MODE (VVCAM_ISP_CID_LSC_BASE + 0x000A) +#define VVCAM_ISP_CID_LSC_STAT_X_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x000B) +#define VVCAM_ISP_CID_LSC_STAT_Y_SIZE_TBL (VVCAM_ISP_CID_LSC_BASE + 0x000C) +#define VVCAM_ISP_CID_LSC_STAT_DATA_TBL (VVCAM_ISP_CID_LSC_BASE + 0x000D) + +#ifdef __KERNEL__ +int vvcam_isp_lsc_ctrl_count(void); +int vvcam_isp_lsc_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lut3d/lut3d_v1/vvcam_isp_lut3d.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lut3d/lut3d_v1/vvcam_isp_lut3d.c new file mode 100644 index 0000000..9d30ffd --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lut3d/lut3d_v1/vvcam_isp_lut3d.c @@ -0,0 +1,247 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_lut3d.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_lut3d_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_LUT3D_ENABLE: + case VVCAM_ISP_CID_LUT3D_RESET: + // case VVCAM_ISP_CID_LUT3D_MODE: + case VVCAM_ISP_CID_LUT3D_MANU_R_TBL: + case VVCAM_ISP_CID_LUT3D_MANU_G_TBL: + case VVCAM_ISP_CID_LUT3D_MANU_B_TBL: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_lut3d_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_LUT3D_ENABLE: + case VVCAM_ISP_CID_LUT3D_RESET: + // case VVCAM_ISP_CID_LUT3D_MODE: + case VVCAM_ISP_CID_LUT3D_MANU_R_TBL: + case VVCAM_ISP_CID_LUT3D_MANU_G_TBL: + case VVCAM_ISP_CID_LUT3D_MANU_B_TBL: + case VVCAM_ISP_CID_LUT3D_STAT_R_TBL: + case VVCAM_ISP_CID_LUT3D_STAT_G_TBL: + case VVCAM_ISP_CID_LUT3D_STAT_B_TBL: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_lut3d_ctrl_ops = { + .s_ctrl = vvcam_isp_lut3d_s_ctrl, + .g_volatile_ctrl = vvcam_isp_lut3d_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_lut3d_ctrls[] = { + { + .ops = &vvcam_isp_lut3d_ctrl_ops, + .id = VVCAM_ISP_CID_LUT3D_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lut3d_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_lut3d_ctrl_ops, + .id = VVCAM_ISP_CID_LUT3D_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lut3d_reset", + .step = 1, + .min = 0, + .max = 1, + }, + /* + { + .ops = &vvcam_isp_lut3d_ctrl_ops, + .id = VVCAM_ISP_CID_LUT3D_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lut3d_mode", + .step = 1, + .min = 0, + .max = 1, + }, + */ + { + /* uint32 17x17x17 array */ + .ops = &vvcam_isp_lut3d_ctrl_ops, + .id = VVCAM_ISP_CID_LUT3D_MANU_R_TBL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lut3d_manu_r_tbl", + .step = 1, + .min = 0, + .max = 1023, + .dims = {17, 17, 17, 0}, + }, + { + /* uint32 17x17x17 array */ + .ops = &vvcam_isp_lut3d_ctrl_ops, + .id = VVCAM_ISP_CID_LUT3D_MANU_G_TBL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lut3d_manu_g_tbl", + .step = 1, + .min = 0, + .max = 1023, + .dims = {17, 17, 17, 0}, + }, + { + /* uint32 17x17x17 array */ + .ops = &vvcam_isp_lut3d_ctrl_ops, + .id = VVCAM_ISP_CID_LUT3D_MANU_B_TBL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lut3d_manu_b_tbl", + .step = 1, + .min = 0, + .max = 1023, + .dims = {17, 17, 17, 0}, + }, + { + /* uint32 17x17x17 array */ + .ops = &vvcam_isp_lut3d_ctrl_ops, + .id = VVCAM_ISP_CID_LUT3D_STAT_R_TBL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lut3d_stat_r_tbl", + .step = 1, + .min = 0, + .max = 1023, + .dims = {17, 17, 17, 0}, + }, + { + /* uint32 17x17x17 array */ + .ops = &vvcam_isp_lut3d_ctrl_ops, + .id = VVCAM_ISP_CID_LUT3D_STAT_G_TBL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lut3d_stat_g_tbl", + .step = 1, + .min = 0, + .max = 1023, + .dims = {17, 17, 17, 0}, + }, + { + /* uint32 17x17x17 array */ + .ops = &vvcam_isp_lut3d_ctrl_ops, + .id = VVCAM_ISP_CID_LUT3D_STAT_B_TBL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_lut3d_stat_b_tbl", + .step = 1, + .min = 0, + .max = 1023, + .dims = {17, 17, 17, 0}, + }, +}; + +int vvcam_isp_lut3d_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_lut3d_ctrls); +} + +int vvcam_isp_lut3d_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_lut3d_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_lut3d_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp ynr ctrl %s failed %d.\n", + vvcam_isp_lut3d_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lut3d/lut3d_v1/vvcam_isp_lut3d.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lut3d/lut3d_v1/vvcam_isp_lut3d.h new file mode 100644 index 0000000..21347ed --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/lut3d/lut3d_v1/vvcam_isp_lut3d.h @@ -0,0 +1,76 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_LUT3D_H__ +#define __VVCAM_ISP_LUT3D_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_LUT3D_ENABLE (VVCAM_ISP_CID_LUT3D_BASE + 0x0000) +#define VVCAM_ISP_CID_LUT3D_RESET (VVCAM_ISP_CID_LUT3D_BASE + 0x0001) +// #define VVCAM_ISP_CID_LUT3D_MODE (VVCAM_ISP_CID_LUT3D_BASE + 0x0002) +#define VVCAM_ISP_CID_LUT3D_MANU_R_TBL (VVCAM_ISP_CID_LUT3D_BASE + 0x0003) +#define VVCAM_ISP_CID_LUT3D_MANU_G_TBL (VVCAM_ISP_CID_LUT3D_BASE + 0x0004) +#define VVCAM_ISP_CID_LUT3D_MANU_B_TBL (VVCAM_ISP_CID_LUT3D_BASE + 0x0005) +#define VVCAM_ISP_CID_LUT3D_STAT_R_TBL (VVCAM_ISP_CID_LUT3D_BASE + 0x0006) +#define VVCAM_ISP_CID_LUT3D_STAT_G_TBL (VVCAM_ISP_CID_LUT3D_BASE + 0x0007) +#define VVCAM_ISP_CID_LUT3D_STAT_B_TBL (VVCAM_ISP_CID_LUT3D_BASE + 0x0008) + +#ifdef __KERNEL__ +int vvcam_isp_lut3d_ctrl_count(void); +int vvcam_isp_lut3d_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/pdaf/pdaf_v1/vvcam_isp_pdaf.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/pdaf/pdaf_v1/vvcam_isp_pdaf.c new file mode 100644 index 0000000..e7b652f --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/pdaf/pdaf_v1/vvcam_isp_pdaf.c @@ -0,0 +1,438 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_pdaf.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_pdaf_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_PDAF_ENABLE: + case VVCAM_ISP_CID_PDAF_COR_ENABLE: + case VVCAM_ISP_CID_PDAF_RESET: + case VVCAM_ISP_CID_PDAF_COR_L_CHANGE_DOWN: + case VVCAM_ISP_CID_PDAF_COR_L_CHANGE_UP: + case VVCAM_ISP_CID_PDAF_COR_L_CHANNEL: + case VVCAM_ISP_CID_PDAF_COR_L_LIMIT_BASE: + case VVCAM_ISP_CID_PDAF_COR_R_CHANGE_DOWN: + case VVCAM_ISP_CID_PDAF_COR_R_CHANGE_UP: + case VVCAM_ISP_CID_PDAF_COR_R_CHANNEL: + case VVCAM_ISP_CID_PDAF_COR_R_LIMIT_BASE: + case VVCAM_ISP_CID_PDAF_COR_THRESHOLD: + case VVCAM_ISP_CID_PDAF_DUMMY_LINE_HW: + case VVCAM_ISP_CID_PDAF_ROI: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_pdaf_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_PDAF_ENABLE: + case VVCAM_ISP_CID_PDAF_COR_ENABLE: + case VVCAM_ISP_CID_PDAF_COR_L_CHANGE_DOWN: + case VVCAM_ISP_CID_PDAF_COR_L_CHANGE_UP: + case VVCAM_ISP_CID_PDAF_COR_L_CHANNEL: + case VVCAM_ISP_CID_PDAF_COR_L_LIMIT_BASE: + case VVCAM_ISP_CID_PDAF_COR_R_CHANGE_DOWN: + case VVCAM_ISP_CID_PDAF_COR_R_CHANGE_UP: + case VVCAM_ISP_CID_PDAF_COR_R_CHANNEL: + case VVCAM_ISP_CID_PDAF_COR_R_LIMIT_BASE: + case VVCAM_ISP_CID_PDAF_COR_THRESHOLD: + case VVCAM_ISP_CID_PDAF_DUMMY_LINE_HW: + case VVCAM_ISP_CID_PDAF_ROI: + case VVCAM_ISP_CID_PDAF_STAT_COR_L_CHANGE_DOWN: + case VVCAM_ISP_CID_PDAF_STAT_COR_L_CHANGE_UP: + case VVCAM_ISP_CID_PDAF_STAT_COR_L_CHANNEL: + case VVCAM_ISP_CID_PDAF_STAT_COR_L_LIMIT_BASE: + case VVCAM_ISP_CID_PDAF_STAT_COR_R_CHANGE_DOWN: + case VVCAM_ISP_CID_PDAF_STAT_COR_R_CHANGE_UP: + case VVCAM_ISP_CID_PDAF_STAT_COR_R_CHANNEL: + case VVCAM_ISP_CID_PDAF_STAT_COR_R_LIMIT_BASE: + case VVCAM_ISP_CID_PDAF_STAT_COR_THRESHOLD: + case VVCAM_ISP_CID_PDAF_STAT_DUMMY_LINE_HW: + case VVCAM_ISP_CID_PDAF_STAT_ROI: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_pdaf_ctrl_ops = { + .s_ctrl = vvcam_isp_pdaf_s_ctrl, + .g_volatile_ctrl = vvcam_isp_pdaf_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_pdaf_ctrls[] = { + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_COR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_cor_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_COR_L_CHANGE_DOWN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_cor_l_change_down", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_COR_L_CHANGE_UP, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_cor_l_change_up", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_COR_L_CHANNEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_cor_l_channel", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_COR_L_LIMIT_BASE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_cor_l_limit_base", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_COR_R_CHANGE_DOWN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_cor_r_change_down", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_COR_R_CHANGE_UP, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_cor_r_change_up", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_COR_R_CHANNEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_cor_r_channel", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_COR_R_LIMIT_BASE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_cor_r_limit_base", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_COR_THRESHOLD, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_cor_threshold", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_DUMMY_LINE_HW, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_dummy_line_hw", + .step = 1, + .min = 0, + .max = 1000, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_ROI, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_roi", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {4}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_COR_L_CHANGE_DOWN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_cor_l_change_down", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_COR_L_CHANGE_UP, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_cor_l_change_up", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_COR_L_CHANNEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_cor_l_channel", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_COR_L_LIMIT_BASE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_cor_l_limit_base", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_COR_R_CHANGE_DOWN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_cor_r_change_down", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_COR_R_CHANGE_UP, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_cor_r_change_up", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_COR_R_CHANNEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_cor_r_channel", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_COR_R_LIMIT_BASE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_cor_r_limit_base", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_COR_THRESHOLD, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_cor_threshold", + .step = 1, + .min = 0, + .max = 255, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_DUMMY_LINE_HW, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_dummy_line_hw", + .step = 1, + .min = 0, + .max = 1000, + .dims = {1}, + }, + { + .ops = &vvcam_isp_pdaf_ctrl_ops, + .id = VVCAM_ISP_CID_PDAF_STAT_ROI, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_pdaf_stat_roi", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {4}, + }, +}; + +int vvcam_isp_pdaf_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_pdaf_ctrls); +} + +int vvcam_isp_pdaf_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_pdaf_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_pdaf_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp ynr ctrl %s failed %d.\n", + vvcam_isp_pdaf_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/pdaf/pdaf_v1/vvcam_isp_pdaf.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/pdaf/pdaf_v1/vvcam_isp_pdaf.h new file mode 100644 index 0000000..43b9bdb --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/pdaf/pdaf_v1/vvcam_isp_pdaf.h @@ -0,0 +1,105 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_PDAF_H__ +#define __VVCAM_ISP_PDAF_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_PDAF_ENABLE (VVCAM_ISP_CID_PDAF_BASE + 0x0000) +#define VVCAM_ISP_CID_PDAF_COR_ENABLE (VVCAM_ISP_CID_PDAF_BASE + 0x0001) +#define VVCAM_ISP_CID_PDAF_RESET (VVCAM_ISP_CID_PDAF_BASE + 0x0002) +#define VVCAM_ISP_CID_PDAF_COR_L_CHANGE_DOWN \ + (VVCAM_ISP_CID_PDAF_BASE + 0x0003) +#define VVCAM_ISP_CID_PDAF_COR_L_CHANGE_UP (VVCAM_ISP_CID_PDAF_BASE + 0x0004) +#define VVCAM_ISP_CID_PDAF_COR_L_CHANNEL (VVCAM_ISP_CID_PDAF_BASE + 0x0005) +#define VVCAM_ISP_CID_PDAF_COR_L_LIMIT_BASE (VVCAM_ISP_CID_PDAF_BASE + 0x0006) +#define VVCAM_ISP_CID_PDAF_COR_R_CHANGE_DOWN \ + (VVCAM_ISP_CID_PDAF_BASE + 0x0007) +#define VVCAM_ISP_CID_PDAF_COR_R_CHANGE_UP (VVCAM_ISP_CID_PDAF_BASE + 0x0008) +#define VVCAM_ISP_CID_PDAF_COR_R_CHANNEL (VVCAM_ISP_CID_PDAF_BASE + 0x0009) +#define VVCAM_ISP_CID_PDAF_COR_R_LIMIT_BASE (VVCAM_ISP_CID_PDAF_BASE + 0x000A) +#define VVCAM_ISP_CID_PDAF_COR_THRESHOLD (VVCAM_ISP_CID_PDAF_BASE + 0x000B) +#define VVCAM_ISP_CID_PDAF_DUMMY_LINE_HW (VVCAM_ISP_CID_PDAF_BASE + 0x000C) +#define VVCAM_ISP_CID_PDAF_ROI (VVCAM_ISP_CID_PDAF_BASE + 0x000D) + +#define VVCAM_ISP_CID_PDAF_STAT_COR_L_CHANGE_DOWN \ + (VVCAM_ISP_CID_PDAF_BASE + 0x000E) +#define VVCAM_ISP_CID_PDAF_STAT_COR_L_CHANGE_UP \ + (VVCAM_ISP_CID_PDAF_BASE + 0x000F) +#define VVCAM_ISP_CID_PDAF_STAT_COR_L_CHANNEL \ + (VVCAM_ISP_CID_PDAF_BASE + 0x0010) +#define VVCAM_ISP_CID_PDAF_STAT_COR_L_LIMIT_BASE \ + (VVCAM_ISP_CID_PDAF_BASE + 0x0011) +#define VVCAM_ISP_CID_PDAF_STAT_COR_R_CHANGE_DOWN \ + (VVCAM_ISP_CID_PDAF_BASE + 0x0012) +#define VVCAM_ISP_CID_PDAF_STAT_COR_R_CHANGE_UP \ + (VVCAM_ISP_CID_PDAF_BASE + 0x0013) +#define VVCAM_ISP_CID_PDAF_STAT_COR_R_CHANNEL \ + (VVCAM_ISP_CID_PDAF_BASE + 0x0014) +#define VVCAM_ISP_CID_PDAF_STAT_COR_R_LIMIT_BASE \ + (VVCAM_ISP_CID_PDAF_BASE + 0x0015) +#define VVCAM_ISP_CID_PDAF_STAT_COR_THRESHOLD \ + (VVCAM_ISP_CID_PDAF_BASE + 0x0016) +#define VVCAM_ISP_CID_PDAF_STAT_DUMMY_LINE_HW \ + (VVCAM_ISP_CID_PDAF_BASE + 0x0017) +#define VVCAM_ISP_CID_PDAF_STAT_ROI (VVCAM_ISP_CID_PDAF_BASE + 0x0018) + +#ifdef __KERNEL__ +int vvcam_isp_pdaf_ctrl_count(void); +int vvcam_isp_pdaf_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1/vvcam_isp_rgbir.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1/vvcam_isp_rgbir.c new file mode 100644 index 0000000..c3a5165 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1/vvcam_isp_rgbir.c @@ -0,0 +1,346 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_rgbir.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_rgbir_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_RGBIR_ENABLE: + case VVCAM_ISP_CID_RGBIR_RESET: + case VVCAM_ISP_CID_RGBIR_CC_MATRIX: + case VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_IR_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_L_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_OUT_PATTERN: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_rgbir_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_RGBIR_ENABLE: + case VVCAM_ISP_CID_RGBIR_RESET: + case VVCAM_ISP_CID_RGBIR_CC_MATRIX: + case VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_IR_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_L_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_OUT_PATTERN: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_rgbir_ctrl_ops = { + .s_ctrl = vvcam_isp_rgbir_s_ctrl, + .g_volatile_ctrl = vvcam_isp_rgbir_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_rgbir_ctrls[] = { + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float array 12x (-4,4)*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_CC_MATRIX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_cc_matrix", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_dpcc_middle_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_dpcc_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* 12bit: 4095 24bit: 16777215*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_IR_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_ir_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_L_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_l_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_OUT_PATTERN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_out_pattern", + .step = 1, + .min = 0, + .max = 3, + }, + { + /* float array 12x (-4,4)*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_cc_matrix", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_dpcc_mid_thr", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_dpcc_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* 12bit: 4095 24bit: 16777215*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_ir_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_l_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + /* float array 12x (-4,4)*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_cc_matrix", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_dpcc_stat_mid_thr", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_dpcc_stat_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* 12bit: 4095 24bit: 16777215*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_ir_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_l_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_rgbir_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_rgbir_ctrls); +} + +int vvcam_isp_rgbir_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_rgbir_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_rgbir_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp rgbir ctrl %s failed %d.\n", + vvcam_isp_rgbir_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1/vvcam_isp_rgbir.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1/vvcam_isp_rgbir.h new file mode 100644 index 0000000..27233d7 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1/vvcam_isp_rgbir.h @@ -0,0 +1,86 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_RGBIR_H__ +#define __VVCAM_ISP_RGBIR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_RGBIR_ENABLE (VVCAM_ISP_CID_RGBIR_BASE + 0x0000) +#define VVCAM_ISP_CID_RGBIR_RESET (VVCAM_ISP_CID_RGBIR_BASE + 0x0001) +#define VVCAM_ISP_CID_RGBIR_CC_MATRIX (VVCAM_ISP_CID_RGBIR_BASE + 0x0002) +#define VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x0003) +#define VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0004) +#define VVCAM_ISP_CID_RGBIR_IR_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0005) +#define VVCAM_ISP_CID_RGBIR_L_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0006) +#define VVCAM_ISP_CID_RGBIR_OUT_PATTERN (VVCAM_ISP_CID_RGBIR_BASE + 0x0007) +#define VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX (VVCAM_ISP_CID_RGBIR_BASE + 0x0008) +#define VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x0009) +#define VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000A) +#define VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000B) +#define VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000C) + + +#ifdef __KERNEL__ +int vvcam_isp_rgbir_ctrl_count(void); +int vvcam_isp_rgbir_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1_1/vvcam_isp_rgbir.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1_1/vvcam_isp_rgbir.c new file mode 100644 index 0000000..79b5581 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1_1/vvcam_isp_rgbir.c @@ -0,0 +1,306 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_rgbir.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_rgbir_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_RGBIR_ENABLE: + case VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE: + case VVCAM_ISP_CID_RGBIR_RESET: + case VVCAM_ISP_CID_RGBIR_CC_MATRIX: + case VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_IR_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_L_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_OUT_PATTERN: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_rgbir_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_RGBIR_ENABLE: + case VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE: + case VVCAM_ISP_CID_RGBIR_RESET: + case VVCAM_ISP_CID_RGBIR_CC_MATRIX: + case VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_IR_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_L_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_OUT_PATTERN: + case VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX: + case VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_rgbir_ctrl_ops = { + .s_ctrl = vvcam_isp_rgbir_s_ctrl, + .g_volatile_ctrl = vvcam_isp_rgbir_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_rgbir_ctrls[] = { + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_ir_raw_out_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float array 12x (-4,4)*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_CC_MATRIX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_cc_matrix", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_dpcc_middle_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_dpcc_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* 12bit: 4095 24bit: 16777215*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_IR_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_ir_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_L_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_l_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_OUT_PATTERN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_out_pattern", + .step = 1, + .min = 0, + .max = 3, + }, + { + /* float array 12x (-4,4)*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_cc_matrix", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_dpcc_stat_middle_thr", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_dpcc_stat_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* 12bit: 4095 24bit: 16777215*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_ir_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_l_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_rgbir_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_rgbir_ctrls); +} + +int vvcam_isp_rgbir_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_rgbir_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_rgbir_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp rgbir ctrl %s failed %d.\n", + vvcam_isp_rgbir_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1_1/vvcam_isp_rgbir.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1_1/vvcam_isp_rgbir.h new file mode 100644 index 0000000..8a2aad2 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v1_1/vvcam_isp_rgbir.h @@ -0,0 +1,87 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_RGBIR_H__ +#define __VVCAM_ISP_RGBIR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_RGBIR_ENABLE (VVCAM_ISP_CID_RGBIR_BASE + 0x0000) +#define VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x0001) +#define VVCAM_ISP_CID_RGBIR_RESET (VVCAM_ISP_CID_RGBIR_BASE + 0x0002) +#define VVCAM_ISP_CID_RGBIR_CC_MATRIX (VVCAM_ISP_CID_RGBIR_BASE + 0x0003) +#define VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x0004) +#define VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0005) +#define VVCAM_ISP_CID_RGBIR_IR_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0006) +#define VVCAM_ISP_CID_RGBIR_L_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0007) +#define VVCAM_ISP_CID_RGBIR_OUT_PATTERN (VVCAM_ISP_CID_RGBIR_BASE + 0x0008) +#define VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX (VVCAM_ISP_CID_RGBIR_BASE + 0x0009) +#define VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000A) +#define VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000B) +#define VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000C) +#define VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000D) + +#ifdef __KERNEL__ +int vvcam_isp_rgbir_ctrl_count(void); +int vvcam_isp_rgbir_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2/vvcam_isp_rgbir.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2/vvcam_isp_rgbir.c index 98d0e6d..ddc5988 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2/vvcam_isp_rgbir.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2/vvcam_isp_rgbir.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -67,7 +69,7 @@ static int vvcam_isp_rgbir_s_ctrl(struct v4l2_ctrl *ctrl) { case VVCAM_ISP_CID_RGBIR_ENABLE: case VVCAM_ISP_CID_RGBIR_RCCC_ENABLE: - case VVCAM_ISP_CID_RGBIR_RAW_OUT_ENABLE: + case VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE: case VVCAM_ISP_CID_RGBIR_RESET: case VVCAM_ISP_CID_RGBIR_CC_MATRIX: case VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD: @@ -75,7 +77,6 @@ static int vvcam_isp_rgbir_s_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_RGBIR_IR_THRESHOLD: case VVCAM_ISP_CID_RGBIR_L_THRESHOLD: case VVCAM_ISP_CID_RGBIR_OUT_PATTERN: - case VVCAM_ISP_CID_RGBIR_SP1_IR_SELECT: ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -97,7 +98,7 @@ static int vvcam_isp_rgbir_g_ctrl(struct v4l2_ctrl *ctrl) { case VVCAM_ISP_CID_RGBIR_ENABLE: case VVCAM_ISP_CID_RGBIR_RCCC_ENABLE: - case VVCAM_ISP_CID_RGBIR_RAW_OUT_ENABLE: + case VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE: case VVCAM_ISP_CID_RGBIR_RESET: case VVCAM_ISP_CID_RGBIR_CC_MATRIX: case VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD: @@ -105,7 +106,11 @@ static int vvcam_isp_rgbir_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_RGBIR_IR_THRESHOLD: case VVCAM_ISP_CID_RGBIR_L_THRESHOLD: case VVCAM_ISP_CID_RGBIR_OUT_PATTERN: - case VVCAM_ISP_CID_RGBIR_SP1_IR_SELECT: + case VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX: + case VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -145,10 +150,10 @@ const struct v4l2_ctrl_config vvcam_isp_rgbir_ctrls[] = { }, { .ops = &vvcam_isp_rgbir_ctrl_ops, - .id = VVCAM_ISP_CID_RGBIR_RAW_OUT_ENABLE, + .id = VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE, .type = V4L2_CTRL_TYPE_BOOLEAN, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_rgbir_raw_out_enable", + .name = "isp_rgbir_ir_raw_out_enable", .step = 1, .min = 0, .max = 1, @@ -164,7 +169,7 @@ const struct v4l2_ctrl_config vvcam_isp_rgbir_ctrls[] = { .max = 1, }, { - /* float array 12x [-4,4]*/ + /* float array 12x (-4,4)*/ .ops = &vvcam_isp_rgbir_ctrl_ops, .id = VVCAM_ISP_CID_RGBIR_CC_MATRIX, .type = V4L2_CTRL_TYPE_U32, @@ -231,14 +236,61 @@ const struct v4l2_ctrl_config vvcam_isp_rgbir_ctrls[] = { .max = 3, }, { + /* float array 12x (-4,4)*/ .ops = &vvcam_isp_rgbir_ctrl_ops, - .id = VVCAM_ISP_CID_RGBIR_SP1_IR_SELECT, - .type = V4L2_CTRL_TYPE_INTEGER, + .id = VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX, + .type = V4L2_CTRL_TYPE_U32, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_rgbir_sp1_ir_select", + .name = "isp_rgbir_stat_cc_matrix", .step = 1, .min = 0, - .max = 1, + .max = 0xFFFFFFFF, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_dpcc_middle_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_dpcc_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* 12bit: 4095 24bit: 16777215*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_ir_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_l_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, }, }; diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2/vvcam_isp_rgbir.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2/vvcam_isp_rgbir.h index 8ba2b3c..f2c4991 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2/vvcam_isp_rgbir.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2/vvcam_isp_rgbir.h @@ -1,62 +1,67 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_RGBIR_H__ #define __VVCAM_ISP_RGBIR_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_RGBIR_ENABLE (VVCAM_ISP_CID_RGBIR_BASE + 0x0000) #define VVCAM_ISP_CID_RGBIR_RCCC_ENABLE (VVCAM_ISP_CID_RGBIR_BASE + 0x0001) -#define VVCAM_ISP_CID_RGBIR_RAW_OUT_ENABLE (VVCAM_ISP_CID_RGBIR_BASE + 0x0002) +#define VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x0002) #define VVCAM_ISP_CID_RGBIR_RESET (VVCAM_ISP_CID_RGBIR_BASE + 0x0003) #define VVCAM_ISP_CID_RGBIR_CC_MATRIX (VVCAM_ISP_CID_RGBIR_BASE + 0x0004) #define VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD \ @@ -65,9 +70,19 @@ #define VVCAM_ISP_CID_RGBIR_IR_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0007) #define VVCAM_ISP_CID_RGBIR_L_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0008) #define VVCAM_ISP_CID_RGBIR_OUT_PATTERN (VVCAM_ISP_CID_RGBIR_BASE + 0x0009) -#define VVCAM_ISP_CID_RGBIR_SP1_IR_SELECT (VVCAM_ISP_CID_RGBIR_BASE + 0x000A) +#define VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX (VVCAM_ISP_CID_RGBIR_BASE + 0x000A) +#define VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000B) +#define VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000C) +#define VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000D) +#define VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000E) +#ifdef __KERNEL__ int vvcam_isp_rgbir_ctrl_count(void); int vvcam_isp_rgbir_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2_1/vvcam_isp_rgbir.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2_1/vvcam_isp_rgbir.c new file mode 100644 index 0000000..998d0e6 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2_1/vvcam_isp_rgbir.c @@ -0,0 +1,330 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_rgbir.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_rgbir_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_RGBIR_ENABLE: + case VVCAM_ISP_CID_RGBIR_RCCC_ENABLE: + case VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE: + case VVCAM_ISP_CID_RGBIR_RESET: + case VVCAM_ISP_CID_RGBIR_CC_MATRIX: + case VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_IR_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_L_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_OUT_PATTERN: + case VVCAM_ISP_CID_RGBIR_IR_PATH_SELECT: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_rgbir_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_RGBIR_ENABLE: + case VVCAM_ISP_CID_RGBIR_RCCC_ENABLE: + case VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE: + case VVCAM_ISP_CID_RGBIR_RESET: + case VVCAM_ISP_CID_RGBIR_CC_MATRIX: + case VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_IR_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_L_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_OUT_PATTERN: + case VVCAM_ISP_CID_RGBIR_IR_PATH_SELECT: + case VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX: + case VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD: + case VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_rgbir_ctrl_ops = { + .s_ctrl = vvcam_isp_rgbir_s_ctrl, + .g_volatile_ctrl = vvcam_isp_rgbir_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_rgbir_ctrls[] = { + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_RCCC_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_rccc_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_ir_raw_out_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float array 12x (-4,4)*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_CC_MATRIX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_cc_matrix", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_dpcc_middle_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_dpcc_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* 12bit: 4095 24bit: 16777215*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_IR_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_ir_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_L_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_l_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_OUT_PATTERN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_out_pattern", + .step = 1, + .min = 0, + .max = 3, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_IR_PATH_SELECT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_ir_path_select", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float array 12x (-4,4)*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_cc_matrix", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {12, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_dpcc_middle_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_dpcc_threshold", + .step = 1, + .min = 0, + .max = 65535, + .dims = {4, 0, 0, 0}, + }, + { + /* 12bit: 4095 24bit: 16777215*/ + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_ir_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_rgbir_ctrl_ops, + .id = VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_rgbir_stat_l_threshold", + .step = 1, + .min = 0, + .max = 16777215, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_rgbir_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_rgbir_ctrls); +} + +int vvcam_isp_rgbir_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_rgbir_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_rgbir_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp rgbir ctrl %s failed %d.\n", + vvcam_isp_rgbir_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2_1/vvcam_isp_rgbir.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2_1/vvcam_isp_rgbir.h new file mode 100644 index 0000000..543f9d8 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/rgbir/rgbir_v2_1/vvcam_isp_rgbir.h @@ -0,0 +1,89 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_RGBIR_H__ +#define __VVCAM_ISP_RGBIR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_RGBIR_ENABLE (VVCAM_ISP_CID_RGBIR_BASE + 0x0000) +#define VVCAM_ISP_CID_RGBIR_RCCC_ENABLE (VVCAM_ISP_CID_RGBIR_BASE + 0x0001) +#define VVCAM_ISP_CID_RGBIR_IR_RAW_OUT_ENABLE \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x0002) +#define VVCAM_ISP_CID_RGBIR_RESET (VVCAM_ISP_CID_RGBIR_BASE + 0x0003) +#define VVCAM_ISP_CID_RGBIR_CC_MATRIX (VVCAM_ISP_CID_RGBIR_BASE + 0x0004) +#define VVCAM_ISP_CID_RGBIR_DPCC_MIDDLE_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x0005) +#define VVCAM_ISP_CID_RGBIR_DPCC_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0006) +#define VVCAM_ISP_CID_RGBIR_IR_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0007) +#define VVCAM_ISP_CID_RGBIR_L_THRESHOLD (VVCAM_ISP_CID_RGBIR_BASE + 0x0008) +#define VVCAM_ISP_CID_RGBIR_OUT_PATTERN (VVCAM_ISP_CID_RGBIR_BASE + 0x0009) +#define VVCAM_ISP_CID_RGBIR_IR_PATH_SELECT (VVCAM_ISP_CID_RGBIR_BASE + 0x000A) +#define VVCAM_ISP_CID_RGBIR_STAT_CC_MATRIX (VVCAM_ISP_CID_RGBIR_BASE + 0x000B) +#define VVCAM_ISP_CID_RGBIR_STAT_DPCC_MIDDLE_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000C) +#define VVCAM_ISP_CID_RGBIR_STAT_DPCC_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000D) +#define VVCAM_ISP_CID_RGBIR_STAT_IR_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000E) +#define VVCAM_ISP_CID_RGBIR_STAT_L_THRESHOLD \ + (VVCAM_ISP_CID_RGBIR_BASE + 0x000F) + +#ifdef __KERNEL__ +int vvcam_isp_rgbir_ctrl_count(void); +int vvcam_isp_rgbir_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/vvcam_isp_ctrl.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/vvcam_isp_ctrl.c index f50ff02..6404a55 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/vvcam_isp_ctrl.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/vvcam_isp_ctrl.c @@ -1,65 +1,67 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" #include "vvcam_isp_ctrl.h" -#if defined(ISP_AE_V3) +#if defined(ISP_AE_V3) || defined(ISP_AE_V4) || defined(ISP_AE_V4_1) #include "vvcam_isp_ae.h" #endif -#if defined(ISP_AWB_V3) +#if defined(ISP_AWB_V3) || defined(ISP_AWB_V4) || defined(ISP_AWB_V4_1) #include "vvcam_isp_awb.h" #endif @@ -67,11 +69,11 @@ #include "vvcam_isp_gc.h" #endif -#if defined(ISP_2DNR_V3) || defined(ISP_2DNR_V5_2) +#if defined(ISP_2DNR_V3) || defined(ISP_2DNR_V5_2) || defined(ISP_2DNR_V6) #include "vvcam_isp_2dnr.h" #endif -#if defined(ISP_EE_V1) || defined(ISP_EE_V2) +#if defined(ISP_EE_V1) || defined(ISP_EE_V2) || defined(ISP_EE_V3) #include "vvcam_isp_ee.h" #endif @@ -79,7 +81,9 @@ #include "vvcam_isp_cproc.h" #endif -#if defined(ISP_WDR_V3) || defined(ISP_WDR_V5_2) +#if defined(ISP_WDR_V3) || defined(ISP_WDR_V4) || defined(ISP_WDR_V5) \ + || defined(ISP_WDR_V5_1) || defined(ISP_WDR_V5_2) || defined(ISP_WDR_V5_2_1) \ + || defined(ISP_WDR_V5_3) #include "vvcam_isp_wdr.h" #endif @@ -99,27 +103,34 @@ #include "vvcam_isp_ge.h" #endif -#if defined(ISP_LSC_V1) || defined(ISP_LSC_V3) +#if defined(ISP_LSC_V1) || defined(ISP_LSC_V2) || defined(ISP_LSC_V3) \ + || defined(ISP_LSC_V4) #include "vvcam_isp_lsc.h" #endif -#if defined(ISP_WB) +#if defined(ISP_WB_V1) || defined(ISP_WB_V1_1) #include "vvcam_isp_wb.h" #endif -#if defined(ISP_3DNR_V1_2) || defined(ISP_3DNR_V2_1) +#if defined(ISP_3DNR_V1_2) || defined(ISP_3DNR_V2_1) || defined(ISP_3DNR_V2_4) \ + || defined(ISP_3DNR_V3) || defined(ISP_3DNR_V3_1) || defined(ISP_3DNR_V4) #include "vvcam_isp_3dnr.h" #endif -#if defined(ISP_AF_V3) +#if defined(ISP_AF_V3) || defined(ISP_AF_V4) || defined(ISP_AF_V4_1_1) \ + || defined(ISP_AF_V4_3) #include "vvcam_isp_af.h" #endif -#if defined(ISP_AFM_V1) +#if defined(ISP_PDAF_V1) +#include "vvcam_isp_pdaf.h" +#endif + +#if defined(ISP_AFM_V1) || defined(ISP_AFM_V1_1) || defined(ISP_AFM_V3) #include "vvcam_isp_afm.h" #endif -#if defined(ISP_DMSC_V1) || defined(ISP_DMSC_V2) +#if defined(ISP_DMSC_V1) || defined(ISP_DMSC_V2) || defined(ISP_DMSC_V3) #include "vvcam_isp_dmsc.h" #endif @@ -127,23 +138,30 @@ #include "vvcam_isp_exp.h" #endif +#if defined(ISP_EXP_V3) +#include "vvcam_isp_exp_v3.h" +#endif + #if defined(ISP_GTM_V1) #include "vvcam_isp_gtm.h" #endif -#if defined(ISP_HDR_V1_3) || defined(ISP_HDR_V3_1) +#if defined(ISP_HDR_V1_3) || defined(ISP_HDR_V2) || defined(ISP_HDR_V2_1) \ + || defined(ISP_HDR_V2_1_2DOL) || defined(ISP_HDR_V3) \ + || defined(ISP_HDR_V3_2DOL) || defined(ISP_HDR_V3_1) #include "vvcam_isp_hdr.h" #endif -#if defined(ISP_RGBIR_V2) +#if defined(ISP_RGBIR_V1) || defined(ISP_RGBIR_V1_1) || defined(ISP_RGBIR_V2) \ + || defined(ISP_RGBIR_V2_1) #include "vvcam_isp_rgbir.h" #endif -#if defined(ISP_DG) +#if defined(ISP_DG_V1) #include "vvcam_isp_dg.h" #endif -#if defined(ISP_CPD) +#if defined(ISP_CMPD_20BIT) || defined(ISP_CMPD_24BIT) #include "vvcam_isp_cpd.h" #endif @@ -151,7 +169,7 @@ #include "vvcam_isp_dpf.h" #endif -#if defined(ISP_CNR_V1) +#if defined(ISP_CNR_V1) || defined(ISP_CNR_V2_1) || defined(ISP_CNR_V2_2) #include "vvcam_isp_cnr.h" #endif @@ -159,15 +177,23 @@ #include "vvcam_isp_gwdr.h" #endif +#if defined(ISP_YNR_V1) +#include "vvcam_isp_ynr.h" +#endif + +#if defined(ISP_LUT3D_V1) +#include "vvcam_isp_lut3d.h" +#endif + int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) { uint32_t ctrl_count = 0; -#if defined(ISP_AE_V3) +#if defined(ISP_AE_V3) || defined(ISP_AE_V4) || defined(ISP_AE_V4_1) ctrl_count += vvcam_isp_ae_ctrl_count(); #endif -#if defined(ISP_AWB_V3) +#if defined(ISP_AWB_V3) || defined(ISP_AWB_V4) || defined(ISP_AWB_V4_1) ctrl_count += vvcam_isp_awb_ctrl_count(); #endif @@ -175,11 +201,11 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) ctrl_count += vvcam_isp_gc_ctrl_count(); #endif -#if defined(ISP_2DNR_V3) || defined(ISP_2DNR_V5_2) +#if defined(ISP_2DNR_V3) || defined(ISP_2DNR_V5_2) || defined(ISP_2DNR_V6) ctrl_count += vvcam_isp_2dnr_ctrl_count(); #endif -#if defined(ISP_EE_V1) || defined(ISP_EE_V2) +#if defined(ISP_EE_V1) || defined(ISP_EE_V2) || defined(ISP_EE_V3) ctrl_count += vvcam_isp_ee_ctrl_count(); #endif @@ -187,7 +213,9 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) ctrl_count += vvcam_isp_cproc_ctrl_count(); #endif -#if defined(ISP_WDR_V3) || defined(ISP_WDR_V5_2) +#if defined(ISP_WDR_V3) || defined(ISP_WDR_V4) || defined(ISP_WDR_V5) \ + || defined(ISP_WDR_V5_1) || defined(ISP_WDR_V5_2) || defined(ISP_WDR_V5_2_1) \ + || defined(ISP_WDR_V5_3) ctrl_count += vvcam_isp_wdr_ctrl_count(); #endif @@ -207,27 +235,34 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) ctrl_count += vvcam_isp_ge_ctrl_count(); #endif -#if defined(ISP_LSC_V1) || defined(ISP_LSC_V3) +#if defined(ISP_LSC_V1) || defined(ISP_LSC_V2) || defined(ISP_LSC_V3) \ + || defined(ISP_LSC_V4) ctrl_count += vvcam_isp_lsc_ctrl_count(); #endif -#if defined(ISP_WB) +#if defined(ISP_WB_V1) || defined(ISP_WB_V1_1) ctrl_count += vvcam_isp_wb_ctrl_count(); #endif -#if defined(ISP_3DNR_V2_1) +#if defined(ISP_3DNR_V1_2) || defined(ISP_3DNR_V2_1) || defined(ISP_3DNR_V2_4) \ + || defined(ISP_3DNR_V3) || defined(ISP_3DNR_V3_1) || defined(ISP_3DNR_V4) ctrl_count += vvcam_isp_3dnr_ctrl_count(); #endif -#if defined(ISP_AF_V3) +#if defined(ISP_AF_V3) || defined(ISP_AF_V4) || defined(ISP_AF_V4_1_1) \ + || defined(ISP_AF_V4_3) ctrl_count += vvcam_isp_af_ctrl_count(); #endif -#if defined(ISP_AFM_V1) +#if defined(ISP_PDAF_V1) + ctrl_count += vvcam_isp_pdaf_ctrl_count(); +#endif + +#if defined(ISP_AFM_V1) || defined(ISP_AFM_V1_1) || defined(ISP_AFM_V3) ctrl_count += vvcam_isp_afm_ctrl_count(); #endif -#if defined(ISP_DMSC_V1) || defined(ISP_DMSC_V2) +#if defined(ISP_DMSC_V1) || defined(ISP_DMSC_V2) || defined(ISP_DMSC_V3) ctrl_count += vvcam_isp_dmsc_ctrl_count(); #endif @@ -235,23 +270,30 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) ctrl_count += vvcam_isp_exp_ctrl_count(); #endif +#if defined(ISP_EXP_V3) + ctrl_count += vvcam_isp_exp_v3_ctrl_count(); +#endif + #if defined(ISP_GTM_V1) ctrl_count += vvcam_isp_gtm_ctrl_count(); #endif -#if defined(ISP_HDR_V1_3) || defined(ISP_HDR_V3_1) +#if defined(ISP_HDR_V1_3) || defined(ISP_HDR_V2) || defined(ISP_HDR_V2_1) \ + || defined(ISP_HDR_V2_1_2DOL) || defined(ISP_HDR_V3) \ + || defined(ISP_HDR_V3_2DOL) || defined(ISP_HDR_V3_1) ctrl_count += vvcam_isp_hdr_ctrl_count(); #endif -#if defined(ISP_RGBIR_V2) +#if defined(ISP_RGBIR_V1) || defined(ISP_RGBIR_V1_1) || defined(ISP_RGBIR_V2) \ + || defined(ISP_RGBIR_V2_1) ctrl_count += vvcam_isp_rgbir_ctrl_count(); #endif -#if defined(ISP_DG) +#if defined(ISP_DG_V1) ctrl_count += vvcam_isp_dg_ctrl_count(); #endif -#if defined(ISP_CPD) +#if defined(ISP_CMPD_20BIT) || defined(ISP_CMPD_24BIT) ctrl_count += vvcam_isp_cpd_ctrl_count(); #endif @@ -259,7 +301,7 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) ctrl_count += vvcam_isp_dpf_ctrl_count(); #endif -#if defined(ISP_CNR_V1) +#if defined(ISP_CNR_V1) || defined(ISP_CNR_V2_1) || defined(ISP_CNR_V2_2) ctrl_count += vvcam_isp_cnr_ctrl_count(); #endif @@ -267,13 +309,21 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) ctrl_count += vvcam_isp_gwdr_ctrl_count(); #endif +#if defined(ISP_YNR_V1) + ctrl_count += vvcam_isp_ynr_ctrl_count(); +#endif + +#if defined(ISP_LUT3D_V1) + ctrl_count += vvcam_isp_lut3d_ctrl_count(); +#endif + v4l2_ctrl_handler_init(&isp_dev->ctrl_handler, ctrl_count); -#if defined(ISP_AE_V3) +#if defined(ISP_AE_V3) || defined (ISP_AE_V4) || defined(ISP_AE_V4_1) vvcam_isp_ae_ctrl_create(isp_dev); #endif -#if defined(ISP_AWB_V3) +#if defined(ISP_AWB_V3) || defined(ISP_AWB_V4) || defined(ISP_AWB_V4_1) vvcam_isp_awb_ctrl_create(isp_dev); #endif @@ -281,11 +331,11 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) vvcam_isp_gc_ctrl_create(isp_dev); #endif -#if defined(ISP_2DNR_V3) || defined(ISP_2DNR_V5_2) +#if defined(ISP_2DNR_V3) || defined(ISP_2DNR_V5_2) || defined(ISP_2DNR_V6) vvcam_isp_2dnr_ctrl_create(isp_dev); #endif -#if defined(ISP_EE_V1) || defined(ISP_EE_V2) +#if defined(ISP_EE_V1) || defined(ISP_EE_V2) || defined(ISP_EE_V3) vvcam_isp_ee_ctrl_create(isp_dev); #endif @@ -293,7 +343,9 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) vvcam_isp_cproc_ctrl_create(isp_dev); #endif -#if defined(ISP_WDR_V3) || defined(ISP_WDR_V5_2) +#if defined(ISP_WDR_V3) || defined(ISP_WDR_V4) || defined(ISP_WDR_V5) \ + || defined(ISP_WDR_V5_1) || defined(ISP_WDR_V5_2) || defined(ISP_WDR_V5_2_1) \ + || defined(ISP_WDR_V5_3) vvcam_isp_wdr_ctrl_create(isp_dev); #endif @@ -313,27 +365,34 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) vvcam_isp_ge_ctrl_create(isp_dev); #endif -#if defined(ISP_LSC_V1) || defined(ISP_LSC_V3) +#if defined(ISP_LSC_V1) || defined(ISP_LSC_V2) || defined(ISP_LSC_V3) \ + || defined(ISP_LSC_V4) vvcam_isp_lsc_ctrl_create(isp_dev); #endif -#if defined(ISP_WB) +#if defined(ISP_WB_V1) || defined(ISP_WB_V1_1) vvcam_isp_wb_ctrl_create(isp_dev); #endif -#if defined(ISP_3DNR_V2_1) +#if defined(ISP_3DNR_V1_2) || defined(ISP_3DNR_V2_1) || defined(ISP_3DNR_V2_4) \ + || defined(ISP_3DNR_V3) || defined(ISP_3DNR_V3_1) || defined(ISP_3DNR_V4) vvcam_isp_3dnr_ctrl_create(isp_dev); #endif -#if defined(ISP_AF_V3) +#if defined(ISP_AF_V3) || defined(ISP_AF_V4) || defined(ISP_AF_V4_1_1) \ + || defined(ISP_AF_V4_3) vvcam_isp_af_ctrl_create(isp_dev); #endif -#if defined(ISP_AFM_V1) +#if defined(ISP_PDAF_V1) + vvcam_isp_pdaf_ctrl_create(isp_dev); +#endif + +#if defined(ISP_AFM_V1) || defined(ISP_AFM_V1_1) || defined(ISP_AFM_V3) vvcam_isp_afm_ctrl_create(isp_dev); #endif -#if defined(ISP_DMSC_V1) || defined(ISP_DMSC_V2) +#if defined(ISP_DMSC_V1) || defined(ISP_DMSC_V2) || defined(ISP_DMSC_V3) vvcam_isp_dmsc_ctrl_create(isp_dev); #endif @@ -341,23 +400,30 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) vvcam_isp_exp_ctrl_create(isp_dev); #endif +#if defined(ISP_EXP_V3) + vvcam_isp_exp_v3_ctrl_create(isp_dev); +#endif + #if defined(ISP_GTM_V1) vvcam_isp_gtm_ctrl_create(isp_dev); #endif -#if defined(ISP_HDR_V1_3) || defined(ISP_HDR_V3_1) +#if defined(ISP_HDR_V1_3) || defined(ISP_HDR_V2) || defined(ISP_HDR_V2_1) \ + || defined(ISP_HDR_V2_1_2DOL) || defined(ISP_HDR_V3) \ + || defined(ISP_HDR_V3_2DOL) || defined(ISP_HDR_V3_1) vvcam_isp_hdr_ctrl_create(isp_dev); #endif -#if defined(ISP_RGBIR_V2) +#if defined(ISP_RGBIR_V1) || defined(ISP_RGBIR_V1_1) || defined(ISP_RGBIR_V2) \ + || defined(ISP_RGBIR_V2_1) vvcam_isp_rgbir_ctrl_create(isp_dev); #endif -#if defined(ISP_DG) +#if defined(ISP_DG_V1) vvcam_isp_dg_ctrl_create(isp_dev); #endif -#if defined(ISP_CPD) +#if defined(ISP_CMPD_20BIT) || defined(ISP_CMPD_24BIT) vvcam_isp_cpd_ctrl_create(isp_dev); #endif @@ -365,7 +431,7 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) vvcam_isp_dpf_ctrl_create(isp_dev); #endif -#if defined(ISP_CNR_V1) +#if defined(ISP_CNR_V1) || defined(ISP_CNR_V2_1) || defined(ISP_CNR_V2_2) vvcam_isp_cnr_ctrl_create(isp_dev); #endif @@ -373,6 +439,14 @@ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev) vvcam_isp_gwdr_ctrl_create(isp_dev); #endif +#if defined(ISP_YNR_V1) + vvcam_isp_ynr_ctrl_create(isp_dev); +#endif + +#if defined(ISP_LUT3D_V1) + vvcam_isp_lut3d_ctrl_create(isp_dev); +#endif + isp_dev->sd.ctrl_handler = &isp_dev->ctrl_handler; return 0; diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/vvcam_isp_ctrl.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/vvcam_isp_ctrl.h index 05e3059..0a70449 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/vvcam_isp_ctrl.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/vvcam_isp_ctrl.h @@ -1,59 +1,66 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ -#ifndef __VVCAM_ISP_CTRL_H__ + +#ifndef __VVCAM_ISP_CTRL_H__ #define __VVCAM_ISP_CTRL_H__ + +#ifdef __KERNEL__ #include "vvcam_isp_driver.h" +#else +#include +#endif #define VVCAM_ISP_CID_AE_BASE (V4L2_CID_USER_BASE + 0x2000) #define VVCAM_ISP_CID_AWB_BASE (V4L2_CID_USER_BASE + 0x2100) @@ -84,8 +91,11 @@ #define VVCAM_ISP_CID_AFM_BASE (V4L2_CID_USER_BASE + 0x3A00) #define VVCAM_ISP_CID_EXP_BASE (V4L2_CID_USER_BASE + 0x3B00) #define VVCAM_ISP_CID_GWDR_BASE (V4L2_CID_USER_BASE + 0x3C00) +#define VVCAM_ISP_CID_EXP_V3_BASE (V4L2_CID_USER_BASE + 0x3D00) +#ifdef __KERNEL__ int vvcam_isp_ctrl_init(struct vvcam_isp_dev *isp_dev); int vvcam_isp_ctrl_destroy(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1/vvcam_isp_wb.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1/vvcam_isp_wb.c new file mode 100644 index 0000000..77cb6d7 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1/vvcam_isp_wb.c @@ -0,0 +1,258 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_wb.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_wb_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WB_ENABLE: + case VVCAM_ISP_CID_WB_RESET: + case VVCAM_ISP_CID_WB_R_GAIN: + case VVCAM_ISP_CID_WB_GR_GAIN: + case VVCAM_ISP_CID_WB_GB_GAIN: + case VVCAM_ISP_CID_WB_B_GAIN: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_wb_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WB_ENABLE: + case VVCAM_ISP_CID_WB_R_GAIN: + case VVCAM_ISP_CID_WB_GR_GAIN: + case VVCAM_ISP_CID_WB_GB_GAIN: + case VVCAM_ISP_CID_WB_B_GAIN: + case VVCAM_ISP_CID_WB_STAT_R_GAIN: + case VVCAM_ISP_CID_WB_STAT_GR_GAIN: + case VVCAM_ISP_CID_WB_STAT_GB_GAIN: + case VVCAM_ISP_CID_WB_STAT_B_GAIN: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_wb_ctrl_ops = { + .s_ctrl = vvcam_isp_wb_s_ctrl, + .g_volatile_ctrl = vvcam_isp_wb_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_wb_ctrls[] = { + { + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float (0, 3.996], ratio 256:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_R_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_r_gain", + .step = 1, + .min = 1, + .max = 1022, + .def = 1, + }, + { + /* float (0, 3.996], ratio 256:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_GR_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_gr_gain", + .step = 1, + .min = 1, + .max = 1022, + .def = 1, + }, + { + /* float (0, 3.996], ratio 256:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_GB_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_gb_gain", + .step = 1, + .min = 1, + .max = 1022, + .def = 1, + }, + { + /* float (0, 3.996], ratio 256:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_B_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_b_gain", + .step = 1, + .min = 1, + .max = 1022, + .def = 1, + }, + { + /* float (0, 3.996], ratio 256:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_STAT_R_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_stat_r_gain", + .step = 1, + .min = 1, + .max = 1022, + .def = 1, + }, + { + /* float (0, 3.996], ratio 256:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_STAT_GR_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_stat_gr_gain", + .step = 1, + .min = 1, + .max = 1022, + .def = 1, + }, + { + /* float (0, 3.996], ratio 256:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_STAT_GB_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_stat_gb_gain", + .step = 1, + .min = 1, + .max = 1022, + .def = 1, + }, + { + /* float (0, 3.996], ratio 256:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_STAT_B_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_stat_b_gain", + .step = 1, + .min = 1, + .max = 1022, + .def = 1, + }, +}; + +int vvcam_isp_wb_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_wb_ctrls); +} + +int vvcam_isp_wb_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_wb_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_wb_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp wb ctrl %s failed %d.\n", + vvcam_isp_wb_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1/vvcam_isp_wb.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1/vvcam_isp_wb.h new file mode 100644 index 0000000..9093618 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1/vvcam_isp_wb.h @@ -0,0 +1,77 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_WB_H__ +#define __VVCAM_ISP_WB_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_WB_ENABLE (VVCAM_ISP_CID_WB_BASE + 0x0000) +#define VVCAM_ISP_CID_WB_RESET (VVCAM_ISP_CID_WB_BASE + 0x0001) +#define VVCAM_ISP_CID_WB_R_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0002) +#define VVCAM_ISP_CID_WB_GR_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0003) +#define VVCAM_ISP_CID_WB_GB_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0004) +#define VVCAM_ISP_CID_WB_B_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0005) +#define VVCAM_ISP_CID_WB_STAT_R_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0006) +#define VVCAM_ISP_CID_WB_STAT_GR_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0007) +#define VVCAM_ISP_CID_WB_STAT_GB_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0008) +#define VVCAM_ISP_CID_WB_STAT_B_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0009) + +#ifdef __KERNEL__ +int vvcam_isp_wb_ctrl_count(void); +int vvcam_isp_wb_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1_1/vvcam_isp_wb.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1_1/vvcam_isp_wb.c new file mode 100644 index 0000000..ee209ce --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1_1/vvcam_isp_wb.c @@ -0,0 +1,258 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_wb.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_wb_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WB_ENABLE: + case VVCAM_ISP_CID_WB_RESET: + case VVCAM_ISP_CID_WB_R_GAIN: + case VVCAM_ISP_CID_WB_GR_GAIN: + case VVCAM_ISP_CID_WB_GB_GAIN: + case VVCAM_ISP_CID_WB_B_GAIN: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_wb_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WB_ENABLE: + case VVCAM_ISP_CID_WB_R_GAIN: + case VVCAM_ISP_CID_WB_GR_GAIN: + case VVCAM_ISP_CID_WB_GB_GAIN: + case VVCAM_ISP_CID_WB_B_GAIN: + case VVCAM_ISP_CID_WB_STAT_R_GAIN: + case VVCAM_ISP_CID_WB_STAT_GR_GAIN: + case VVCAM_ISP_CID_WB_STAT_GB_GAIN: + case VVCAM_ISP_CID_WB_STAT_B_GAIN: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_wb_ctrl_ops = { + .s_ctrl = vvcam_isp_wb_s_ctrl, + .g_volatile_ctrl = vvcam_isp_wb_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_wb_ctrls[] = { + { + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + /* float (0, 15.999], ratio 1024:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_R_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_r_gain", + .step = 1, + .min = 1, + .max = 16382, + .def = 1, + }, + { + /* float (0, 15.999], ratio 1024:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_GR_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_gr_gain", + .step = 1, + .min = 1, + .max = 16382, + .def = 1, + }, + { + /* float (0, 15.999], ratio 1024:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_GB_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_gb_gain", + .step = 1, + .min = 1, + .max = 16382, + .def = 1, + }, + { + /* float (0, 15.999], ratio 1024:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_B_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_b_gain", + .step = 1, + .min = 1, + .max = 16382, + .def = 1, + }, + { + /* float (0, 15.999], ratio 1024:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_STAT_R_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_stat_r_gain", + .step = 1, + .min = 1, + .max = 16382, + .def = 1, + }, + { + /* float (0, 15.999], ratio 1024:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_STAT_GR_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_stat_gr_gain", + .step = 1, + .min = 1, + .max = 16382, + .def = 1, + }, + { + /* float (0, 15.999], ratio 1024:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_STAT_GB_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_stat_gb_gain", + .step = 1, + .min = 1, + .max = 16382, + .def = 1, + }, + { + /* float (0, 15.999], ratio 1024:1 */ + .ops = &vvcam_isp_wb_ctrl_ops, + .id = VVCAM_ISP_CID_WB_STAT_B_GAIN, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wb_stat_b_gain", + .step = 1, + .min = 1, + .max = 16382, + .def = 1, + }, +}; + +int vvcam_isp_wb_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_wb_ctrls); +} + +int vvcam_isp_wb_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_wb_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_wb_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp wb ctrl %s failed %d.\n", + vvcam_isp_wb_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1_1/vvcam_isp_wb.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1_1/vvcam_isp_wb.h new file mode 100644 index 0000000..9093618 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wb/wb_v1_1/vvcam_isp_wb.h @@ -0,0 +1,77 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_WB_H__ +#define __VVCAM_ISP_WB_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_WB_ENABLE (VVCAM_ISP_CID_WB_BASE + 0x0000) +#define VVCAM_ISP_CID_WB_RESET (VVCAM_ISP_CID_WB_BASE + 0x0001) +#define VVCAM_ISP_CID_WB_R_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0002) +#define VVCAM_ISP_CID_WB_GR_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0003) +#define VVCAM_ISP_CID_WB_GB_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0004) +#define VVCAM_ISP_CID_WB_B_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0005) +#define VVCAM_ISP_CID_WB_STAT_R_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0006) +#define VVCAM_ISP_CID_WB_STAT_GR_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0007) +#define VVCAM_ISP_CID_WB_STAT_GB_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0008) +#define VVCAM_ISP_CID_WB_STAT_B_GAIN (VVCAM_ISP_CID_WB_BASE + 0x0009) + +#ifdef __KERNEL__ +int vvcam_isp_wb_ctrl_count(void); +int vvcam_isp_wb_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v3/vvcam_isp_wdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v3/vvcam_isp_wdr.c index f34a518..7145038 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v3/vvcam_isp_wdr.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v3/vvcam_isp_wdr.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -94,6 +96,9 @@ static int vvcam_isp_wdr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_WDR_MANU_STRENGTH: case VVCAM_ISP_CID_WDR_MANU_GLOBAL_STRENGTH: case VVCAM_ISP_CID_WDR_MANU_MAX_GAIN: + case VVCAM_ISP_CID_WDR_STAT_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_GLOBAL_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_MAX_GAIN: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -140,18 +145,18 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .step = 1, .min = 0, .max = 128, - .dims = {1, 0, 0, 0}, + .dims = {1}, }, { .ops = &vvcam_isp_wdr_ctrl_ops, .id = VVCAM_ISP_CID_WDR_MANU_GLOBAL_STRENGTH, - .type = V4L2_CTRL_TYPE_U16, + .type = V4L2_CTRL_TYPE_U8, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_wdr_manu_global_strength", .step = 1, .min = 0, .max = 128, - .dims = {1, 0, 0, 0}, + .dims = {1}, }, { .ops = &vvcam_isp_wdr_ctrl_ops, @@ -162,7 +167,40 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .step = 1, .min = 0, .max = 128, - .dims = {1, 0, 0, 0}, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_GLOBAL_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_global_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_max_gain", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, }, }; diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v3/vvcam_isp_wdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v3/vvcam_isp_wdr.h index aed995b..0478647 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v3/vvcam_isp_wdr.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v3/vvcam_isp_wdr.h @@ -1,67 +1,77 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_WDR_H__ #define __VVCAM_ISP_WDR_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_WDR_ENABLE (VVCAM_ISP_CID_WDR_BASE + 0x0000) #define VVCAM_ISP_CID_WDR_RESET (VVCAM_ISP_CID_WDR_BASE + 0x0001) #define VVCAM_ISP_CID_WDR_MANU_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0002) #define VVCAM_ISP_CID_WDR_MANU_GLOBAL_STRENGTH \ (VVCAM_ISP_CID_WDR_BASE + 0x0003) #define VVCAM_ISP_CID_WDR_MANU_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0004) +#define VVCAM_ISP_CID_WDR_STAT_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0005) +#define VVCAM_ISP_CID_WDR_STAT_GLOBAL_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0006) +#define VVCAM_ISP_CID_WDR_STAT_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0007) +#ifdef __KERNEL__ int vvcam_isp_wdr_ctrl_count(void); int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v4/vvcam_isp_wdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v4/vvcam_isp_wdr.c new file mode 100644 index 0000000..ee565cf --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v4/vvcam_isp_wdr.c @@ -0,0 +1,646 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_wdr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_wdr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WDR_ENABLE: + case VVCAM_ISP_CID_WDR_RESET: + case VVCAM_ISP_CID_WDR_MODE: + case VVCAM_ISP_CID_WDR_AUTO_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_HIGH_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_LOW_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_GLOBAL_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_CONTRAST: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_THR: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_CONTRAST: + case VVCAM_ISP_CID_WDR_MANU_GLOBAL_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_HIGH_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_LOW_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_FLAT_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_FLAT_THR: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY: + case VVCAM_ISP_CID_WDR_MANU_GAMMA_DOWN: + case VVCAM_ISP_CID_WDR_MANU_GAMMA_PRE: + case VVCAM_ISP_CID_WDR_MANU_GAMMA_UP: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_wdr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WDR_ENABLE: + case VVCAM_ISP_CID_WDR_RESET: + case VVCAM_ISP_CID_WDR_MODE: + case VVCAM_ISP_CID_WDR_AUTO_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_HIGH_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_LOW_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_GLOBAL_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_CONTRAST: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_THR: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_CONTRAST: + case VVCAM_ISP_CID_WDR_MANU_GLOBAL_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_HIGH_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_LOW_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_FLAT_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_FLAT_THR: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY: + case VVCAM_ISP_CID_WDR_MANU_GAMMA_DOWN: + case VVCAM_ISP_CID_WDR_MANU_GAMMA_PRE: + case VVCAM_ISP_CID_WDR_MANU_GAMMA_UP: + case VVCAM_ISP_CID_WDR_STAT_CONTRAST: + case VVCAM_ISP_CID_WDR_STAT_GLOBAL_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_HIGH_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_LOW_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_FLAT_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_FLAT_THR: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY: + case VVCAM_ISP_CID_WDR_STAT_GAMMA_DOWN: + case VVCAM_ISP_CID_WDR_STAT_GAMMA_PRE: + case VVCAM_ISP_CID_WDR_STAT_GAMMA_UP: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_wdr_ctrl_ops = { + .s_ctrl = vvcam_isp_wdr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_wdr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_level", + .step = 1, + .def = 1, + .min = 1, + .max = 20, + .dims = {1, 0, 0, 0}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_HIGH_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LOW_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_low_strength", + .step = 1, + .min = 0, + .max = 255, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_GLOBAL_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_global_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* int16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_CONTRAST, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_contrast", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_FLAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_flat_strength", + .step = 1, + .min = 0, + .max = 19, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_FLAT_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_flat_thr", + .step = 1, + .min = 0, + .max = 20, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + + /* + manual control type is difference between cam_device and cam_engine + and some code is not match with doc, need to double check. + */ + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_contrast", + .step = 1, + .min = -1023, + .max = 1023, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_GLOBAL_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_global_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_HIGH_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LOW_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_low_strength", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_strength", + .step = 1, + .min = 0, + .max = 19, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_thr", + .step = 1, + .min = 0, + .max = 20, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy", + .step = 1, + .min = 0, + .max = 511, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_GAMMA_DOWN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_gamma_down", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_GAMMA_PRE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_gamma_pre", + .step = 1, + .min = 0, + .max = 1048575, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_GAMMA_UP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_gamma_up", + .step = 1, + .min = 0, + .max = 1048575, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_contrast", + .step = 1, + .min = -1023, + .max = 1023, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_GLOBAL_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_global_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_HIGH_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LOW_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_strength", + .step = 1, + .min = 0, + .max = 255, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_strength", + .step = 1, + .min = 0, + .max = 19, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_thr", + .step = 1, + .min = 0, + .max = 20, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy", + .step = 1, + .min = 0, + .max = 511, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_GAMMA_DOWN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_gamma_down", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_GAMMA_PRE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_gamma_pre", + .step = 1, + .min = 0, + .max = 1048575, + .dims = {20, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_GAMMA_UP, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_gamma_up", + .step = 1, + .min = 0, + .max = 1048575, + .dims = {20, 0, 0, 0}, + }, +}; + +int vvcam_isp_wdr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_wdr_ctrls); +} + +int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_wdr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_wdr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp wdr ctrl %s failed %d.\n", + vvcam_isp_wdr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v4/vvcam_isp_wdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v4/vvcam_isp_wdr.h new file mode 100644 index 0000000..f2a5f31 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v4/vvcam_isp_wdr.h @@ -0,0 +1,120 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_WDR_H__ +#define __VVCAM_ISP_WDR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_WDR_ENABLE (VVCAM_ISP_CID_WDR_BASE + 0x0000) +#define VVCAM_ISP_CID_WDR_RESET (VVCAM_ISP_CID_WDR_BASE + 0x0001) +#define VVCAM_ISP_CID_WDR_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0002) +#define VVCAM_ISP_CID_WDR_AUTO_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x0003) +#define VVCAM_ISP_CID_WDR_AUTO_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0004) +#define VVCAM_ISP_CID_WDR_AUTO_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0005) +#define VVCAM_ISP_CID_WDR_AUTO_HIGH_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0006) +#define VVCAM_ISP_CID_WDR_AUTO_LOW_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0007) +#define VVCAM_ISP_CID_WDR_AUTO_GLOBAL_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0008) +#define VVCAM_ISP_CID_WDR_AUTO_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0009) +#define VVCAM_ISP_CID_WDR_AUTO_FLAT_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x000A) +#define VVCAM_ISP_CID_WDR_AUTO_FLAT_THR (VVCAM_ISP_CID_WDR_BASE + 0x000B) +#define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x000C) +#define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE (VVCAM_ISP_CID_WDR_BASE + 0x000D) + +#define VVCAM_ISP_CID_WDR_MANU_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x000E) +#define VVCAM_ISP_CID_WDR_MANU_GLOBAL_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x000F) +#define VVCAM_ISP_CID_WDR_MANU_HIGH_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0010) +#define VVCAM_ISP_CID_WDR_MANU_LOW_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0011) +#define VVCAM_ISP_CID_WDR_MANU_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0012) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0013) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_THR (VVCAM_ISP_CID_WDR_BASE + 0x0014) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE (VVCAM_ISP_CID_WDR_BASE + 0x0015) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0016) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY (VVCAM_ISP_CID_WDR_BASE + 0x0017) +#define VVCAM_ISP_CID_WDR_MANU_GAMMA_DOWN (VVCAM_ISP_CID_WDR_BASE + 0x0018) +#define VVCAM_ISP_CID_WDR_MANU_GAMMA_PRE (VVCAM_ISP_CID_WDR_BASE + 0x0019) +#define VVCAM_ISP_CID_WDR_MANU_GAMMA_UP (VVCAM_ISP_CID_WDR_BASE + 0x001A) +#define VVCAM_ISP_CID_WDR_STAT_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x001B) +#define VVCAM_ISP_CID_WDR_STAT_GLOBAL_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x001C) +#define VVCAM_ISP_CID_WDR_STAT_HIGH_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x001D) +#define VVCAM_ISP_CID_WDR_STAT_LOW_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x001E) +#define VVCAM_ISP_CID_WDR_STAT_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x001F) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0020) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_THR (VVCAM_ISP_CID_WDR_BASE + 0x0021) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE (VVCAM_ISP_CID_WDR_BASE + 0x0022) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0023) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY (VVCAM_ISP_CID_WDR_BASE + 0x0024) +#define VVCAM_ISP_CID_WDR_STAT_GAMMA_DOWN (VVCAM_ISP_CID_WDR_BASE + 0x0025) +#define VVCAM_ISP_CID_WDR_STAT_GAMMA_PRE (VVCAM_ISP_CID_WDR_BASE + 0x0026) +#define VVCAM_ISP_CID_WDR_STAT_GAMMA_UP (VVCAM_ISP_CID_WDR_BASE + 0x0027) + +#ifdef __KERNEL__ +int vvcam_isp_wdr_ctrl_count(void); +int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5/vvcam_isp_wdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5/vvcam_isp_wdr.c new file mode 100644 index 0000000..6ddb50d --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5/vvcam_isp_wdr.c @@ -0,0 +1,1170 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_wdr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_wdr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WDR_ENABLE: + case VVCAM_ISP_CID_WDR_GLOBAL_CURVE_ENABLE: + case VVCAM_ISP_CID_WDR_RESET: + case VVCAM_ISP_CID_WDR_MODE: + case VVCAM_ISP_CID_WDR_AUTO_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_CONTRAST: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_AUTO_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_H_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_L_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_CONTRAST: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_LUMA_THR: + case VVCAM_ISP_CID_WDR_MANU_FLAT_MODE: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_RATIO: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_THR: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_MAX_GAIN: + case VVCAM_ISP_CID_WDR_MANU_MIN_GAIN: + case VVCAM_ISP_CID_WDR_MANU_H_DIFF: + case VVCAM_ISP_CID_WDR_MANU_L_DIFF: + case VVCAM_ISP_CID_WDR_MANU_SAT_RANGE: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_wdr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WDR_ENABLE: + case VVCAM_ISP_CID_WDR_GLOBAL_CURVE_ENABLE: + case VVCAM_ISP_CID_WDR_MODE: + case VVCAM_ISP_CID_WDR_AUTO_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_CONTRAST: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_AUTO_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_H_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_L_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_CONTRAST: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_LUMA_THR: + case VVCAM_ISP_CID_WDR_MANU_FLAT_MODE: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_RATIO: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_THR: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_MAX_GAIN: + case VVCAM_ISP_CID_WDR_MANU_MIN_GAIN: + case VVCAM_ISP_CID_WDR_MANU_H_DIFF: + case VVCAM_ISP_CID_WDR_MANU_L_DIFF: + case VVCAM_ISP_CID_WDR_MANU_SAT_RANGE: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_STAT_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_H_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_L_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_CONTRAST: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_LUMA_THR: + case VVCAM_ISP_CID_WDR_STAT_FLAT_MODE: + case VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_RATIO: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_THR: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_DEGAMMA: + case VVCAM_ISP_CID_WDR_STAT_MAX_GAIN: + case VVCAM_ISP_CID_WDR_STAT_MIN_GAIN: + case VVCAM_ISP_CID_WDR_STAT_H_DIFF: + case VVCAM_ISP_CID_WDR_STAT_L_DIFF: + case VVCAM_ISP_CID_WDR_STAT_SAT_RANGE: + case VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_wdr_ctrl_ops = { + .s_ctrl = vvcam_isp_wdr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_wdr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_GLOBAL_CURVE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_global_curve_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20} + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {20} + }, + { + /* int16_t 20x array [-1023, 1023]*/ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_CONTRAST, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_contrast", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_log_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array [0.0 ~ 1.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array [0.0 ~ 3.0]*/ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_DEGAMMA, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_degamma", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_contrast", + .step = 1, + .min = -1023, + .max = 1023, + .def = 500, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_luma_thr", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 4x17 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_level_inc", + .step = 1, + .min = 0, + .max = 15, + .dims = {4, 17, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_dark_atten_level", + .step = 1, + .min = 0, + .max = 14, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve_select", + .step = 1, + .min = 0, + .max = 2, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0.0 ~ 20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_anchor_x_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .def = 16, + .dims = {1, 0, 0, 0}, + }, + { + /* float (0.0, 2.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_actual_ratio", + .step = 1, + .min = 1, + .max = 200, + .def = 1, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_threshold", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_low_sat", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float (0.0, 2.2] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_low_fac", + .step = 1, + .min = 1, + .max = 220, + .def = 1, + }, + { + /* float (0.0, 2.2] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_high_fac", + .step = 1, + .min = 1, + .max = 220, + .def = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_global_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0~3.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_degamma", + .step = 1, + .min = 0, + .max = 300, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_MIN_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_min_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_H_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_high_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_L_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_low_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~1 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_range", + .step = 1, + .min = 0, + .max = 100, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_contrast", + .step = 1, + .min = -1023, + .max = 1023, + .def = 500, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_luma_thr", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 4x17 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_level_inc", + .step = 1, + .min = 0, + .max = 15, + .dims = {4, 17, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_dark_atten_level", + .step = 1, + .min = 0, + .max = 14, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve_select", + .step = 1, + .min = 0, + .max = 2, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0.0 ~ 20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_anchor_x_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .def = 16, + .dims = {1, 0, 0, 0}, + }, + { + /* float (0.0, 2.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_actual_ratio", + .step = 1, + .min = 1, + .max = 200, + .def = 1, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_threshold", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_low_sat", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float (0.0, 2.2] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_low_fac", + .step = 1, + .min = 1, + .max = 220, + .def = 1, + }, + { + /* float (0.0, 2.2] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_high_fac", + .step = 1, + .min = 1, + .max = 220, + .def = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_global_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0~3.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_degamma", + .step = 1, + .min = 0, + .max = 300, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MIN_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_min_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_H_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_L_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~1 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_range", + .step = 1, + .min = 0, + .max = 100, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_wdr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_wdr_ctrls); +} + +int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_wdr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_wdr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp wdr ctrl %s failed %d.\n", + vvcam_isp_wdr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5/vvcam_isp_wdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5/vvcam_isp_wdr.h new file mode 100644 index 0000000..3b0be4f --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5/vvcam_isp_wdr.h @@ -0,0 +1,170 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_WDR_H__ +#define __VVCAM_ISP_WDR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_WDR_ENABLE (VVCAM_ISP_CID_WDR_BASE + 0x0000) +#define VVCAM_ISP_CID_WDR_GLOBAL_CURVE_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0001) +#define VVCAM_ISP_CID_WDR_RESET (VVCAM_ISP_CID_WDR_BASE + 0x0002) +#define VVCAM_ISP_CID_WDR_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0003) +#define VVCAM_ISP_CID_WDR_AUTO_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x0004) +#define VVCAM_ISP_CID_WDR_AUTO_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0005) +#define VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0006) +#define VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0007) +#define VVCAM_ISP_CID_WDR_AUTO_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0008) +#define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE (VVCAM_ISP_CID_WDR_BASE + 0x0009) +#define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x000A) +#define VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x000B) +#define VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x000C) +#define VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x000D) +#define VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x000E) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x000F) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0010) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x0011) +#define VVCAM_ISP_CID_WDR_AUTO_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x0012) +#define VVCAM_ISP_CID_WDR_MANU_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0013) +#define VVCAM_ISP_CID_WDR_MANU_H_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0014) +#define VVCAM_ISP_CID_WDR_MANU_L_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0015) +#define VVCAM_ISP_CID_WDR_MANU_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0016) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0017) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0018) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0019) +#define VVCAM_ISP_CID_WDR_MANU_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x001A) + +#define VVCAM_ISP_CID_WDR_MANU_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x001B) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x001C) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC \ + (VVCAM_ISP_CID_WDR_BASE + 0x001D) +#define VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x001E) +#define VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x001F) +#define VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT (VVCAM_ISP_CID_WDR_BASE + 0x0020) +#define VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0021) +#define VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG (VVCAM_ISP_CID_WDR_BASE + 0x0022) +#define VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE (VVCAM_ISP_CID_WDR_BASE + 0x0023) +#define VVCAM_ISP_CID_WDR_MANU_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x0024) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x0025) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT (VVCAM_ISP_CID_WDR_BASE + 0x0026) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC (VVCAM_ISP_CID_WDR_BASE + 0x0027) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC (VVCAM_ISP_CID_WDR_BASE + 0x0028) +#define VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0029) +#define VVCAM_ISP_CID_WDR_MANU_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x002A) +#define VVCAM_ISP_CID_WDR_MANU_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x002B) +#define VVCAM_ISP_CID_WDR_MANU_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x002C) +#define VVCAM_ISP_CID_WDR_MANU_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x002D) +#define VVCAM_ISP_CID_WDR_MANU_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x002E) +#define VVCAM_ISP_CID_WDR_MANU_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x002F) +#define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0030) +#define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x0031) +#define VVCAM_ISP_CID_WDR_STAT_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0032) +#define VVCAM_ISP_CID_WDR_STAT_H_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0033) +#define VVCAM_ISP_CID_WDR_STAT_L_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0034) +#define VVCAM_ISP_CID_WDR_STAT_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0035) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0036) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0037) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0038) +#define VVCAM_ISP_CID_WDR_STAT_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x0039) + +#define VVCAM_ISP_CID_WDR_STAT_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x003A) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x003B) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC \ + (VVCAM_ISP_CID_WDR_BASE + 0x003C) +#define VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x003D) +#define VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x003E) +#define VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT (VVCAM_ISP_CID_WDR_BASE + 0x003F) +#define VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0040) +#define VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG (VVCAM_ISP_CID_WDR_BASE + 0x0041) +#define VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE (VVCAM_ISP_CID_WDR_BASE + 0x0042) +#define VVCAM_ISP_CID_WDR_STAT_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x0043) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x0044) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT (VVCAM_ISP_CID_WDR_BASE + 0x0045) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC (VVCAM_ISP_CID_WDR_BASE + 0x0046) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC (VVCAM_ISP_CID_WDR_BASE + 0x0047) +#define VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0048) +#define VVCAM_ISP_CID_WDR_STAT_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x0049) +#define VVCAM_ISP_CID_WDR_STAT_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x004A) +#define VVCAM_ISP_CID_WDR_STAT_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x004B) +#define VVCAM_ISP_CID_WDR_STAT_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x004C) +#define VVCAM_ISP_CID_WDR_STAT_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x004D) +#define VVCAM_ISP_CID_WDR_STAT_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x004E) +#define VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x004F) +#define VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x0050) + +#ifdef __KERNEL__ +int vvcam_isp_wdr_ctrl_count(void); +int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_1/vvcam_isp_wdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_1/vvcam_isp_wdr.c new file mode 100644 index 0000000..6ddb50d --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_1/vvcam_isp_wdr.c @@ -0,0 +1,1170 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_wdr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_wdr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WDR_ENABLE: + case VVCAM_ISP_CID_WDR_GLOBAL_CURVE_ENABLE: + case VVCAM_ISP_CID_WDR_RESET: + case VVCAM_ISP_CID_WDR_MODE: + case VVCAM_ISP_CID_WDR_AUTO_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_CONTRAST: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_AUTO_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_H_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_L_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_CONTRAST: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_LUMA_THR: + case VVCAM_ISP_CID_WDR_MANU_FLAT_MODE: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_RATIO: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_THR: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_MAX_GAIN: + case VVCAM_ISP_CID_WDR_MANU_MIN_GAIN: + case VVCAM_ISP_CID_WDR_MANU_H_DIFF: + case VVCAM_ISP_CID_WDR_MANU_L_DIFF: + case VVCAM_ISP_CID_WDR_MANU_SAT_RANGE: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_wdr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WDR_ENABLE: + case VVCAM_ISP_CID_WDR_GLOBAL_CURVE_ENABLE: + case VVCAM_ISP_CID_WDR_MODE: + case VVCAM_ISP_CID_WDR_AUTO_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_CONTRAST: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_AUTO_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_H_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_L_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_CONTRAST: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_LUMA_THR: + case VVCAM_ISP_CID_WDR_MANU_FLAT_MODE: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_RATIO: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_THR: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_MAX_GAIN: + case VVCAM_ISP_CID_WDR_MANU_MIN_GAIN: + case VVCAM_ISP_CID_WDR_MANU_H_DIFF: + case VVCAM_ISP_CID_WDR_MANU_L_DIFF: + case VVCAM_ISP_CID_WDR_MANU_SAT_RANGE: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_STAT_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_H_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_L_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_CONTRAST: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_LUMA_THR: + case VVCAM_ISP_CID_WDR_STAT_FLAT_MODE: + case VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_RATIO: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_THR: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_DEGAMMA: + case VVCAM_ISP_CID_WDR_STAT_MAX_GAIN: + case VVCAM_ISP_CID_WDR_STAT_MIN_GAIN: + case VVCAM_ISP_CID_WDR_STAT_H_DIFF: + case VVCAM_ISP_CID_WDR_STAT_L_DIFF: + case VVCAM_ISP_CID_WDR_STAT_SAT_RANGE: + case VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_wdr_ctrl_ops = { + .s_ctrl = vvcam_isp_wdr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_wdr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_GLOBAL_CURVE_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_global_curve_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20} + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {20} + }, + { + /* int16_t 20x array [-1023, 1023]*/ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_CONTRAST, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_contrast", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_log_weight", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array [0.0 ~ 1.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array [0.0 ~ 3.0]*/ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_DEGAMMA, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_degamma", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_contrast", + .step = 1, + .min = -1023, + .max = 1023, + .def = 500, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_luma_thr", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 4x17 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_level_inc", + .step = 1, + .min = 0, + .max = 15, + .dims = {4, 17, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_dark_atten_level", + .step = 1, + .min = 0, + .max = 14, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve_select", + .step = 1, + .min = 0, + .max = 2, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0.0 ~ 20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_anchor_x_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .def = 16, + .dims = {1, 0, 0, 0}, + }, + { + /* float (0.0, 2.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_actual_ratio", + .step = 1, + .min = 1, + .max = 200, + .def = 1, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_threshold", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_low_sat", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float (0.0, 2.2] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_low_fac", + .step = 1, + .min = 1, + .max = 220, + .def = 1, + }, + { + /* float (0.0, 2.2] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_high_fac", + .step = 1, + .min = 1, + .max = 220, + .def = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_global_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0~3.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_degamma", + .step = 1, + .min = 0, + .max = 300, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_MIN_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_min_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_H_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_high_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_L_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_low_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~1 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_range", + .step = 1, + .min = 0, + .max = 100, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_contrast", + .step = 1, + .min = -1023, + .max = 1023, + .def = 500, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_luma_thr", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t 4x17 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_level_inc", + .step = 1, + .min = 0, + .max = 15, + .dims = {4, 17, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_dark_atten_level", + .step = 1, + .min = 0, + .max = 14, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve_select", + .step = 1, + .min = 0, + .max = 2, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0.0 ~ 20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_anchor_x_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .def = 16, + .dims = {1, 0, 0, 0}, + }, + { + /* float (0.0, 2.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_actual_ratio", + .step = 1, + .min = 1, + .max = 200, + .def = 1, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_threshold", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_low_sat", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float (0.0, 2.2] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_low_fac", + .step = 1, + .min = 1, + .max = 220, + .def = 1, + }, + { + /* float (0.0, 2.2] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_high_fac", + .step = 1, + .min = 1, + .max = 220, + .def = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_global_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0~3.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_degamma", + .step = 1, + .min = 0, + .max = 300, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MIN_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_min_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1, 0, 0, 0}, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_H_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_L_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~1 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_range", + .step = 1, + .min = 0, + .max = 100, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_wdr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_wdr_ctrls); +} + +int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_wdr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_wdr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp wdr ctrl %s failed %d.\n", + vvcam_isp_wdr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_1/vvcam_isp_wdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_1/vvcam_isp_wdr.h new file mode 100644 index 0000000..3b0be4f --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_1/vvcam_isp_wdr.h @@ -0,0 +1,170 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_WDR_H__ +#define __VVCAM_ISP_WDR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_WDR_ENABLE (VVCAM_ISP_CID_WDR_BASE + 0x0000) +#define VVCAM_ISP_CID_WDR_GLOBAL_CURVE_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0001) +#define VVCAM_ISP_CID_WDR_RESET (VVCAM_ISP_CID_WDR_BASE + 0x0002) +#define VVCAM_ISP_CID_WDR_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0003) +#define VVCAM_ISP_CID_WDR_AUTO_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x0004) +#define VVCAM_ISP_CID_WDR_AUTO_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0005) +#define VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0006) +#define VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0007) +#define VVCAM_ISP_CID_WDR_AUTO_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0008) +#define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE (VVCAM_ISP_CID_WDR_BASE + 0x0009) +#define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x000A) +#define VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x000B) +#define VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x000C) +#define VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x000D) +#define VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x000E) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x000F) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0010) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x0011) +#define VVCAM_ISP_CID_WDR_AUTO_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x0012) +#define VVCAM_ISP_CID_WDR_MANU_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0013) +#define VVCAM_ISP_CID_WDR_MANU_H_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0014) +#define VVCAM_ISP_CID_WDR_MANU_L_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0015) +#define VVCAM_ISP_CID_WDR_MANU_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0016) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0017) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0018) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0019) +#define VVCAM_ISP_CID_WDR_MANU_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x001A) + +#define VVCAM_ISP_CID_WDR_MANU_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x001B) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x001C) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC \ + (VVCAM_ISP_CID_WDR_BASE + 0x001D) +#define VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x001E) +#define VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x001F) +#define VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT (VVCAM_ISP_CID_WDR_BASE + 0x0020) +#define VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0021) +#define VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG (VVCAM_ISP_CID_WDR_BASE + 0x0022) +#define VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE (VVCAM_ISP_CID_WDR_BASE + 0x0023) +#define VVCAM_ISP_CID_WDR_MANU_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x0024) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x0025) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT (VVCAM_ISP_CID_WDR_BASE + 0x0026) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC (VVCAM_ISP_CID_WDR_BASE + 0x0027) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC (VVCAM_ISP_CID_WDR_BASE + 0x0028) +#define VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0029) +#define VVCAM_ISP_CID_WDR_MANU_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x002A) +#define VVCAM_ISP_CID_WDR_MANU_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x002B) +#define VVCAM_ISP_CID_WDR_MANU_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x002C) +#define VVCAM_ISP_CID_WDR_MANU_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x002D) +#define VVCAM_ISP_CID_WDR_MANU_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x002E) +#define VVCAM_ISP_CID_WDR_MANU_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x002F) +#define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0030) +#define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x0031) +#define VVCAM_ISP_CID_WDR_STAT_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0032) +#define VVCAM_ISP_CID_WDR_STAT_H_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0033) +#define VVCAM_ISP_CID_WDR_STAT_L_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0034) +#define VVCAM_ISP_CID_WDR_STAT_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0035) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0036) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0037) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0038) +#define VVCAM_ISP_CID_WDR_STAT_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x0039) + +#define VVCAM_ISP_CID_WDR_STAT_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x003A) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x003B) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC \ + (VVCAM_ISP_CID_WDR_BASE + 0x003C) +#define VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x003D) +#define VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x003E) +#define VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT (VVCAM_ISP_CID_WDR_BASE + 0x003F) +#define VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0040) +#define VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG (VVCAM_ISP_CID_WDR_BASE + 0x0041) +#define VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE (VVCAM_ISP_CID_WDR_BASE + 0x0042) +#define VVCAM_ISP_CID_WDR_STAT_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x0043) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x0044) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT (VVCAM_ISP_CID_WDR_BASE + 0x0045) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC (VVCAM_ISP_CID_WDR_BASE + 0x0046) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC (VVCAM_ISP_CID_WDR_BASE + 0x0047) +#define VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0048) +#define VVCAM_ISP_CID_WDR_STAT_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x0049) +#define VVCAM_ISP_CID_WDR_STAT_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x004A) +#define VVCAM_ISP_CID_WDR_STAT_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x004B) +#define VVCAM_ISP_CID_WDR_STAT_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x004C) +#define VVCAM_ISP_CID_WDR_STAT_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x004D) +#define VVCAM_ISP_CID_WDR_STAT_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x004E) +#define VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x004F) +#define VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x0050) + +#ifdef __KERNEL__ +int vvcam_isp_wdr_ctrl_count(void); +int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2/vvcam_isp_wdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2/vvcam_isp_wdr.c index 8759873..f16f9da 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2/vvcam_isp_wdr.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2/vvcam_isp_wdr.c @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #include #include "vvcam_isp_driver.h" @@ -77,6 +79,7 @@ static int vvcam_isp_wdr_s_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_WDR_AUTO_LUMA_THR: case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: case VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL: case VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE: case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN: case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP: @@ -114,7 +117,7 @@ static int vvcam_isp_wdr_s_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC: case VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL: case VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT: - case VVCAM_ISP_CID_WDR_MANU_WDR_CURVE: + case VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT: case VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT: case VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG: case VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE: @@ -142,7 +145,6 @@ static int vvcam_isp_wdr_s_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG: case VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG: case VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE: - // case VVCAM_ISP_CID_WDR_MANU_LIGHT_ENABLE: case VVCAM_ISP_CID_WDR_MANU_DAMP_MODE: case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF: case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MAX: @@ -189,6 +191,7 @@ static int vvcam_isp_wdr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_WDR_AUTO_LUMA_THR: case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: case VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL: case VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE: case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN: case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP: @@ -226,7 +229,7 @@ static int vvcam_isp_wdr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC: case VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL: case VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT: - case VVCAM_ISP_CID_WDR_MANU_WDR_CURVE: + case VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT: case VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT: case VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG: case VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE: @@ -254,7 +257,6 @@ static int vvcam_isp_wdr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG: case VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG: case VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE: - // case VVCAM_ISP_CID_WDR_MANU_LIGHT_ENABLE: case VVCAM_ISP_CID_WDR_MANU_DAMP_MODE: case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF: case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MAX: @@ -270,6 +272,62 @@ static int vvcam_isp_wdr_g_ctrl(struct v4l2_ctrl *ctrl) case VVCAM_ISP_CID_WDR_MANU_RGB_COEF: case VVCAM_ISP_CID_WDR_MANU_LIGHT_WEIGHT: case VVCAM_ISP_CID_WDR_MANU_COLOR_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_H_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_L_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_CONTRAST: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_LUMA_THR: + case VVCAM_ISP_CID_WDR_STAT_FLAT_MODE: + case VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_RATIO: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_THR: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_DEGAMMA: + case VVCAM_ISP_CID_WDR_STAT_MAX_GAIN: + case VVCAM_ISP_CID_WDR_STAT_MIN_GAIN: + case VVCAM_ISP_CID_WDR_STAT_H_DIFF: + case VVCAM_ISP_CID_WDR_STAT_L_DIFF: + case VVCAM_ISP_CID_WDR_STAT_SAT_RANGE: + case VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_STAT_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_DAMP_MODE: + case VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_COEF: + case VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MAX: + case VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MIN: + case VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_COEF: + case VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MAX: + case VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MIN: + case VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_DEC_LIMIT: + case VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_INC_LIMIT: + case VVCAM_ISP_CID_WDR_STAT_DAMP_FILTER_SIZE: + case VVCAM_ISP_CID_WDR_STAT_DAMP_H_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_DAMP_L_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_RGB_COEF: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_COLOR_WEIGHT: ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); break; @@ -360,19 +418,19 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_high_strength", .step = 1, .min = 0, - .max = 0xFF, + .max = 128, .dims = {20} }, { - /* uint8_t 20x array */ + /* uint16_t 20x array */ .ops = &vvcam_isp_wdr_ctrl_ops, .id = VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH, - .type = V4L2_CTRL_TYPE_U8, + .type = V4L2_CTRL_TYPE_U16, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_wdr_auto_low_strength", .step = 1, .min = 0, - .max = 0xFF, + .max = 256, .dims = {20} }, { @@ -384,7 +442,7 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_entropy_base", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 1023, .dims = {20} }, { @@ -395,8 +453,9 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_wdr_auto_luma_threshold", .step = 1, - .min = 0, - .max = 0xFFFF, + .min = 1, + .max = 1023, + .def = 1, .dims = {20} }, { @@ -408,7 +467,7 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_entropy_slope", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 1023, .dims = {20}, }, { @@ -420,7 +479,19 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_flat_level", .step = 1, .min = 0, - .max = 0xFF, + .max = 15, + .dims = {20}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_global_flat_lv", + .step = 1, + .min = 0, + .max = 15, .dims = {20}, }, { @@ -444,7 +515,7 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_sat_thr_gain_down", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 256, .dims = {20}, }, { @@ -456,7 +527,7 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_sat_thr_gain_up", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 256, .dims = {20}, }, { @@ -586,8 +657,9 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_wdr_auto_edr_level", .step = 1, - .min = 0, - .max = 0xFF, + .min = 1, + .max = 20, + .def = 1, .dims = {1}, }, { @@ -603,7 +675,7 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .dims = {20}, }, { - /* uint16_t 20x20 array */ + /* int16_t 20x20 array */ .ops = &vvcam_isp_wdr_ctrl_ops, .id = VVCAM_ISP_CID_WDR_AUTO_CONTRAST, .type = V4L2_CTRL_TYPE_U16, @@ -623,7 +695,7 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_fixed_weight", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 1023, .dims = {20, 20}, }, { @@ -635,7 +707,7 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_log_weight", .step = 1, .min = 0, - .max = 0xFF, + .max = 10, .dims = {20, 20}, }, { @@ -659,7 +731,7 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_anchor_slope", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 4096, .dims = {20, 20}, }, { @@ -671,7 +743,7 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_max_gain", .step = 1, .min = 0, - .max = 0xFFFF, + .max = 4096, .dims = {20, 20}, }, { @@ -707,7 +779,7 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .name = "isp_wdr_auto_color_weight", .step = 1, .min = 0, - .max = 1, + .max = 128, .dims = {20, 20, 3}, }, { @@ -855,10 +927,10 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { }, { .ops = &vvcam_isp_wdr_ctrl_ops, - .id = VVCAM_ISP_CID_WDR_MANU_WDR_CURVE, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT, .type = V4L2_CTRL_TYPE_U8, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_wdr_manu_wdr_curve", + .name = "isp_wdr_manu_curve_select", .step = 1, .min = 0, .max = 2, @@ -899,15 +971,16 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .dims = {1}, }, { - /* float 0.0 ~ 2.0 */ + /* float (0.0, 2.0] */ .ops = &vvcam_isp_wdr_ctrl_ops, .id = VVCAM_ISP_CID_WDR_MANU_RATIO, .type = V4L2_CTRL_TYPE_INTEGER, .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, .name = "isp_wdr_manu_actual_ratio", .step = 1, - .min = 0, + .min = 1, .max = 200, + .def = 1, }, { /* float 0.0 ~ 1.0 */ @@ -1168,18 +1241,6 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .max = 0xFF, .dims = {1}, }, -/* - { - .ops = &vvcam_isp_wdr_ctrl_ops, - .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_ENABLE, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, - .name = "isp_wdr_manu_light_enable", - .step = 1, - .min = 0, - .max = 1, - }, -*/ { .ops = &vvcam_isp_wdr_ctrl_ops, .id = VVCAM_ISP_CID_WDR_MANU_DAMP_MODE, @@ -1347,6 +1408,632 @@ const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { .max = 128, .dims = {3}, }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_contrast", + .step = 1, + .min = -1023, + .max = 1023, + .def = 500, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_luma_thr", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + /* uint8_t 4x17 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_level_inc", + .step = 1, + .min = 0, + .max = 15, + .dims = {4,17}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_dark_atten_level", + .step = 1, + .min = 0, + .max = 14, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve_select", + .step = 1, + .min = 0, + .max = 2, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {1}, + }, + { + /* float 0.0 ~ 20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_anchor_x_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .def = 16, + .dims = {1}, + }, + { + /* float (0.0, 2.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_actual_ratio", + .step = 1, + .min = 1, + .max = 200, + .def = 1, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_threshold", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_low_sat", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 2.2 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_low_fac", + .step = 1, + .min = 0, + .max = 220, + }, + { + /* float 0.0 ~ 2.2 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_high_fac", + .step = 1, + .min = 0, + .max = 220, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_global_flat_lv", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + /* float 0~3.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_degamma", + .step = 1, + .min = 0, + .max = 300, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MIN_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_min_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1}, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_H_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_L_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~1 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_range", + .step = 1, + .min = 0, + .max = 100, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_L_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_sat_l_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_H_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_sat_h_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_R_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_r_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_G_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_g_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_B_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_b_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_Y_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_y_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_C_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_c_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_M_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_m_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_HLC_BASE_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_hlc_base_log", + .step = 1, + .min = 0, + .max = 1900, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_HLC_SLOPE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_hlc_slope", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_MODE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_mode", + .step = 1, + .min = 0, + .max = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_curve_coef", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_curve_max", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_curve_min", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_avg_coef", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_avg_max", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_avg_min", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_DEC_LIMIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_coef_dec_lt", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_INC_LIMIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_coef_inc_lt", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_FILTER_SIZE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_filter_size", + .step = 1, + .min = 0, + .max = 16, + .dims = {1}, + }, + { + /* float 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_H_THR_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_h_thr_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* float 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_L_THR_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_l_thr_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_RGB_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_rgb_coef", + .step = 1, + .min = 0, + .max = 128, + .dims = {3}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_lightness_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_color_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {3}, + }, }; int vvcam_isp_wdr_ctrl_count(void) diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2/vvcam_isp_wdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2/vvcam_isp_wdr.h index 8eba320..2ddc09b 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2/vvcam_isp_wdr.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2/vvcam_isp_wdr.h @@ -1,59 +1,63 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_WDR_H__ #define __VVCAM_ISP_WDR_H__ +#include "vvcam_isp_ctrl.h" + #define VVCAM_ISP_CID_WDR_ENABLE (VVCAM_ISP_CID_WDR_BASE + 0x0000) #define VVCAM_ISP_CID_WDR_RESET (VVCAM_ISP_CID_WDR_BASE + 0x0001) #define VVCAM_ISP_CID_WDR_HALO_COLOR_FADING_ENABLE \ @@ -68,114 +72,112 @@ #define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE \ (VVCAM_ISP_CID_WDR_BASE + 0x000A) #define VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x000B) -#define VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x000C) +#define VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x000C) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x000D) #define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN \ - (VVCAM_ISP_CID_WDR_BASE + 0x000D) -#define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP \ (VVCAM_ISP_CID_WDR_BASE + 0x000E) -#define VVCAM_ISP_CID_WDR_AUTO_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x000F) -#define VVCAM_ISP_CID_WDR_AUTO_HLC_BASE_LOG (VVCAM_ISP_CID_WDR_BASE + 0x0010) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x000F) +#define VVCAM_ISP_CID_WDR_AUTO_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x0010) +#define VVCAM_ISP_CID_WDR_AUTO_HLC_BASE_LOG (VVCAM_ISP_CID_WDR_BASE + 0x0011) #define VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_L_THR \ - (VVCAM_ISP_CID_WDR_BASE + 0x0011) -#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_H_THR \ (VVCAM_ISP_CID_WDR_BASE + 0x0012) -#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_R_THR_LOG \ +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_H_THR \ (VVCAM_ISP_CID_WDR_BASE + 0x0013) -#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_G_THR_LOG \ +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_R_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x0014) -#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_B_THR_LOG \ +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_G_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x0015) -#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_Y_THR_LOG \ +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_B_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x0016) -#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_C_THR_LOG \ +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_Y_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x0017) -#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_M_THR_LOG \ +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_C_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x0018) -#define VVCAM_ISP_CID_WDR_AUTO_EDR_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x0019) -#define VVCAM_ISP_CID_WDR_AUTO_EDR (VVCAM_ISP_CID_WDR_BASE + 0x001A) -#define VVCAM_ISP_CID_WDR_AUTO_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x001B) -#define VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x001C) -#define VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x001D) -#define VVCAM_ISP_CID_WDR_AUTO_ANCHOR_X_LOG (VVCAM_ISP_CID_WDR_BASE + 0x001E) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_M_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0019) +#define VVCAM_ISP_CID_WDR_AUTO_EDR_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x001A) +#define VVCAM_ISP_CID_WDR_AUTO_EDR (VVCAM_ISP_CID_WDR_BASE + 0x001B) +#define VVCAM_ISP_CID_WDR_AUTO_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x001C) +#define VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x001D) +#define VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x001E) +#define VVCAM_ISP_CID_WDR_AUTO_ANCHOR_X_LOG (VVCAM_ISP_CID_WDR_BASE + 0x001F) #define VVCAM_ISP_CID_WDR_AUTO_ANCHOR_SLOPE \ - (VVCAM_ISP_CID_WDR_BASE + 0x001F) -#define VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0020) -#define VVCAM_ISP_CID_WDR_AUTO_HLC_SLOPE (VVCAM_ISP_CID_WDR_BASE + 0x0021) + (VVCAM_ISP_CID_WDR_BASE + 0x0020) +#define VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0021) +#define VVCAM_ISP_CID_WDR_AUTO_HLC_SLOPE (VVCAM_ISP_CID_WDR_BASE + 0x0022) #define VVCAM_ISP_CID_WDR_AUTO_LIGHT_ENABLE_TBL \ - (VVCAM_ISP_CID_WDR_BASE + 0x0022) -#define VVCAM_ISP_CID_WDR_AUTO_COLOR_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0023) + (VVCAM_ISP_CID_WDR_BASE + 0x0023) +#define VVCAM_ISP_CID_WDR_AUTO_COLOR_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0024) -#define VVCAM_ISP_CID_WDR_MANU_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0024) +#define VVCAM_ISP_CID_WDR_MANU_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0025) #define VVCAM_ISP_CID_WDR_MANU_H_STRENGTH \ - (VVCAM_ISP_CID_WDR_BASE + 0x0025) -#define VVCAM_ISP_CID_WDR_MANU_L_STRENGTH \ (VVCAM_ISP_CID_WDR_BASE + 0x0026) -#define VVCAM_ISP_CID_WDR_MANU_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0027) +#define VVCAM_ISP_CID_WDR_MANU_L_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0027) +#define VVCAM_ISP_CID_WDR_MANU_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0028) #define VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE \ - (VVCAM_ISP_CID_WDR_BASE + 0x0028) -#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE \ (VVCAM_ISP_CID_WDR_BASE + 0x0029) -#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE \ +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE \ (VVCAM_ISP_CID_WDR_BASE + 0x002A) -#define VVCAM_ISP_CID_WDR_MANU_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x002B) -#define VVCAM_ISP_CID_WDR_MANU_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x002C) -#define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x002D) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x002B) +#define VVCAM_ISP_CID_WDR_MANU_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x002C) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x002D) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x002E) #define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC \ - (VVCAM_ISP_CID_WDR_BASE + 0x002E) -#define VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL \ (VVCAM_ISP_CID_WDR_BASE + 0x002F) -#define VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT \ +#define VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL \ (VVCAM_ISP_CID_WDR_BASE + 0x0030) -#define VVCAM_ISP_CID_WDR_MANU_WDR_CURVE (VVCAM_ISP_CID_WDR_BASE + 0x0031) -#define VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0032) +#define VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0031) +#define VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT (VVCAM_ISP_CID_WDR_BASE + 0x0032) +#define VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0033) #define VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG \ - (VVCAM_ISP_CID_WDR_BASE + 0x0033) -#define VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE \ (VVCAM_ISP_CID_WDR_BASE + 0x0034) -#define VVCAM_ISP_CID_WDR_MANU_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x0035) -#define VVCAM_ISP_CID_WDR_MANU_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x0036) +#define VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0035) +#define VVCAM_ISP_CID_WDR_MANU_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x0036) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x0037) #define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT \ - (VVCAM_ISP_CID_WDR_BASE + 0x0037) -#define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC \ (VVCAM_ISP_CID_WDR_BASE + 0x0038) -#define VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC \ +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC \ (VVCAM_ISP_CID_WDR_BASE + 0x0039) -#define VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL \ +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC \ (VVCAM_ISP_CID_WDR_BASE + 0x003A) -#define VVCAM_ISP_CID_WDR_MANU_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x003B) -#define VVCAM_ISP_CID_WDR_MANU_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x003C) -#define VVCAM_ISP_CID_WDR_MANU_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x003D) -#define VVCAM_ISP_CID_WDR_MANU_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x003E) -#define VVCAM_ISP_CID_WDR_MANU_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x003F) -#define VVCAM_ISP_CID_WDR_MANU_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x0040) +#define VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x003B) +#define VVCAM_ISP_CID_WDR_MANU_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x003C) +#define VVCAM_ISP_CID_WDR_MANU_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x003D) +#define VVCAM_ISP_CID_WDR_MANU_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x003E) +#define VVCAM_ISP_CID_WDR_MANU_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x003F) +#define VVCAM_ISP_CID_WDR_MANU_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x0040) +#define VVCAM_ISP_CID_WDR_MANU_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x0041) #define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN \ - (VVCAM_ISP_CID_WDR_BASE + 0x0041) -#define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP \ (VVCAM_ISP_CID_WDR_BASE + 0x0042) -#define VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_L_THR \ +#define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP \ (VVCAM_ISP_CID_WDR_BASE + 0x0043) -#define VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_H_THR \ +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_L_THR \ (VVCAM_ISP_CID_WDR_BASE + 0x0044) -#define VVCAM_ISP_CID_WDR_MANU_LIGHT_R_THR_LOG \ +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_H_THR \ (VVCAM_ISP_CID_WDR_BASE + 0x0045) -#define VVCAM_ISP_CID_WDR_MANU_LIGHT_G_THR_LOG \ +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_R_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x0046) -#define VVCAM_ISP_CID_WDR_MANU_LIGHT_B_THR_LOG \ +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_G_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x0047) -#define VVCAM_ISP_CID_WDR_MANU_LIGHT_Y_THR_LOG \ +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_B_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x0048) -#define VVCAM_ISP_CID_WDR_MANU_LIGHT_C_THR_LOG \ +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_Y_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x0049) -#define VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG \ +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_C_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x004A) -#define VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG \ +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x004B) -#define VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE \ +#define VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG \ (VVCAM_ISP_CID_WDR_BASE + 0x004C) -/* -#define VVCAM_ISP_CID_WDR_MANU_LIGHT_ENABLE \ +#define VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE \ (VVCAM_ISP_CID_WDR_BASE + 0x004D) -*/ #define VVCAM_ISP_CID_WDR_MANU_DAMP_MODE (VVCAM_ISP_CID_WDR_BASE + 0x004E) #define VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF \ (VVCAM_ISP_CID_WDR_BASE + 0x004F) @@ -205,7 +207,105 @@ #define VVCAM_ISP_CID_WDR_MANU_COLOR_WEIGHT \ (VVCAM_ISP_CID_WDR_BASE + 0x005C) +#define VVCAM_ISP_CID_WDR_STAT_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x005D) +#define VVCAM_ISP_CID_WDR_STAT_H_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x005E) +#define VVCAM_ISP_CID_WDR_STAT_L_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x005F) +#define VVCAM_ISP_CID_WDR_STAT_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0060) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0061) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0062) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0063) +#define VVCAM_ISP_CID_WDR_STAT_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x0064) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0065) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x0066) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0067) +#define VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0068) +#define VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0069) +#define VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT (VVCAM_ISP_CID_WDR_BASE + 0x006A) +#define VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x006B) +#define VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x006C) +#define VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x006D) +#define VVCAM_ISP_CID_WDR_STAT_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x006E) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x006F) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0070) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0071) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0072) +#define VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0073) +#define VVCAM_ISP_CID_WDR_STAT_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x0074) +#define VVCAM_ISP_CID_WDR_STAT_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0075) +#define VVCAM_ISP_CID_WDR_STAT_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0076) +#define VVCAM_ISP_CID_WDR_STAT_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x0077) +#define VVCAM_ISP_CID_WDR_STAT_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x0078) +#define VVCAM_ISP_CID_WDR_STAT_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x0079) +#define VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x007A) +#define VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x007B) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_L_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x007C) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_H_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x007D) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_R_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x007E) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_G_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x007F) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_B_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0080) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_Y_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0081) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_C_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0082) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_M_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0083) +#define VVCAM_ISP_CID_WDR_STAT_HLC_BASE_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0084) +#define VVCAM_ISP_CID_WDR_STAT_HLC_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0085) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0086) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_COEF \ + (VVCAM_ISP_CID_WDR_BASE + 0x0087) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MAX \ + (VVCAM_ISP_CID_WDR_BASE + 0x0088) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MIN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0089) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_COEF \ + (VVCAM_ISP_CID_WDR_BASE + 0x008A) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MAX \ + (VVCAM_ISP_CID_WDR_BASE + 0x008B) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MIN \ + (VVCAM_ISP_CID_WDR_BASE + 0x008C) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_DEC_LIMIT \ + (VVCAM_ISP_CID_WDR_BASE + 0x008D) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_INC_LIMIT \ + (VVCAM_ISP_CID_WDR_BASE + 0x008E) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_FILTER_SIZE \ + (VVCAM_ISP_CID_WDR_BASE + 0x008F) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_H_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0090) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_L_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0091) +#define VVCAM_ISP_CID_WDR_STAT_RGB_COEF (VVCAM_ISP_CID_WDR_BASE + 0x0092) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0093) +#define VVCAM_ISP_CID_WDR_STAT_COLOR_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0094) + +#ifdef __KERNEL__ int vvcam_isp_wdr_ctrl_count(void); int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2_1/vvcam_isp_wdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2_1/vvcam_isp_wdr.c new file mode 100644 index 0000000..52a4c1a --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2_1/vvcam_isp_wdr.c @@ -0,0 +1,2031 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_wdr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_wdr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WDR_ENABLE: + case VVCAM_ISP_CID_WDR_RESET: + case VVCAM_ISP_CID_WDR_HALO_COLOR_FADING_ENABLE: + case VVCAM_ISP_CID_WDR_MODE: + case VVCAM_ISP_CID_WDR_AUTO_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_AUTO_LUMA_THR: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_AUTO_DEGAMMA: + case VVCAM_ISP_CID_WDR_AUTO_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_CONTRAST: + case VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_AUTO_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_ENABLE_TBL: + case VVCAM_ISP_CID_WDR_AUTO_COLOR_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_H_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_L_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_CONTRAST: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_LUMA_THR: + case VVCAM_ISP_CID_WDR_MANU_FLAT_MODE: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_RATIO: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_THR: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_MAX_GAIN: + case VVCAM_ISP_CID_WDR_MANU_MIN_GAIN: + case VVCAM_ISP_CID_WDR_MANU_H_DIFF: + case VVCAM_ISP_CID_WDR_MANU_L_DIFF: + case VVCAM_ISP_CID_WDR_MANU_SAT_RANGE: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_MODE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MAX: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MIN: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_COEF: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MAX: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MIN: + case VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_DEC_LIMIT: + case VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_INC_LIMIT: + case VVCAM_ISP_CID_WDR_MANU_DAMP_FILTER_SIZE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_H_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_DAMP_L_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_RGB_COEF: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_COLOR_WEIGHT: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_wdr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WDR_ENABLE: + case VVCAM_ISP_CID_WDR_RESET: + case VVCAM_ISP_CID_WDR_HALO_COLOR_FADING_ENABLE: + case VVCAM_ISP_CID_WDR_MODE: + case VVCAM_ISP_CID_WDR_AUTO_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_AUTO_LUMA_THR: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_AUTO_DEGAMMA: + case VVCAM_ISP_CID_WDR_AUTO_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_CONTRAST: + case VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_AUTO_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_ENABLE_TBL: + case VVCAM_ISP_CID_WDR_AUTO_COLOR_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_H_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_L_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_CONTRAST: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_LUMA_THR: + case VVCAM_ISP_CID_WDR_MANU_FLAT_MODE: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_RATIO: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_THR: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_MAX_GAIN: + case VVCAM_ISP_CID_WDR_MANU_MIN_GAIN: + case VVCAM_ISP_CID_WDR_MANU_H_DIFF: + case VVCAM_ISP_CID_WDR_MANU_L_DIFF: + case VVCAM_ISP_CID_WDR_MANU_SAT_RANGE: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_MODE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MAX: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MIN: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_COEF: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MAX: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MIN: + case VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_DEC_LIMIT: + case VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_INC_LIMIT: + case VVCAM_ISP_CID_WDR_MANU_DAMP_FILTER_SIZE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_H_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_DAMP_L_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_RGB_COEF: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_COLOR_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_H_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_L_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_CONTRAST: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_LUMA_THR: + case VVCAM_ISP_CID_WDR_STAT_FLAT_MODE: + case VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_RATIO: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_THR: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_DEGAMMA: + case VVCAM_ISP_CID_WDR_STAT_MAX_GAIN: + case VVCAM_ISP_CID_WDR_STAT_MIN_GAIN: + case VVCAM_ISP_CID_WDR_STAT_H_DIFF: + case VVCAM_ISP_CID_WDR_STAT_L_DIFF: + case VVCAM_ISP_CID_WDR_STAT_SAT_RANGE: + case VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_STAT_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_DAMP_MODE: + case VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_COEF: + case VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MAX: + case VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MIN: + case VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_COEF: + case VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MAX: + case VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MIN: + case VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_DEC_LIMIT: + case VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_INC_LIMIT: + case VVCAM_ISP_CID_WDR_STAT_DAMP_FILTER_SIZE: + case VVCAM_ISP_CID_WDR_STAT_DAMP_H_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_DAMP_L_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_RGB_COEF: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_COLOR_WEIGHT: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_wdr_ctrl_ops = { + .s_ctrl = vvcam_isp_wdr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_wdr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_HALO_COLOR_FADING_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_halo_color_fading_en", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1} + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20} + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20} + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {20} + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20} + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_luma_threshold", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {20} + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {20}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_global_flat_lv", + .step = 1, + .min = 0, + .max = 15, + .dims = {20}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {20}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {20}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_DEGAMMA, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_degamma", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_HLC_BASE_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_hlc_base_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_L_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_sat_low_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {20} + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_H_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_sat_high_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {20} + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_R_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_r_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4} + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_G_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_g_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4} + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_B_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_b_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4} + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_Y_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_y_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4} + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_C_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_c_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4}, + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_M_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_m_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4}, + }, + { + /* int16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_CONTRAST, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_contrast", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {20}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {20}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_anchor_x_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .dims = {20}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {20}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_HLC_SLOPE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_hlc_slope", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {20}, + }, + { + /* bool 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_ENABLE_TBL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_enable_tbl", + .step = 1, + .min = 0, + .max = 1, + .dims = {20}, + }, + { + /* uint8_t 20x3 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_color_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 3}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_contrast", + .step = 1, + .min = -1023, + .max = 1023, + .def = 500, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_luma_thr", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + /* uint8_t 4x17 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_level_inc", + .step = 1, + .min = 0, + .max = 15, + .dims = {4,17}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_dark_atten_level", + .step = 1, + .min = 0, + .max = 14, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve_select", + .step = 1, + .min = 0, + .max = 2, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {1}, + }, + { + /* float 0.0 ~ 20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_anchor_x_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .def = 16, + .dims = {1}, + }, + { + /* float (0.0, 2.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_actual_ratio", + .step = 1, + .min = 1, + .max = 200, + .def = 1, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_threshold", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_low_sat", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 2.2 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_low_fac", + .step = 1, + .min = 0, + .max = 220, + }, + { + /* float 0.0 ~ 2.2 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_high_fac", + .step = 1, + .min = 0, + .max = 220, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_global_flat_lv", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + /* float 0~3.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_degamma", + .step = 1, + .min = 0, + .max = 300, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_MIN_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_min_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1}, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_H_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_high_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_L_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_low_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~1 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_range", + .step = 1, + .min = 0, + .max = 100, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_L_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_sat_l_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_H_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_sat_h_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_R_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_r_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_G_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_g_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_B_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_b_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_Y_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_y_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_C_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_c_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_m_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_hlc_base_log", + .step = 1, + .min = 0, + .max = 1900, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_hlc_slope", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_MODE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_mode", + .step = 1, + .min = 0, + .max = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_curve_coef", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_curve_max", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_curve_min", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_avg_coef", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_avg_max", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_avg_min", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_DEC_LIMIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_coef_dec_lt", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_INC_LIMIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_coef_inc_lt", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_FILTER_SIZE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_filter_size", + .step = 1, + .min = 0, + .max = 16, + .dims = {1}, + }, + { + /* float 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_H_THR_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_h_thr_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* float 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_L_THR_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_l_thr_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_RGB_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_rgb_coef", + .step = 1, + .min = 0, + .max = 128, + .dims = {3}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_lightness_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_color_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {3}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_contrast", + .step = 1, + .min = -1023, + .max = 1023, + .def = 500, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_luma_thr", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + /* uint8_t 4x17 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_level_inc", + .step = 1, + .min = 0, + .max = 15, + .dims = {4,17}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_dark_atten_level", + .step = 1, + .min = 0, + .max = 14, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve_select", + .step = 1, + .min = 0, + .max = 2, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {1}, + }, + { + /* float 0.0 ~ 20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_anchor_x_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .def = 16, + .dims = {1}, + }, + { + /* float (0.0, 2.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_actual_ratio", + .step = 1, + .min = 1, + .max = 200, + .def = 1, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_threshold", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_low_sat", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 2.2 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_low_fac", + .step = 1, + .min = 0, + .max = 220, + }, + { + /* float 0.0 ~ 2.2 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_high_fac", + .step = 1, + .min = 0, + .max = 220, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_global_flat_lv", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + /* float 0~3.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_degamma", + .step = 1, + .min = 0, + .max = 300, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MIN_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_min_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1}, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_H_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_L_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~1 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_range", + .step = 1, + .min = 0, + .max = 100, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_L_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_sat_l_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_H_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_sat_h_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_R_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_r_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_G_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_g_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_B_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_b_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_Y_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_y_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_C_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_c_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_M_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_m_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_HLC_BASE_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_hlc_base_log", + .step = 1, + .min = 0, + .max = 1900, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_HLC_SLOPE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_hlc_slope", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_MODE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_mode", + .step = 1, + .min = 0, + .max = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_curve_coef", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_curve_max", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_curve_min", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_avg_coef", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_avg_max", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_avg_min", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_DEC_LIMIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_coef_dec_lt", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_INC_LIMIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_coef_inc_lt", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_FILTER_SIZE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_filter_size", + .step = 1, + .min = 0, + .max = 16, + .dims = {1}, + }, + { + /* float 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_H_THR_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_h_thr_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* float 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_L_THR_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_l_thr_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_RGB_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_rgb_coef", + .step = 1, + .min = 0, + .max = 128, + .dims = {3}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_lightness_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_color_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {3}, + }, +}; + +int vvcam_isp_wdr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_wdr_ctrls); +} + +int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_wdr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_wdr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp wdr ctrl %s failed %d.\n", + vvcam_isp_wdr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2_1/vvcam_isp_wdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2_1/vvcam_isp_wdr.h new file mode 100644 index 0000000..e7a3f44 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_2_1/vvcam_isp_wdr.h @@ -0,0 +1,309 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_WDR_H__ +#define __VVCAM_ISP_WDR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_WDR_ENABLE (VVCAM_ISP_CID_WDR_BASE + 0x0000) +#define VVCAM_ISP_CID_WDR_RESET (VVCAM_ISP_CID_WDR_BASE + 0x0001) +#define VVCAM_ISP_CID_WDR_HALO_COLOR_FADING_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0002) +#define VVCAM_ISP_CID_WDR_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0003) +#define VVCAM_ISP_CID_WDR_AUTO_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x0004) +#define VVCAM_ISP_CID_WDR_AUTO_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0005) +#define VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0006) +#define VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0007) +#define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE (VVCAM_ISP_CID_WDR_BASE + 0x0008) +#define VVCAM_ISP_CID_WDR_AUTO_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x0009) +#define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x000A) +#define VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x000B) +#define VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x000C) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x000D) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x000E) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x000F) +#define VVCAM_ISP_CID_WDR_AUTO_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x0010) +#define VVCAM_ISP_CID_WDR_AUTO_HLC_BASE_LOG (VVCAM_ISP_CID_WDR_BASE + 0x0011) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_L_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x0012) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_H_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x0013) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_R_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0014) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_G_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0015) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_B_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0016) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_Y_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0017) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_C_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0018) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_M_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0019) +#define VVCAM_ISP_CID_WDR_AUTO_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x001A) +#define VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x001B) +#define VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x001C) +#define VVCAM_ISP_CID_WDR_AUTO_ANCHOR_X_LOG (VVCAM_ISP_CID_WDR_BASE + 0x001D) +#define VVCAM_ISP_CID_WDR_AUTO_ANCHOR_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x001E) +#define VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x001F) +#define VVCAM_ISP_CID_WDR_AUTO_HLC_SLOPE (VVCAM_ISP_CID_WDR_BASE + 0x0020) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_ENABLE_TBL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0021) +#define VVCAM_ISP_CID_WDR_AUTO_COLOR_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0022) + +#define VVCAM_ISP_CID_WDR_MANU_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0023) +#define VVCAM_ISP_CID_WDR_MANU_H_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0024) +#define VVCAM_ISP_CID_WDR_MANU_L_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0025) +#define VVCAM_ISP_CID_WDR_MANU_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0026) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0027) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0028) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0029) +#define VVCAM_ISP_CID_WDR_MANU_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x002A) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x002B) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x002C) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC \ + (VVCAM_ISP_CID_WDR_BASE + 0x002D) +#define VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x002E) +#define VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x002F) +#define VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT (VVCAM_ISP_CID_WDR_BASE + 0x0030) +#define VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0031) +#define VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0032) +#define VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0033) +#define VVCAM_ISP_CID_WDR_MANU_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x0034) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x0035) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0036) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0037) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0038) +#define VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0039) +#define VVCAM_ISP_CID_WDR_MANU_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x003A) +#define VVCAM_ISP_CID_WDR_MANU_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x003B) +#define VVCAM_ISP_CID_WDR_MANU_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x003C) +#define VVCAM_ISP_CID_WDR_MANU_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x003D) +#define VVCAM_ISP_CID_WDR_MANU_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x003E) +#define VVCAM_ISP_CID_WDR_MANU_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x003F) +#define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0040) +#define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x0041) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_L_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x0042) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_H_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x0043) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_R_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0044) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_G_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0045) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_B_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0046) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_Y_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0047) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_C_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0048) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0049) +#define VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x004A) +#define VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x004B) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_MODE (VVCAM_ISP_CID_WDR_BASE + 0x004C) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF \ + (VVCAM_ISP_CID_WDR_BASE + 0x004D) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MAX \ + (VVCAM_ISP_CID_WDR_BASE + 0x004E) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MIN \ + (VVCAM_ISP_CID_WDR_BASE + 0x004F) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_COEF \ + (VVCAM_ISP_CID_WDR_BASE + 0x0050) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MAX \ + (VVCAM_ISP_CID_WDR_BASE + 0x0051) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MIN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0052) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_DEC_LIMIT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0053) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_INC_LIMIT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0054) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_FILTER_SIZE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0055) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_H_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0056) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_L_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0057) +#define VVCAM_ISP_CID_WDR_MANU_RGB_COEF (VVCAM_ISP_CID_WDR_BASE + 0x0058) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0059) +#define VVCAM_ISP_CID_WDR_MANU_COLOR_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x005A) + +#define VVCAM_ISP_CID_WDR_STAT_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x005B) +#define VVCAM_ISP_CID_WDR_STAT_H_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x005C) +#define VVCAM_ISP_CID_WDR_STAT_L_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x005D) +#define VVCAM_ISP_CID_WDR_STAT_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x005E) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x005F) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0060) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0061) +#define VVCAM_ISP_CID_WDR_STAT_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x0062) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0063) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x0064) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0065) +#define VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0066) +#define VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0067) +#define VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT (VVCAM_ISP_CID_WDR_BASE + 0x0068) +#define VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0069) +#define VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x006A) +#define VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x006B) +#define VVCAM_ISP_CID_WDR_STAT_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x006C) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x006D) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT \ + (VVCAM_ISP_CID_WDR_BASE + 0x006E) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC \ + (VVCAM_ISP_CID_WDR_BASE + 0x006F) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0070) +#define VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0071) +#define VVCAM_ISP_CID_WDR_STAT_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x0072) +#define VVCAM_ISP_CID_WDR_STAT_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0073) +#define VVCAM_ISP_CID_WDR_STAT_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0074) +#define VVCAM_ISP_CID_WDR_STAT_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x0075) +#define VVCAM_ISP_CID_WDR_STAT_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x0076) +#define VVCAM_ISP_CID_WDR_STAT_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x0077) +#define VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0078) +#define VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x0079) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_L_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x007A) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_H_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x007B) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_R_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x007C) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_G_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x007D) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_B_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x007E) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_Y_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x007F) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_C_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0080) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_M_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0081) +#define VVCAM_ISP_CID_WDR_STAT_HLC_BASE_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0082) +#define VVCAM_ISP_CID_WDR_STAT_HLC_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0083) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0084) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_COEF \ + (VVCAM_ISP_CID_WDR_BASE + 0x0085) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MAX \ + (VVCAM_ISP_CID_WDR_BASE + 0x0086) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MIN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0087) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_COEF \ + (VVCAM_ISP_CID_WDR_BASE + 0x0088) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MAX \ + (VVCAM_ISP_CID_WDR_BASE + 0x0089) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MIN \ + (VVCAM_ISP_CID_WDR_BASE + 0x008A) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_DEC_LIMIT \ + (VVCAM_ISP_CID_WDR_BASE + 0x008B) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_INC_LIMIT \ + (VVCAM_ISP_CID_WDR_BASE + 0x008C) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_FILTER_SIZE \ + (VVCAM_ISP_CID_WDR_BASE + 0x008D) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_H_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x008E) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_L_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x008F) +#define VVCAM_ISP_CID_WDR_STAT_RGB_COEF (VVCAM_ISP_CID_WDR_BASE + 0x0090) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0091) +#define VVCAM_ISP_CID_WDR_STAT_COLOR_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0092) + +#ifdef __KERNEL__ +int vvcam_isp_wdr_ctrl_count(void); +int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_3/vvcam_isp_wdr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_3/vvcam_isp_wdr.c new file mode 100644 index 0000000..f16f9da --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_3/vvcam_isp_wdr.c @@ -0,0 +1,2059 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_wdr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_wdr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WDR_ENABLE: + case VVCAM_ISP_CID_WDR_RESET: + case VVCAM_ISP_CID_WDR_HALO_COLOR_FADING_ENABLE: + case VVCAM_ISP_CID_WDR_MODE: + case VVCAM_ISP_CID_WDR_AUTO_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_AUTO_LUMA_THR: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_AUTO_DEGAMMA: + case VVCAM_ISP_CID_WDR_AUTO_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_EDR_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_EDR: + case VVCAM_ISP_CID_WDR_AUTO_CONTRAST: + case VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_AUTO_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_ENABLE_TBL: + case VVCAM_ISP_CID_WDR_AUTO_COLOR_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_H_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_L_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_CONTRAST: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_LUMA_THR: + case VVCAM_ISP_CID_WDR_MANU_FLAT_MODE: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_RATIO: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_THR: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_MAX_GAIN: + case VVCAM_ISP_CID_WDR_MANU_MIN_GAIN: + case VVCAM_ISP_CID_WDR_MANU_H_DIFF: + case VVCAM_ISP_CID_WDR_MANU_L_DIFF: + case VVCAM_ISP_CID_WDR_MANU_SAT_RANGE: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_MODE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MAX: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MIN: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_COEF: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MAX: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MIN: + case VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_DEC_LIMIT: + case VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_INC_LIMIT: + case VVCAM_ISP_CID_WDR_MANU_DAMP_FILTER_SIZE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_H_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_DAMP_L_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_RGB_COEF: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_COLOR_WEIGHT: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_wdr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_WDR_ENABLE: + case VVCAM_ISP_CID_WDR_RESET: + case VVCAM_ISP_CID_WDR_HALO_COLOR_FADING_ENABLE: + case VVCAM_ISP_CID_WDR_MODE: + case VVCAM_ISP_CID_WDR_AUTO_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_AUTO_LUMA_THR: + case VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_AUTO_DEGAMMA: + case VVCAM_ISP_CID_WDR_AUTO_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_AUTO_EDR_LEVEL: + case VVCAM_ISP_CID_WDR_AUTO_EDR: + case VVCAM_ISP_CID_WDR_AUTO_CONTRAST: + case VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_AUTO_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_AUTO_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN: + case VVCAM_ISP_CID_WDR_AUTO_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_AUTO_LIGHT_ENABLE_TBL: + case VVCAM_ISP_CID_WDR_AUTO_COLOR_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_H_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_L_STRENGTH: + case VVCAM_ISP_CID_WDR_MANU_CONTRAST: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_LUMA_THR: + case VVCAM_ISP_CID_WDR_MANU_FLAT_MODE: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_RATIO: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_THR: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_MANU_DEGAMMA: + case VVCAM_ISP_CID_WDR_MANU_MAX_GAIN: + case VVCAM_ISP_CID_WDR_MANU_MIN_GAIN: + case VVCAM_ISP_CID_WDR_MANU_H_DIFF: + case VVCAM_ISP_CID_WDR_MANU_L_DIFF: + case VVCAM_ISP_CID_WDR_MANU_SAT_RANGE: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_MODE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MAX: + case VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MIN: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_COEF: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MAX: + case VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MIN: + case VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_DEC_LIMIT: + case VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_INC_LIMIT: + case VVCAM_ISP_CID_WDR_MANU_DAMP_FILTER_SIZE: + case VVCAM_ISP_CID_WDR_MANU_DAMP_H_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_DAMP_L_THR_LOG: + case VVCAM_ISP_CID_WDR_MANU_RGB_COEF: + case VVCAM_ISP_CID_WDR_MANU_LIGHT_WEIGHT: + case VVCAM_ISP_CID_WDR_MANU_COLOR_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_H_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_L_STRENGTH: + case VVCAM_ISP_CID_WDR_STAT_CONTRAST: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE: + case VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_LUMA_THR: + case VVCAM_ISP_CID_WDR_STAT_FLAT_MODE: + case VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC: + case VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT: + case VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG: + case VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_RATIO: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_THR: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC: + case VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC: + case VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL: + case VVCAM_ISP_CID_WDR_STAT_DEGAMMA: + case VVCAM_ISP_CID_WDR_STAT_MAX_GAIN: + case VVCAM_ISP_CID_WDR_STAT_MIN_GAIN: + case VVCAM_ISP_CID_WDR_STAT_H_DIFF: + case VVCAM_ISP_CID_WDR_STAT_L_DIFF: + case VVCAM_ISP_CID_WDR_STAT_SAT_RANGE: + case VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN: + case VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_L_THR: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_H_THR: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_R_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_G_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_B_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_Y_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_C_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_M_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_HLC_BASE_LOG: + case VVCAM_ISP_CID_WDR_STAT_HLC_SLOPE: + case VVCAM_ISP_CID_WDR_STAT_DAMP_MODE: + case VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_COEF: + case VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MAX: + case VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MIN: + case VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_COEF: + case VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MAX: + case VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MIN: + case VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_DEC_LIMIT: + case VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_INC_LIMIT: + case VVCAM_ISP_CID_WDR_STAT_DAMP_FILTER_SIZE: + case VVCAM_ISP_CID_WDR_STAT_DAMP_H_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_DAMP_L_THR_LOG: + case VVCAM_ISP_CID_WDR_STAT_RGB_COEF: + case VVCAM_ISP_CID_WDR_STAT_LIGHT_WEIGHT: + case VVCAM_ISP_CID_WDR_STAT_COLOR_WEIGHT: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_wdr_ctrl_ops = { + .s_ctrl = vvcam_isp_wdr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_wdr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_wdr_ctrls[] = { + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_HALO_COLOR_FADING_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_halo_color_fading_en", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1} + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20} + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20} + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {20} + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20} + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_luma_threshold", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {20} + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {20}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_global_flat_lv", + .step = 1, + .min = 0, + .max = 15, + .dims = {20}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_range", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {20}, + }, + { + /* uint16_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {20}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_DEGAMMA, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_degamma", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_HLC_BASE_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_hlc_base_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_L_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_sat_low_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {20} + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_H_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_sat_high_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {20} + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_R_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_r_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4} + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_G_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_g_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4} + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_B_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_b_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4} + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_Y_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_y_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4} + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_C_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_c_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4}, + }, + { + /* float 20x4 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_M_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_m_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 4}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_EDR_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_edr_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_EDR, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_edr", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20}, + }, + { + /* int16_t 20x20 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_CONTRAST, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_contrast", + .step = 1, + .min = 0, + .max = 0xFFFF, + .dims = {20, 20}, + }, + { + /* uint16_t 20x20 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {20, 20}, + }, + { + /* uint8_t 20x20 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {20, 20}, + }, + { + /* float 20x20 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_anchor_x_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 20}, + }, + { + /* uint16_t 20x20 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .dims = {20, 20}, + }, + { + /* uint16_t 20x20 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {20, 20}, + }, + { + /* uint8_t 20x20 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_HLC_SLOPE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_hlc_slope", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {20, 20}, + }, + { + /* bool 20x20 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_LIGHT_ENABLE_TBL, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_light_enable_tbl", + .step = 1, + .min = 0, + .max = 1, + .dims = {20, 20}, + }, + { + /* uint8_t 20x20x3 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_AUTO_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_auto_color_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 20, 3}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_contrast", + .step = 1, + .min = -1023, + .max = 1023, + .def = 500, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_luma_thr", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + /* uint8_t 4x17 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_flat_level_inc", + .step = 1, + .min = 0, + .max = 15, + .dims = {4,17}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_dark_atten_level", + .step = 1, + .min = 0, + .max = 14, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve_select", + .step = 1, + .min = 0, + .max = 2, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {1}, + }, + { + /* float 0.0 ~ 20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_anchor_x_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .def = 16, + .dims = {1}, + }, + { + /* float (0.0, 2.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_actual_ratio", + .step = 1, + .min = 1, + .max = 200, + .def = 1, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_threshold", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_low_sat", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 2.2 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_low_fac", + .step = 1, + .min = 0, + .max = 220, + }, + { + /* float 0.0 ~ 2.2 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_curve2_high_fac", + .step = 1, + .min = 0, + .max = 220, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_global_flat_lv", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + /* float 0~3.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_degamma", + .step = 1, + .min = 0, + .max = 300, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_MIN_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_min_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1}, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_H_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_high_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_L_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_low_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~1 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_range", + .step = 1, + .min = 0, + .max = 100, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_L_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_sat_l_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_H_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_sat_h_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_R_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_r_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_G_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_g_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_B_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_b_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_Y_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_y_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_C_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_c_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_light_m_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_hlc_base_log", + .step = 1, + .min = 0, + .max = 1900, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_hlc_slope", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_MODE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_mode", + .step = 1, + .min = 0, + .max = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_curve_coef", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_curve_max", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_curve_min", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_avg_coef", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_avg_max", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_avg_min", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_DEC_LIMIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_coef_dec_lt", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_INC_LIMIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_coef_inc_lt", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_FILTER_SIZE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_filter_size", + .step = 1, + .min = 0, + .max = 16, + .dims = {1}, + }, + { + /* float 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_H_THR_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_h_thr_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* float 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_DAMP_L_THR_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_damp_l_thr_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_RGB_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_rgb_coef", + .step = 1, + .min = 0, + .max = 128, + .dims = {3}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_LIGHT_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_lightness_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_MANU_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_manu_color_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {3}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_H_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_L_STRENGTH, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_strength", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CONTRAST, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_contrast", + .step = 1, + .min = -1023, + .max = 1023, + .def = 500, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_base", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_entropy_slope", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LUMA_THR, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_luma_thr", + .step = 1, + .min = 1, + .max = 1023, + .def = 1, + .dims = {1} + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_MODE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_level", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + /* uint8_t 4x17 array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_flat_level_inc", + .step = 1, + .min = 0, + .max = 15, + .dims = {4,17}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_dark_atten_level", + .step = 1, + .min = 0, + .max = 14, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_fixed_weight", + .step = 1, + .min = 0, + .max = 1023, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve_select", + .step = 1, + .min = 0, + .max = 2, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_log_weight", + .step = 1, + .min = 0, + .max = 10, + .dims = {1}, + }, + { + /* float 0.0 ~ 20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_anchor_x_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_anchor_slope", + .step = 1, + .min = 0, + .max = 4096, + .def = 16, + .dims = {1}, + }, + { + /* float (0.0, 2.0] */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_RATIO, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_actual_ratio", + .step = 1, + .min = 1, + .max = 200, + .def = 1, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_THR, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_threshold", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 1.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_low_sat", + .step = 1, + .min = 0, + .max = 100, + }, + { + /* float 0.0 ~ 2.2 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_low_fac", + .step = 1, + .min = 0, + .max = 220, + }, + { + /* float 0.0 ~ 2.2 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_curve2_high_fac", + .step = 1, + .min = 0, + .max = 220, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_global_flat_lv", + .step = 1, + .min = 0, + .max = 15, + .dims = {1}, + }, + { + /* float 0~3.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DEGAMMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_degamma", + .step = 1, + .min = 0, + .max = 300, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MAX_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_max_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_MIN_GAIN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_min_gain", + .step = 1, + .min = 0, + .max = 4096, + .dims = {1}, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_H_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_high_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~100.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_L_DIFF, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_low_diff", + .step = 1, + .min = 0, + .max = 10000, + }, + { + /* float 0~1 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_range", + .step = 1, + .min = 0, + .max = 100, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_thr_gain_down", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP, + .type = V4L2_CTRL_TYPE_U16, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_sat_thr_gain_up", + .step = 1, + .min = 0, + .max = 256, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_L_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_sat_l_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_H_THR, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_sat_h_thr", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_R_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_r_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_G_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_g_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_B_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_b_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_Y_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_y_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_C_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_c_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float 4x array 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_M_THR_LOG, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_light_m_thr_log", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {4}, + }, + { + /* float */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_HLC_BASE_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_hlc_base_log", + .step = 1, + .min = 0, + .max = 1900, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_HLC_SLOPE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_hlc_slope", + .step = 1, + .min = 0, + .max = 0xFF, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_MODE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_mode", + .step = 1, + .min = 0, + .max = 1, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_curve_coef", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_curve_max", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_curve_min", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_avg_coef", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MAX, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_avg_max", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MIN, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_avg_min", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_DEC_LIMIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_coef_dec_lt", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_INC_LIMIT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_coef_inc_lt", + .step = 1, + .min = 0, + .max = 127, + .dims = {1}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_FILTER_SIZE, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_filter_size", + .step = 1, + .min = 0, + .max = 16, + .dims = {1}, + }, + { + /* float 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_H_THR_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_h_thr_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* float 0~20.0 */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_DAMP_L_THR_LOG, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_damp_l_thr_log", + .step = 1, + .min = 0, + .max = 2000, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_RGB_COEF, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_rgb_coef", + .step = 1, + .min = 0, + .max = 128, + .dims = {3}, + }, + { + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_LIGHT_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_lightness_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {1}, + }, + { + /* uint8_t 3x array */ + .ops = &vvcam_isp_wdr_ctrl_ops, + .id = VVCAM_ISP_CID_WDR_STAT_COLOR_WEIGHT, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_wdr_stat_color_weight", + .step = 1, + .min = 0, + .max = 128, + .dims = {3}, + }, +}; + +int vvcam_isp_wdr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_wdr_ctrls); +} + +int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_wdr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_wdr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp wdr ctrl %s failed %d.\n", + vvcam_isp_wdr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; +} + diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_3/vvcam_isp_wdr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_3/vvcam_isp_wdr.h new file mode 100644 index 0000000..2ddc09b --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/wdr/wdr_v5_3/vvcam_isp_wdr.h @@ -0,0 +1,311 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_WDR_H__ +#define __VVCAM_ISP_WDR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_WDR_ENABLE (VVCAM_ISP_CID_WDR_BASE + 0x0000) +#define VVCAM_ISP_CID_WDR_RESET (VVCAM_ISP_CID_WDR_BASE + 0x0001) +#define VVCAM_ISP_CID_WDR_HALO_COLOR_FADING_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0002) +#define VVCAM_ISP_CID_WDR_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0003) +#define VVCAM_ISP_CID_WDR_AUTO_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x0004) +#define VVCAM_ISP_CID_WDR_AUTO_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0005) +#define VVCAM_ISP_CID_WDR_AUTO_H_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0006) +#define VVCAM_ISP_CID_WDR_AUTO_L_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0007) +#define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_BASE (VVCAM_ISP_CID_WDR_BASE + 0x0008) +#define VVCAM_ISP_CID_WDR_AUTO_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x0009) +#define VVCAM_ISP_CID_WDR_AUTO_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x000A) +#define VVCAM_ISP_CID_WDR_AUTO_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x000B) +#define VVCAM_ISP_CID_WDR_AUTO_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x000C) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x000D) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x000E) +#define VVCAM_ISP_CID_WDR_AUTO_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x000F) +#define VVCAM_ISP_CID_WDR_AUTO_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x0010) +#define VVCAM_ISP_CID_WDR_AUTO_HLC_BASE_LOG (VVCAM_ISP_CID_WDR_BASE + 0x0011) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_L_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x0012) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_SAT_H_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x0013) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_R_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0014) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_G_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0015) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_B_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0016) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_Y_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0017) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_C_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0018) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_M_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0019) +#define VVCAM_ISP_CID_WDR_AUTO_EDR_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x001A) +#define VVCAM_ISP_CID_WDR_AUTO_EDR (VVCAM_ISP_CID_WDR_BASE + 0x001B) +#define VVCAM_ISP_CID_WDR_AUTO_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x001C) +#define VVCAM_ISP_CID_WDR_AUTO_FIXED_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x001D) +#define VVCAM_ISP_CID_WDR_AUTO_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x001E) +#define VVCAM_ISP_CID_WDR_AUTO_ANCHOR_X_LOG (VVCAM_ISP_CID_WDR_BASE + 0x001F) +#define VVCAM_ISP_CID_WDR_AUTO_ANCHOR_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0020) +#define VVCAM_ISP_CID_WDR_AUTO_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0021) +#define VVCAM_ISP_CID_WDR_AUTO_HLC_SLOPE (VVCAM_ISP_CID_WDR_BASE + 0x0022) +#define VVCAM_ISP_CID_WDR_AUTO_LIGHT_ENABLE_TBL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0023) +#define VVCAM_ISP_CID_WDR_AUTO_COLOR_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0024) + +#define VVCAM_ISP_CID_WDR_MANU_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x0025) +#define VVCAM_ISP_CID_WDR_MANU_H_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0026) +#define VVCAM_ISP_CID_WDR_MANU_L_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x0027) +#define VVCAM_ISP_CID_WDR_MANU_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0028) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0029) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_BASE \ + (VVCAM_ISP_CID_WDR_BASE + 0x002A) +#define VVCAM_ISP_CID_WDR_MANU_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x002B) +#define VVCAM_ISP_CID_WDR_MANU_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x002C) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x002D) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x002E) +#define VVCAM_ISP_CID_WDR_MANU_FLAT_LEVEL_INC \ + (VVCAM_ISP_CID_WDR_BASE + 0x002F) +#define VVCAM_ISP_CID_WDR_MANU_DARK_ATT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0030) +#define VVCAM_ISP_CID_WDR_MANU_FIXED_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0031) +#define VVCAM_ISP_CID_WDR_MANU_CURVE_SELECT (VVCAM_ISP_CID_WDR_BASE + 0x0032) +#define VVCAM_ISP_CID_WDR_MANU_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x0033) +#define VVCAM_ISP_CID_WDR_MANU_ANCHOR_X_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0034) +#define VVCAM_ISP_CID_WDR_MANU_ANCHOR_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0035) +#define VVCAM_ISP_CID_WDR_MANU_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x0036) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x0037) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_SAT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0038) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_L_FAC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0039) +#define VVCAM_ISP_CID_WDR_MANU_CURVE2_H_FAC \ + (VVCAM_ISP_CID_WDR_BASE + 0x003A) +#define VVCAM_ISP_CID_WDR_MANU_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x003B) +#define VVCAM_ISP_CID_WDR_MANU_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x003C) +#define VVCAM_ISP_CID_WDR_MANU_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x003D) +#define VVCAM_ISP_CID_WDR_MANU_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x003E) +#define VVCAM_ISP_CID_WDR_MANU_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x003F) +#define VVCAM_ISP_CID_WDR_MANU_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x0040) +#define VVCAM_ISP_CID_WDR_MANU_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x0041) +#define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0042) +#define VVCAM_ISP_CID_WDR_MANU_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x0043) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_L_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x0044) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_SAT_H_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x0045) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_R_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0046) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_G_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0047) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_B_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0048) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_Y_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0049) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_C_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x004A) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_M_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x004B) +#define VVCAM_ISP_CID_WDR_MANU_HLC_BASE_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x004C) +#define VVCAM_ISP_CID_WDR_MANU_HLC_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x004D) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_MODE (VVCAM_ISP_CID_WDR_BASE + 0x004E) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_COEF \ + (VVCAM_ISP_CID_WDR_BASE + 0x004F) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MAX \ + (VVCAM_ISP_CID_WDR_BASE + 0x0050) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_CURVE_MIN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0051) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_COEF \ + (VVCAM_ISP_CID_WDR_BASE + 0x0052) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MAX \ + (VVCAM_ISP_CID_WDR_BASE + 0x0053) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_AVG_MIN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0054) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_DEC_LIMIT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0055) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_COEF_INC_LIMIT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0056) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_FILTER_SIZE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0057) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_H_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0058) +#define VVCAM_ISP_CID_WDR_MANU_DAMP_L_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0059) +#define VVCAM_ISP_CID_WDR_MANU_RGB_COEF (VVCAM_ISP_CID_WDR_BASE + 0x005A) +#define VVCAM_ISP_CID_WDR_MANU_LIGHT_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x005B) +#define VVCAM_ISP_CID_WDR_MANU_COLOR_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x005C) + +#define VVCAM_ISP_CID_WDR_STAT_STRENGTH (VVCAM_ISP_CID_WDR_BASE + 0x005D) +#define VVCAM_ISP_CID_WDR_STAT_H_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x005E) +#define VVCAM_ISP_CID_WDR_STAT_L_STRENGTH \ + (VVCAM_ISP_CID_WDR_BASE + 0x005F) +#define VVCAM_ISP_CID_WDR_STAT_CONTRAST (VVCAM_ISP_CID_WDR_BASE + 0x0060) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_ENABLE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0061) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_BASE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0062) +#define VVCAM_ISP_CID_WDR_STAT_ENTROPY_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0063) +#define VVCAM_ISP_CID_WDR_STAT_LUMA_THR (VVCAM_ISP_CID_WDR_BASE + 0x0064) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0065) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL (VVCAM_ISP_CID_WDR_BASE + 0x0066) +#define VVCAM_ISP_CID_WDR_STAT_FLAT_LEVEL_INC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0067) +#define VVCAM_ISP_CID_WDR_STAT_DARK_ATT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0068) +#define VVCAM_ISP_CID_WDR_STAT_FIXED_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0069) +#define VVCAM_ISP_CID_WDR_STAT_CURVE_SELECT (VVCAM_ISP_CID_WDR_BASE + 0x006A) +#define VVCAM_ISP_CID_WDR_STAT_LOG_WEIGHT (VVCAM_ISP_CID_WDR_BASE + 0x006B) +#define VVCAM_ISP_CID_WDR_STAT_ANCHOR_X_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x006C) +#define VVCAM_ISP_CID_WDR_STAT_ANCHOR_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x006D) +#define VVCAM_ISP_CID_WDR_STAT_RATIO (VVCAM_ISP_CID_WDR_BASE + 0x006E) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_THR (VVCAM_ISP_CID_WDR_BASE + 0x006F) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_L_SAT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0070) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_L_FAC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0071) +#define VVCAM_ISP_CID_WDR_STAT_CURVE2_H_FAC \ + (VVCAM_ISP_CID_WDR_BASE + 0x0072) +#define VVCAM_ISP_CID_WDR_STAT_GLOBAL_FLAT_LEVEL \ + (VVCAM_ISP_CID_WDR_BASE + 0x0073) +#define VVCAM_ISP_CID_WDR_STAT_DEGAMMA (VVCAM_ISP_CID_WDR_BASE + 0x0074) +#define VVCAM_ISP_CID_WDR_STAT_MAX_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0075) +#define VVCAM_ISP_CID_WDR_STAT_MIN_GAIN (VVCAM_ISP_CID_WDR_BASE + 0x0076) +#define VVCAM_ISP_CID_WDR_STAT_H_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x0077) +#define VVCAM_ISP_CID_WDR_STAT_L_DIFF (VVCAM_ISP_CID_WDR_BASE + 0x0078) +#define VVCAM_ISP_CID_WDR_STAT_SAT_RANGE (VVCAM_ISP_CID_WDR_BASE + 0x0079) +#define VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_DOWN \ + (VVCAM_ISP_CID_WDR_BASE + 0x007A) +#define VVCAM_ISP_CID_WDR_STAT_SAT_THR_GAIN_UP \ + (VVCAM_ISP_CID_WDR_BASE + 0x007B) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_L_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x007C) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_SAT_H_THR \ + (VVCAM_ISP_CID_WDR_BASE + 0x007D) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_R_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x007E) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_G_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x007F) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_B_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0080) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_Y_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0081) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_C_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0082) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_M_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0083) +#define VVCAM_ISP_CID_WDR_STAT_HLC_BASE_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0084) +#define VVCAM_ISP_CID_WDR_STAT_HLC_SLOPE \ + (VVCAM_ISP_CID_WDR_BASE + 0x0085) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_MODE (VVCAM_ISP_CID_WDR_BASE + 0x0086) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_COEF \ + (VVCAM_ISP_CID_WDR_BASE + 0x0087) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MAX \ + (VVCAM_ISP_CID_WDR_BASE + 0x0088) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_CURVE_MIN \ + (VVCAM_ISP_CID_WDR_BASE + 0x0089) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_COEF \ + (VVCAM_ISP_CID_WDR_BASE + 0x008A) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MAX \ + (VVCAM_ISP_CID_WDR_BASE + 0x008B) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_AVG_MIN \ + (VVCAM_ISP_CID_WDR_BASE + 0x008C) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_DEC_LIMIT \ + (VVCAM_ISP_CID_WDR_BASE + 0x008D) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_COEF_INC_LIMIT \ + (VVCAM_ISP_CID_WDR_BASE + 0x008E) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_FILTER_SIZE \ + (VVCAM_ISP_CID_WDR_BASE + 0x008F) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_H_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0090) +#define VVCAM_ISP_CID_WDR_STAT_DAMP_L_THR_LOG \ + (VVCAM_ISP_CID_WDR_BASE + 0x0091) +#define VVCAM_ISP_CID_WDR_STAT_RGB_COEF (VVCAM_ISP_CID_WDR_BASE + 0x0092) +#define VVCAM_ISP_CID_WDR_STAT_LIGHT_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0093) +#define VVCAM_ISP_CID_WDR_STAT_COLOR_WEIGHT \ + (VVCAM_ISP_CID_WDR_BASE + 0x0094) + +#ifdef __KERNEL__ +int vvcam_isp_wdr_ctrl_count(void); +int vvcam_isp_wdr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ynr/ynr_v1/vvcam_isp_ynr.c b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ynr/ynr_v1/vvcam_isp_ynr.c new file mode 100644 index 0000000..205b74e --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ynr/ynr_v1/vvcam_isp_ynr.c @@ -0,0 +1,275 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#include +#include "vvcam_isp_driver.h" +#include "vvcam_isp_ctrl.h" +#include "vvcam_isp_ynr.h" +#include "vvcam_isp_event.h" + +static int vvcam_isp_ynr_s_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_YNR_ENABLE: + case VVCAM_ISP_CID_YNR_RESET: + case VVCAM_ISP_CID_YNR_MODE: + case VVCAM_ISP_CID_YNR_AUTO_LEVEL: + case VVCAM_ISP_CID_YNR_AUTO_GAIN: + case VVCAM_ISP_CID_YNR_AUTO_SIGMA: + case VVCAM_ISP_CID_YNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_YNR_AUTO_STRENGTH2: + case VVCAM_ISP_CID_YNR_MANU_SIGMA: + case VVCAM_ISP_CID_YNR_MANU_STRENGTH: + case VVCAM_ISP_CID_YNR_MANU_STRENGTH2: + ret = vvcam_isp_s_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static int vvcam_isp_ynr_g_ctrl(struct v4l2_ctrl *ctrl) +{ + int ret = 0; + struct vvcam_isp_dev *isp_dev = + container_of(ctrl->handler, struct vvcam_isp_dev, ctrl_handler); + + switch (ctrl->id) + { + case VVCAM_ISP_CID_YNR_ENABLE: + case VVCAM_ISP_CID_YNR_RESET: + case VVCAM_ISP_CID_YNR_MODE: + case VVCAM_ISP_CID_YNR_AUTO_LEVEL: + case VVCAM_ISP_CID_YNR_AUTO_GAIN: + case VVCAM_ISP_CID_YNR_AUTO_SIGMA: + case VVCAM_ISP_CID_YNR_AUTO_STRENGTH: + case VVCAM_ISP_CID_YNR_AUTO_STRENGTH2: + case VVCAM_ISP_CID_YNR_MANU_SIGMA: + case VVCAM_ISP_CID_YNR_MANU_STRENGTH: + case VVCAM_ISP_CID_YNR_MANU_STRENGTH2: + ret = vvcam_isp_g_ctrl_event(isp_dev, isp_dev->ctrl_pad, ctrl); + break; + + default: + dev_err(isp_dev->dev, "unknow v4l2 ctrl id %d\n", ctrl->id); + return -EACCES; + } + + return ret; +} + +static const struct v4l2_ctrl_ops vvcam_isp_ynr_ctrl_ops = { + .s_ctrl = vvcam_isp_ynr_s_ctrl, + .g_volatile_ctrl = vvcam_isp_ynr_g_ctrl, +}; + +const struct v4l2_ctrl_config vvcam_isp_ynr_ctrls[] = { + { + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_enable", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_RESET, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_reset", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_MODE, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_mode", + .step = 1, + .min = 0, + .max = 1, + }, + { + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_AUTO_LEVEL, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_auto_level", + .step = 1, + .min = 1, + .max = 20, + .def = 1, + .dims = {1, 0, 0, 0}, + }, + { + /* float 20x array */ + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_AUTO_GAIN, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_auto_gain", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* float 20x array [0.0, 128.0] */ + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_AUTO_SIGMA, + .type = V4L2_CTRL_TYPE_U32, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_auto_sigma", + .step = 1, + .min = 0, + .max = 0xFFFFFFFF, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_AUTO_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_auto_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* uint8_t 20x array */ + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_AUTO_STRENGTH2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_auto_strength2", + .step = 1, + .min = 0, + .max = 128, + .dims = {20, 0, 0, 0}, + }, + { + /* float 0 ~ 128.0 */ + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_MANU_SIGMA, + .type = V4L2_CTRL_TYPE_INTEGER, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_manu_sigma", + .step = 1, + .min = 0, + .max = 12800, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_MANU_STRENGTH, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_manu_strength", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, + { + /* uint8_t */ + .ops = &vvcam_isp_ynr_ctrl_ops, + .id = VVCAM_ISP_CID_YNR_MANU_STRENGTH2, + .type = V4L2_CTRL_TYPE_U8, + .flags= V4L2_CTRL_FLAG_VOLATILE | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, + .name = "isp_ynr_manu_strength2", + .step = 1, + .min = 0, + .max = 128, + .dims = {1, 0, 0, 0}, + }, +}; + +int vvcam_isp_ynr_ctrl_count(void) +{ + return ARRAY_SIZE(vvcam_isp_ynr_ctrls); +} + +int vvcam_isp_ynr_ctrl_create(struct vvcam_isp_dev *isp_dev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vvcam_isp_ynr_ctrls); i++) { + v4l2_ctrl_new_custom(&isp_dev->ctrl_handler, + &vvcam_isp_ynr_ctrls[i], NULL); + if (isp_dev->ctrl_handler.error) { + dev_err( isp_dev->dev, "reigster isp ynr ctrl %s failed %d.\n", + vvcam_isp_ynr_ctrls[i].name, isp_dev->ctrl_handler.error); + } + } + + return 0; + +} diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ynr/ynr_v1/vvcam_isp_ynr.h b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ynr/ynr_v1/vvcam_isp_ynr.h new file mode 100644 index 0000000..b9f6b31 --- /dev/null +++ b/buildroot-overlay/package/vvcam/v4l2/isp/isp_ctrl/ynr/ynr_v1/vvcam_isp_ynr.h @@ -0,0 +1,78 @@ +/**************************************************************************** +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + + +#ifndef __VVCAM_ISP_YNR_H__ +#define __VVCAM_ISP_YNR_H__ + +#include "vvcam_isp_ctrl.h" + +#define VVCAM_ISP_CID_YNR_ENABLE (VVCAM_ISP_CID_YNR_BASE + 0x0000) +#define VVCAM_ISP_CID_YNR_RESET (VVCAM_ISP_CID_YNR_BASE + 0x0001) +#define VVCAM_ISP_CID_YNR_MODE (VVCAM_ISP_CID_YNR_BASE + 0x0002) +#define VVCAM_ISP_CID_YNR_AUTO_LEVEL (VVCAM_ISP_CID_YNR_BASE + 0x0003) +#define VVCAM_ISP_CID_YNR_AUTO_GAIN (VVCAM_ISP_CID_YNR_BASE + 0x0004) +#define VVCAM_ISP_CID_YNR_AUTO_SIGMA (VVCAM_ISP_CID_YNR_BASE + 0x0005) +#define VVCAM_ISP_CID_YNR_AUTO_STRENGTH (VVCAM_ISP_CID_YNR_BASE + 0x0006) +#define VVCAM_ISP_CID_YNR_AUTO_STRENGTH2 (VVCAM_ISP_CID_YNR_BASE + 0x0007) +#define VVCAM_ISP_CID_YNR_MANU_SIGMA (VVCAM_ISP_CID_YNR_BASE + 0x0008) +#define VVCAM_ISP_CID_YNR_MANU_STRENGTH (VVCAM_ISP_CID_YNR_BASE + 0x0009) +#define VVCAM_ISP_CID_YNR_MANU_STRENGTH2 (VVCAM_ISP_CID_YNR_BASE + 0x000A) + +#ifdef __KERNEL__ +int vvcam_isp_ynr_ctrl_count(void); +int vvcam_isp_ynr_ctrl_create(struct vvcam_isp_dev *isp_dev); +#endif + +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_driver.c b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_driver.c index 2ae8941..7dc7524 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_driver.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_driver.c @@ -82,11 +82,11 @@ #endif #ifdef VVCAM_PLATFORM_REGISTER -#define VVCAM_ISP_DEFAULT_SENSOR "imx335" +#define VVCAM_ISP_DEFAULT_SENSOR "ov5647" #define VVCAM_ISP_DEFAULT_SENSOR_MODE 0 -#define VVCAM_ISP_DEFAULT_SENSOR_XML "OV2775.xml" -#define VVCAM_ISP_DEFAULT_SENSOR_MANU_JSON "vvbcfg/simulator/ISP8000_V2201/ISP8000_V2201.manual_ext.json" -#define VVCAM_ISP_DEFAULT_SENSOR_AUTO_JSON "vvbcfg/simulator/ISP8000_V2201/ISP8000_V2201.auto.json" +#define VVCAM_ISP_DEFAULT_SENSOR_XML "/etc/vvcam/ov5647.xml" +#define VVCAM_ISP_DEFAULT_SENSOR_MANU_JSON "/etc/vvcam/ov5647.manual.json" +#define VVCAM_ISP_DEFAULT_SENSOR_AUTO_JSON "/etc/vvcam/ov5647.auto.json" #endif struct vvcam_isp_mbus_fmt vvcam_isp_mp_fmts[] = { @@ -98,7 +98,16 @@ struct vvcam_isp_mbus_fmt vvcam_isp_mp_fmts[] = { }, { .code = MEDIA_BUS_FMT_YUYV8_1X16, /*YUYV*/ - } + }, + { + .code = MEDIA_BUS_FMT_BGR888_1X24, /*BGR888*/ + }, + { + .code = MEDIA_BUS_FMT_BGR888_3X8, /*BGR888P*/ + }, + { + .code = MEDIA_BUS_FMT_YUYV10_2X10, /*P010*/ + }, }; struct vvcam_isp_mbus_fmt vvcam_isp_sp_fmts[] = { @@ -110,7 +119,16 @@ struct vvcam_isp_mbus_fmt vvcam_isp_sp_fmts[] = { }, { .code = MEDIA_BUS_FMT_YUYV8_1X16, /*YUYV*/ - } + }, + { + .code = MEDIA_BUS_FMT_BGR888_1X24, /*RGB888*/ + }, + { + .code = MEDIA_BUS_FMT_BGR888_3X8, /*RGB888P*/ + }, + { + .code = MEDIA_BUS_FMT_YUYV10_2X10, /*P010*/ + }, }; static int vvcam_isp_querycap(struct v4l2_subdev *sd, void *arg) @@ -212,6 +230,7 @@ static int vvcam_isp_buf_done(struct v4l2_subdev *sd, void *arg) if (is_media_entity_v4l2_subdev(pad->entity)) { subdev = media_entity_to_v4l2_subdev(pad->entity); + memset(&pad_buf, 0, sizeof(pad_buf)); pad_buf.pad = pad->index; pad_buf.buf = buf; ret = v4l2_subdev_call(subdev, core, ioctl, VVCAM_PAD_BUF_DONE, &pad_buf); @@ -430,22 +449,34 @@ static int vvcam_isp_set_fmt(struct v4l2_subdev *sd, int i; int ret; - sink_pad_index = format->pad - (format->pad % VVCAM_ISP_CHN_MAX); + sink_pad_index = format->pad - (format->pad % VVCAM_ISP_PORT_PAD_NR); sink_pad = &isp_dev->pad_data[sink_pad_index]; if (sink_pad == cur_pad) { cur_pad->sink_detected = 1; cur_pad->format = format->format; - for (i = 1; i < VVCAM_ISP_CHN_MAX; i++) { + for (i = 1; i < VVCAM_ISP_PORT_PAD_NR; i++) { source_pad = &isp_dev->pad_data[sink_pad_index + i]; source_pad->sink_detected = 1; - source_pad->format = format->format; - source_pad->format.code = source_pad->mbus_fmt[0].code; - source_pad->format.field = V4L2_FIELD_NONE; - source_pad->format.quantization = V4L2_QUANTIZATION_DEFAULT; - source_pad->format.colorspace = V4L2_COLORSPACE_DEFAULT; - } + switch (i) { + case VVCAM_ISP_PORT_PAD_SOURCE_MP: + case VVCAM_ISP_PORT_PAD_SOURCE_SP1: + case VVCAM_ISP_PORT_PAD_SOURCE_SP2: + source_pad->format = format->format; + source_pad->format.code = source_pad->mbus_fmt[0].code; + source_pad->format.field = V4L2_FIELD_NONE; + source_pad->format.quantization = V4L2_QUANTIZATION_DEFAULT; + source_pad->format.colorspace = V4L2_COLORSPACE_DEFAULT; + break; + case VVCAM_ISP_PORT_PAD_SOURCE_RAW: + source_pad->format = format->format; + source_pad->mbus_fmt[0].code = format->format.code; + break; + default: + break; + } + } return 0; } @@ -641,8 +672,10 @@ static int vvcam_isp_async_notifier(struct vvcam_isp_dev *isp_dev) int ret = 0; int pad = 0; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) v4l2_async_subdev_nf_init(&isp_dev->notifier, &isp_dev->sd); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + v4l2_async_nf_init(&isp_dev->notifier); #else v4l2_async_notifier_init(&isp_dev->notifier); #endif @@ -667,18 +700,26 @@ static int vvcam_isp_async_notifier(struct vvcam_isp_dev *isp_dev) continue; } fwnode_handle_put(remote_ep); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) asc = v4l2_async_nf_add_fwnode_remote(&isp_dev->notifier, ep, struct v4l2_async_connection); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + asd = v4l2_async_nf_add_fwnode_remote(&isp_dev->notifier, + ep, struct v4l2_async_subdev); #else - // asd = v4l2_async_notifier_add_fwnode_remote_subdev(&isp_dev->notifier, ep, struct v4l2_async_subdev); - ret = v4l2_async_notifier_add_fwnode_remote_subdev(&isp_dev->notifier, ep, &asd); + asd = v4l2_async_notifier_add_fwnode_remote_subdev(&isp_dev->notifier, + ep, struct v4l2_async_subdev); #endif fwnode_handle_put(ep); - if (ret /*IS_ERR(asd)*/) { - // ret = PTR_ERR(asd); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) + if (IS_ERR(asc)) { + ret = PTR_ERR(asc); +#else + if (IS_ERR(asd)) { + ret = PTR_ERR(asd); +#endif if (ret != -EEXIST) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) v4l2_async_nf_cleanup(&isp_dev->notifier); @@ -690,10 +731,13 @@ static int vvcam_isp_async_notifier(struct vvcam_isp_dev *isp_dev) } } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) - ret = v4l2_async_nf_register(&isp_dev->notifier); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) + ret = v4l2_async_nf_register(&isp_dev->notifier); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + ret = v4l2_async_subdev_nf_register(&isp_dev->sd, + &isp_dev->notifier); #else - ret = v4l2_async_subdev_notifier_register(&isp_dev->sd, + ret = v4l2_async_subdev_notifier_register(&isp_dev->sd, &isp_dev->notifier); #endif if (ret) { @@ -711,22 +755,38 @@ static int vvcam_isp_async_notifier(struct vvcam_isp_dev *isp_dev) static int vvcam_isp_pads_init(struct vvcam_isp_dev *isp_dev) { int pad = 0; + for (pad = 0; pad < VVCAM_ISP_PAD_NR; pad++) { - if (pad % VVCAM_ISP_CHN_MAX == 0) { + if ((pad % VVCAM_ISP_PORT_PAD_NR) == VVCAM_ISP_PORT_PAD_SINK) { isp_dev->pads[pad].flags = MEDIA_PAD_FL_SINK; } else { isp_dev->pads[pad].flags = MEDIA_PAD_FL_SOURCE; } - } - for (pad = 0; pad < VVCAM_ISP_PAD_NR; pad++) { - if (pad % VVCAM_ISP_CHN_MAX == 1) { - isp_dev->pad_data[pad].num_formats = ARRAY_SIZE(vvcam_isp_mp_fmts); - isp_dev->pad_data[pad].mbus_fmt = vvcam_isp_mp_fmts; - } else if (pad % VVCAM_ISP_CHN_MAX != 0) { - isp_dev->pad_data[pad].num_formats = ARRAY_SIZE(vvcam_isp_sp_fmts); - isp_dev->pad_data[pad].mbus_fmt = vvcam_isp_mp_fmts; + switch (pad % VVCAM_ISP_PORT_PAD_NR) { + case VVCAM_ISP_PORT_PAD_SINK: + break; + case VVCAM_ISP_PORT_PAD_SOURCE_MP: + isp_dev->pad_data[pad].num_formats = ARRAY_SIZE(vvcam_isp_mp_fmts); + isp_dev->pad_data[pad].mbus_fmt = vvcam_isp_mp_fmts; + break; + case VVCAM_ISP_PORT_PAD_SOURCE_SP1: + isp_dev->pad_data[pad].num_formats = ARRAY_SIZE(vvcam_isp_sp_fmts); + isp_dev->pad_data[pad].mbus_fmt = vvcam_isp_sp_fmts; + break; + case VVCAM_ISP_PORT_PAD_SOURCE_SP2: + isp_dev->pad_data[pad].num_formats = ARRAY_SIZE(vvcam_isp_sp_fmts); + isp_dev->pad_data[pad].mbus_fmt = vvcam_isp_sp_fmts; + break; + case VVCAM_ISP_PORT_PAD_SOURCE_RAW: + isp_dev->pad_data[pad].num_formats = 1; + isp_dev->pad_data[pad].mbus_fmt = devm_kzalloc(isp_dev->dev, + sizeof(struct vvcam_isp_mbus_fmt), GFP_KERNEL);; + break; + default: + break; } + INIT_LIST_HEAD(&isp_dev->pad_data[pad].queue); spin_lock_init(&isp_dev->pad_data[pad].qlock); } @@ -741,7 +801,7 @@ static int vvcam_isp_parse_params(struct vvcam_isp_dev *isp_dev, #ifdef VVCAM_PLATFORM_REGISTER int port = 0; isp_dev->id = pdev->id; - for (port = 0; port < VVCAM_ISP_CHN_MAX; port++) { + for (port = 0; port < VVCAM_ISP_PORT_NR; port++) { strncpy(isp_dev->sensor_info[port].sensor, VVCAM_ISP_DEFAULT_SENSOR, strlen(VVCAM_ISP_DEFAULT_SENSOR)); strncpy(isp_dev->sensor_info[port].xml, VVCAM_ISP_DEFAULT_SENSOR_XML, @@ -845,12 +905,15 @@ static int vvcam_isp_probe(struct platform_device *pdev) v4l2_async_unregister_subdev(&isp_dev->sd); error_regiter_subdev: -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) - v4l2_async_nf_unregister(&isp_dev->notifier); - v4l2_async_nf_cleanup(&isp_dev->notifier); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) + v4l2_async_nf_cleanup(&isp_dev->notifier); + v4l2_async_nf_unregister(&isp_dev->notifier); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + v4l2_async_nf_unregister(&isp_dev->notifier); + v4l2_async_nf_cleanup(&isp_dev->notifier); #else - v4l2_async_notifier_unregister(&isp_dev->notifier); - v4l2_async_notifier_cleanup(&isp_dev->notifier); + v4l2_async_notifier_unregister(&isp_dev->notifier); + v4l2_async_notifier_cleanup(&isp_dev->notifier); #endif err_async_notifier: media_entity_cleanup(&isp_dev->sd.entity); @@ -866,12 +929,16 @@ static int vvcam_isp_remove(struct platform_device *pdev) vvcam_isp_procfs_unregister(isp_dev->pde); v4l2_async_unregister_subdev(&isp_dev->sd); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) - v4l2_async_nf_unregister(&isp_dev->notifier); - v4l2_async_nf_cleanup(&isp_dev->notifier); + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) + v4l2_async_nf_cleanup(&isp_dev->notifier); + v4l2_async_nf_unregister(&isp_dev->notifier); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) + v4l2_async_nf_unregister(&isp_dev->notifier); + v4l2_async_nf_cleanup(&isp_dev->notifier); #else - v4l2_async_notifier_unregister(&isp_dev->notifier); - v4l2_async_notifier_cleanup(&isp_dev->notifier); + v4l2_async_notifier_unregister(&isp_dev->notifier); + v4l2_async_notifier_cleanup(&isp_dev->notifier); #endif media_entity_cleanup(&isp_dev->sd.entity); pm_runtime_disable(&pdev->dev); @@ -943,6 +1010,7 @@ static int __init vvcam_isp_init_module(void) printk(KERN_ERR "Failed to register isp driver\n"); return ret; } + #ifdef VVCAM_PLATFORM_REGISTER ret = vvcam_isp_platform_device_register(); if (ret) { @@ -951,6 +1019,7 @@ static int __init vvcam_isp_init_module(void) return ret; } #endif + return ret; } diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_driver.h b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_driver.h index 8a30750..018796c 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_driver.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_driver.h @@ -71,27 +71,18 @@ #define VVCAM_ISP_WIDTH_MIN 32 #define VVCAM_ISP_HEIGHT_MIN 16 -#define VVCAM_ISP_CHN_MAX 4 -enum vvcam_isp_pad_e { - VVCAM_ISP_PAD_SINK_P0, - VVCAM_ISP_PAD_SOURCE_P0MP, - VVCAM_ISP_PAD_SOURCE_P0SP1, - VVCAM_ISP_PAD_SOURCE_P0SP2, - VVCAM_ISP_PAD_SINK_P1, - VVCAM_ISP_PAD_SOURCE_P1MP, - VVCAM_ISP_PAD_SOURCE_P1SP1, - VVCAM_ISP_PAD_SOURCE_P1SP2, - VVCAM_ISP_PAD_SINK_P2, - VVCAM_ISP_PAD_SOURCE_P2MP, - VVCAM_ISP_PAD_SOURCE_P2SP1, - VVCAM_ISP_PAD_SOURCE_P2SP2, - VVCAM_ISP_PAD_SINK_P3, - VVCAM_ISP_PAD_SOURCE_P3MP, - VVCAM_ISP_PAD_SOURCE_P3SP1, - VVCAM_ISP_PAD_SOURCE_P3SP2, - VVCAM_ISP_PAD_NR, +#define VVCAM_ISP_PORT_NR 4 +enum vvcam_isp_port_pad_e { + VVCAM_ISP_PORT_PAD_SINK = 0, + VVCAM_ISP_PORT_PAD_SOURCE_MP, + VVCAM_ISP_PORT_PAD_SOURCE_SP1, + VVCAM_ISP_PORT_PAD_SOURCE_SP2, + VVCAM_ISP_PORT_PAD_SOURCE_RAW, + VVCAM_ISP_PORT_PAD_NR, }; +#define VVCAM_ISP_PAD_NR (VVCAM_ISP_PORT_NR * VVCAM_ISP_PORT_PAD_NR) + struct vvcam_isp_mbus_fmt { uint32_t code; }; @@ -149,8 +140,8 @@ struct vvcam_isp_dev { uint32_t ctrl_pad; unsigned long pde; - struct vvcam_isp_sensor_info sensor_info[VVCAM_ISP_CHN_MAX]; + struct vvcam_isp_sensor_info sensor_info[VVCAM_ISP_PORT_NR]; }; -#endif \ No newline at end of file +#endif diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_event.h b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_event.h index 7fcc263..10895d2 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_event.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_event.h @@ -51,6 +51,7 @@ * *****************************************************************************/ + #ifndef __VVCAM_ISP_EVENT_H__ #define __VVCAM_ISP_EVENT_H__ diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_platform.c b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_platform.c index afa226f..d6f128d 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_platform.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_platform.c @@ -1,108 +1,58 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + -/**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ #include #include #include diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_platform.h b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_platform.h index fe8342d..247a57f 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_platform.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_platform.h @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_ISP_PLATFORM_H__ #define __VVCAM_ISP_PLATFORM_H__ diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_procfs.c b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_procfs.c index aaac55c..eade41e 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_procfs.c +++ b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_procfs.c @@ -87,14 +87,15 @@ static int vvcam_isp_procfs_info_show(struct seq_file *sfile, void *offset) pad = media_entity_remote_pad(&isp_dev->pads[pad_idx]); #endif - if (pad && (port != (pad_idx / VVCAM_ISP_CHN_MAX))) { - port = pad_idx / VVCAM_ISP_CHN_MAX; + if (pad && (port != (pad_idx / VVCAM_ISP_PORT_PAD_NR))) { + port = pad_idx / VVCAM_ISP_PORT_PAD_NR; seq_printf(sfile, "isp%d port%d:\n", isp_dev->id, port); seq_printf(sfile, "sensor : %s\n", isp_dev->sensor_info[port].sensor); seq_printf(sfile, "mode : %d\n", isp_dev->sensor_info[port].mode); seq_printf(sfile, "xml : %s\n", isp_dev->sensor_info[port].xml); seq_printf(sfile, "manu_json: %s\n", isp_dev->sensor_info[port].manu_json); seq_printf(sfile, "auto_json: %s\n", isp_dev->sensor_info[port].auto_json); + seq_printf(sfile, "*********************************\n"); } } @@ -132,7 +133,7 @@ static int32_t vvcam_isp_proc_process(struct seq_file *sfile, continue; } - if ((port > VVCAM_ISP_CHN_MAX) || (port < 0)) { + if ((port > VVCAM_ISP_PORT_NR) || (port < 0)) { continue; } @@ -281,8 +282,10 @@ static int find_proc_dir_by_name(const char *root, pfile = filp_open(root, O_RDONLY | O_DIRECTORY, 0); if (pfile->f_op->iterate_shared) { ret = pfile->f_op->iterate_shared(pfile, &fc.ctx); +#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 2, 0) } else { - // ret = pfile->f_op->iterate(pfile, &fc.ctx); + ret = pfile->f_op->iterate(pfile, &fc.ctx); +#endif } if (ret == 0) { diff --git a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_procfs.h b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_procfs.h index 019b84f..2724e73 100644 --- a/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_procfs.h +++ b/buildroot-overlay/package/vvcam/v4l2/isp/vvcam_isp_procfs.h @@ -1,63 +1,63 @@ -/**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ - - -#ifndef __VVCAM_ISP_PROCFS_H__ -#define __VVCAM_ISP_PROCFS_H__ - -int vvcam_isp_procfs_register(struct vvcam_isp_dev *isp_dev, - unsigned long *pde); -void vvcam_isp_procfs_unregister(unsigned long pde); - -#endif - +/**************************************************************************** + * + * The MIT License (MIT) + * + * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + ***************************************************************************** + * + * The GPL License (GPL) + * + * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; + * + ***************************************************************************** + * + * Note: This software is released under dual MIT and GPL licenses. A + * recipient may use this file under the terms of either the MIT license or + * GPL License. If you wish to use only one license not the other, you can + * indicate your decision by deleting one of the above license notices in your + * version of this file. + * + *****************************************************************************/ + + +#ifndef __VVCAM_ISP_PROCFS_H__ +#define __VVCAM_ISP_PROCFS_H__ + +int vvcam_isp_procfs_register(struct vvcam_isp_dev *isp_dev, + unsigned long *pde); +void vvcam_isp_procfs_unregister(unsigned long pde); + +#endif + diff --git a/buildroot-overlay/package/vvcam/v4l2/video/vvcam_pipeline_link.h b/buildroot-overlay/package/vvcam/v4l2/video/vvcam_pipeline_link.h index c82d735..c3110ee 100644 --- a/buildroot-overlay/package/vvcam/v4l2/video/vvcam_pipeline_link.h +++ b/buildroot-overlay/package/vvcam/v4l2/video/vvcam_pipeline_link.h @@ -63,7 +63,6 @@ static struct vvcam_v4l2_link pipeline0[] = { .remote_subdev = &g_vvcam_isp_subdev[0], .remote_pad = 1, }, - #if 0 { .local_is_video = true, .video_index = 1, @@ -78,7 +77,14 @@ static struct vvcam_v4l2_link pipeline0[] = { .remote_subdev = &g_vvcam_isp_subdev[0], .remote_pad = 3, }, - #endif + { + .local_is_video = true, + .video_index = 3, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[0], + .remote_pad = 4, + }, + }; static struct vvcam_v4l2_link pipeline1[] = { @@ -89,7 +95,6 @@ static struct vvcam_v4l2_link pipeline1[] = { .remote_subdev = &g_vvcam_isp_subdev[1], .remote_pad = 1, }, - #if 0 { .local_is_video = true, .video_index = 1, @@ -104,7 +109,124 @@ static struct vvcam_v4l2_link pipeline1[] = { .remote_subdev = &g_vvcam_isp_subdev[1], .remote_pad = 3, }, - #endif }; - #endif \ No newline at end of file +static struct vvcam_v4l2_link mcm_pipeline0[] = { + { + .local_is_video = true, + .video_index = 0, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[0], + .remote_pad = 1, + }, + { + .local_is_video = true, + .video_index = 1, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[0], + .remote_pad = 6, + }, + { + .local_is_video = true, + .video_index = 2, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[0], + .remote_pad = 11, + }, + { + .local_is_video = true, + .video_index = 3, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[0], + .remote_pad = 16, + }, + { + .local_is_video = true, + .video_index = 4, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[0], + .remote_pad = 4, + }, + { + .local_is_video = true, + .video_index = 5, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[0], + .remote_pad = 9, + }, + { + .local_is_video = true, + .video_index = 6, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[0], + .remote_pad = 14, + }, + { + .local_is_video = true, + .video_index = 7, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[0], + .remote_pad = 19, + }, +}; + +static struct vvcam_v4l2_link mcm_pipeline1[] = { + { + .local_is_video = true, + .video_index = 0, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[1], + .remote_pad = 1, + }, + { + .local_is_video = true, + .video_index = 1, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[1], + .remote_pad = 6, + }, + { + .local_is_video = true, + .video_index = 2, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[1], + .remote_pad = 11, + }, + { + .local_is_video = true, + .video_index = 3, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[1], + .remote_pad = 16, + }, + { + .local_is_video = true, + .video_index = 4, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[1], + .remote_pad = 4, + }, + { + .local_is_video = true, + .video_index = 5, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[1], + .remote_pad = 9, + }, + { + .local_is_video = true, + .video_index = 6, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[1], + .remote_pad = 14, + }, + { + .local_is_video = true, + .video_index = 7, + .local_pad = 0, + .remote_subdev = &g_vvcam_isp_subdev[1], + .remote_pad = 19, + }, +}; + + #endif diff --git a/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_driver.c b/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_driver.c index f6d14f5..7cd09ac 100644 --- a/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_driver.c +++ b/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_driver.c @@ -75,6 +75,11 @@ #include "vvcam_pipeline_link.h" #endif +#ifdef VVCAM_PLATFORM_REGISTER +static int mcm_mask = 0x00; +MODULE_PARM_DESC(mcm_mask, "vvcam video mcm mask"); +#endif + static int vvcam_video_register_ports(struct vvcam_media_dev *vvcam_mdev) { int i = 0; @@ -111,8 +116,13 @@ static int vvcam_video_unregister_ports(struct vvcam_media_dev *vvcam_mdev) } #ifdef VVCAM_PLATFORM_REGISTER +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) static int vvcam_video_notifier_bound(struct v4l2_async_notifier *notifier, struct v4l2_subdev *sd, struct v4l2_async_connection *asc) +#else +static int vvcam_video_notifier_bound(struct v4l2_async_notifier *notifier, + struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) +#endif { struct vvcam_media_dev *vvcam_mdev = container_of(notifier, struct vvcam_media_dev, notifier); @@ -161,8 +171,13 @@ static int vvcam_video_notifier_bound(struct v4l2_async_notifier *notifier, } #else +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) static int vvcam_video_notifier_bound(struct v4l2_async_notifier *notifier, struct v4l2_subdev *sd, struct v4l2_async_connection *asc) +#else +static int vvcam_video_notifier_bound(struct v4l2_async_notifier *notifier, + struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) +#endif { struct vvcam_media_dev *vvcam_mdev = container_of(notifier, struct vvcam_media_dev, notifier); @@ -200,7 +215,7 @@ static int vvcam_video_notifier_bound(struct v4l2_async_notifier *notifier, dev_err(dev, "failed to create %s:%u -> %s:%u link\n", source->name, source_pad, sink->name, sink_pad); break; } - dev_info(vvcam_mdev->dev, "create link %s:%u -> %s:%u\n", source->name, source_pad, sink->name, sink_pad); + } fwnode_handle_put(ep); @@ -208,11 +223,19 @@ static int vvcam_video_notifier_bound(struct v4l2_async_notifier *notifier, } #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) static void vvcam_video_notifier_unbound(struct v4l2_async_notifier *notifier, struct v4l2_subdev *sd, struct v4l2_async_connection *asc) { return; } +#else +static void vvcam_video_notifier_unbound(struct v4l2_async_notifier *notifier, + struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) +{ + return; +} +#endif static int vvcam_video_notifier_complete(struct v4l2_async_notifier *notifier) { @@ -229,16 +252,69 @@ static const struct v4l2_async_notifier_operations vvcam_video_async_nf_ops = { }; #ifdef VVCAM_PLATFORM_REGISTER +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) static int vvcam_video_async_register_subdev(struct vvcam_media_dev *vvcam_mdev) { int ret; int i = 0; - struct v4l2_subdev *remote_subdev; + bool repeat = false; + struct v4l2_subdev *remote_subdev = NULL; + struct v4l2_subdev *last_subdev = NULL; struct v4l2_async_connection *asc; + v4l2_async_nf_init(&vvcam_mdev->notifier, &vvcam_mdev->v4l2_dev); + + vvcam_mdev->notifier.ops = &vvcam_video_async_nf_ops; + + for (i = 0; i < vvcam_mdev->pipeline_link_size; i++) { + if (vvcam_mdev->pipeline_link[i].remote_subdev) { + remote_subdev = *vvcam_mdev->pipeline_link[i].remote_subdev; + /* not allow repeat add same fwnode */ + for (int j = i - 1; j >= 0; j--) { + last_subdev = *vvcam_mdev->pipeline_link[j].remote_subdev; + if (remote_subdev && last_subdev && + remote_subdev == last_subdev) { + repeat = true; + break; + } + } + + if (remote_subdev && !repeat) { + asc = v4l2_async_nf_add_fwnode(&vvcam_mdev->notifier, + remote_subdev->fwnode, + struct v4l2_async_connection); + if (IS_ERR(asc)) { + ret = PTR_ERR(asc); + if (ret != -EEXIST) { + v4l2_async_nf_cleanup(&vvcam_mdev->notifier); + return ret; + } + } + } + repeat = false; + } + } + + ret = v4l2_async_nf_register(&vvcam_mdev->notifier); + if (ret) { + v4l2_async_nf_cleanup(&vvcam_mdev->notifier); + return ret; + } + + return 0; +} + +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) */ +static int vvcam_video_async_register_subdev(struct vvcam_media_dev *vvcam_mdev) +{ + int ret; + int i = 0; + struct v4l2_subdev *remote_subdev; + struct v4l2_async_subdev *asd; + vvcam_mdev->notifier.ops = &vvcam_video_async_nf_ops; #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) - v4l2_async_nf_init(&vvcam_mdev->notifier, &vvcam_mdev->v4l2_dev); + v4l2_async_nf_init(&vvcam_mdev->notifier); #else v4l2_async_notifier_init(&vvcam_mdev->notifier); #endif @@ -248,17 +324,17 @@ static int vvcam_video_async_register_subdev(struct vvcam_media_dev *vvcam_mdev) remote_subdev = *vvcam_mdev->pipeline_link[i].remote_subdev; if (remote_subdev) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) - asc = v4l2_async_nf_add_fwnode(&vvcam_mdev->notifier, + asd = v4l2_async_nf_add_fwnode(&vvcam_mdev->notifier, remote_subdev->fwnode, - struct v4l2_async_connection); + struct v4l2_async_subdev); #else asd = v4l2_async_notifier_add_fwnode_subdev( &vvcam_mdev->notifier, remote_subdev->fwnode, - sizeof(struct v4l2_async_subdev)); + struct v4l2_async_subdev); #endif - if (IS_ERR(asc)) { - ret = PTR_ERR(asc); + if (IS_ERR(asd)) { + ret = PTR_ERR(asd); if (ret != -EEXIST) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) v4l2_async_nf_cleanup(&vvcam_mdev->notifier); @@ -273,7 +349,7 @@ static int vvcam_video_async_register_subdev(struct vvcam_media_dev *vvcam_mdev) } #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) - ret = v4l2_async_nf_register(&vvcam_mdev->notifier); + ret = v4l2_async_nf_register(&vvcam_mdev->v4l2_dev, &vvcam_mdev->notifier); #else ret = v4l2_async_notifier_register(&vvcam_mdev->v4l2_dev, &vvcam_mdev->notifier); #endif @@ -289,36 +365,99 @@ static int vvcam_video_async_register_subdev(struct vvcam_media_dev *vvcam_mdev) return 0; } -#else +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) */ +#else /* VVCAM_PLATFORM_REGISTER */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) static struct v4l2_async_connection * +vvcam_video_async_nf_add_fwnode_remote(struct v4l2_async_notifier *notif, + struct fwnode_handle *endpoint, + unsigned int asc_struct_size) +{ + struct v4l2_async_connection *asc; + struct fwnode_handle *remote; + + remote = fwnode_graph_get_remote_port_parent(endpoint); + if (!remote) + return ERR_PTR(-ENOTCONN); + + asc = __v4l2_async_nf_add_fwnode(notif, remote, asc_struct_size); + fwnode_handle_put(remote); + + return asc; +} + +static int vvcam_video_async_register_subdev(struct vvcam_media_dev *vvcam_mdev) +{ + int ret = 0; + struct fwnode_handle *ep; + struct v4l2_async_connection *asc; + unsigned int port_id = 0; + + vvcam_mdev->notifier.ops = &vvcam_video_async_nf_ops; + + v4l2_async_nf_init(&vvcam_mdev->notifier, &vvcam_mdev->v4l2_dev); + + while (1) { + ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(vvcam_mdev->dev), + port_id, 0, FWNODE_GRAPH_ENDPOINT_NEXT); + if (!ep) + break; + + asc = vvcam_video_async_nf_add_fwnode_remote(&vvcam_mdev->notifier, + ep, sizeof(struct v4l2_async_connection)); + + fwnode_handle_put(ep); + + if (IS_ERR(asc)) { + ret = PTR_ERR(asc); + if (ret != -EEXIST) { + v4l2_async_nf_cleanup(&vvcam_mdev->notifier); + return ret; + } + } + port_id++; + } + + ret = v4l2_async_nf_register(&vvcam_mdev->notifier); + if (ret) { + v4l2_async_nf_cleanup(&vvcam_mdev->notifier); + dev_err(vvcam_mdev->dev, "v4l2 async notifier register error\n"); + return ret; + } + + return 0; +} + +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) */ +static struct v4l2_async_subdev * vvcam_video_async_nf_add_fwnode_remote(struct v4l2_async_notifier *notif, struct fwnode_handle *endpoint, unsigned int asd_struct_size) { - struct v4l2_async_connection *asc; + struct v4l2_async_subdev *asd; struct fwnode_handle *remote; remote = fwnode_graph_get_remote_port_parent(endpoint); if (!remote) return ERR_PTR(-ENOTCONN); - asc = __v4l2_async_nf_add_fwnode(notif, remote, asd_struct_size); + asd = __v4l2_async_nf_add_fwnode(notif, remote, asd_struct_size); fwnode_handle_put(remote); - return asc; + return asd; } static int vvcam_video_async_register_subdev(struct vvcam_media_dev *vvcam_mdev) { int ret = 0; struct fwnode_handle *ep; - struct v4l2_async_connection* asc; + struct v4l2_async_subdev *asd; unsigned int port_id = 0; vvcam_mdev->notifier.ops = &vvcam_video_async_nf_ops; #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) - v4l2_async_nf_init(&vvcam_mdev->notifier, &vvcam_mdev->v4l2_dev); + v4l2_async_nf_init(&vvcam_mdev->notifier); #else v4l2_async_notifier_init(&vvcam_mdev->notifier); #endif @@ -331,17 +470,16 @@ static int vvcam_video_async_register_subdev(struct vvcam_media_dev *vvcam_mdev) #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) - asc = vvcam_video_async_nf_add_fwnode_remote(&vvcam_mdev->notifier, - ep, sizeof(struct v4l2_async_connection)); + asd = vvcam_video_async_nf_add_fwnode_remote(&vvcam_mdev->notifier, + ep, sizeof(struct v4l2_async_subdev)); #else - // FIXME - ret = v4l2_async_notifier_add_fwnode_remote_subdev(&vvcam_mdev->notifier, - ep, &asd); + asd = v4l2_async_notifier_add_fwnode_remote_subdev(&vvcam_mdev->notifier, + ep, struct v4l2_async_subdev); #endif fwnode_handle_put(ep); - if (ret/*IS_ERR(asd)*/) { - // ret = PTR_ERR(asd); + if (IS_ERR(asd)) { + ret = PTR_ERR(asd); if (ret != -EEXIST) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) v4l2_async_nf_cleanup(&vvcam_mdev->notifier); @@ -351,15 +489,14 @@ static int vvcam_video_async_register_subdev(struct vvcam_media_dev *vvcam_mdev) return ret; } } - dev_info(vvcam_mdev->dev, "register subdev port %d, subdev: %p\n", port_id, ep->dev); port_id++; } #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) - ret = v4l2_async_nf_register(&vvcam_mdev->notifier); + ret = v4l2_async_nf_register(&vvcam_mdev->v4l2_dev, &vvcam_mdev->notifier); #else ret = v4l2_async_notifier_register(&vvcam_mdev->v4l2_dev, &vvcam_mdev->notifier); #endif - if (0) { + if (ret) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) v4l2_async_nf_cleanup(&vvcam_mdev->notifier); #else @@ -371,7 +508,8 @@ static int vvcam_video_async_register_subdev(struct vvcam_media_dev *vvcam_mdev) return 0; } -#endif +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) */ +#endif /* VVCAM_PLATFORM_REGISTER */ static int vvcam_video_async_unregister_subdev(struct vvcam_media_dev *vvcam_mdev) { @@ -379,11 +517,8 @@ static int vvcam_video_async_unregister_subdev(struct vvcam_media_dev *vvcam_mde v4l2_async_nf_unregister(&vvcam_mdev->notifier); v4l2_async_nf_cleanup(&vvcam_mdev->notifier); #else - dev_info(vvcam_mdev->dev, "%s:%d\n", __func__, __LINE__); v4l2_async_notifier_unregister(&vvcam_mdev->notifier); - dev_info(vvcam_mdev->dev, "%s:%d\n", __func__, __LINE__); - // FIXME: cause error - // v4l2_async_notifier_cleanup(&vvcam_mdev->notifier); + v4l2_async_notifier_cleanup(&vvcam_mdev->notifier); #endif return 0; @@ -402,12 +537,22 @@ static int vvcam_video_parse_params(struct vvcam_media_dev *vvcam_mdev, vvcam_mdev->id = pdev->id; switch(vvcam_mdev->id) { case 0: - vvcam_mdev->pipeline_link = pipeline0; - vvcam_mdev->pipeline_link_size = ARRAY_SIZE(pipeline0); + if (!mcm_mask) { + vvcam_mdev->pipeline_link = pipeline0; + vvcam_mdev->pipeline_link_size = ARRAY_SIZE(pipeline0); + } else { + vvcam_mdev->pipeline_link = mcm_pipeline0; + vvcam_mdev->pipeline_link_size = ARRAY_SIZE(mcm_pipeline0); + } break; case 1: - vvcam_mdev->pipeline_link = pipeline1; - vvcam_mdev->pipeline_link_size = ARRAY_SIZE(pipeline1); + if (!mcm_mask) { + vvcam_mdev->pipeline_link = pipeline1; + vvcam_mdev->pipeline_link_size = ARRAY_SIZE(pipeline1); + } else { + vvcam_mdev->pipeline_link = mcm_pipeline1; + vvcam_mdev->pipeline_link_size = ARRAY_SIZE(mcm_pipeline1); + } break; default: break; @@ -449,7 +594,7 @@ static int vvcam_video_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct vvcam_media_dev *vvcam_mdev; - dev_info(dev, "%s 1\n", __func__); + dev_info(dev, "%s\n", __func__); vvcam_mdev = devm_kzalloc(dev, sizeof(struct vvcam_media_dev), GFP_KERNEL); if (!vvcam_mdev) @@ -512,13 +657,10 @@ static int vvcam_video_remove(struct platform_device *pdev) struct vvcam_media_dev *vvcam_mdev; vvcam_mdev = platform_get_drvdata(pdev); - dev_info(&pdev->dev, "%s:%d\n", __func__, __LINE__); + media_device_unregister(&vvcam_mdev->mdev); - dev_info(&pdev->dev, "%s:%d\n", __func__, __LINE__); vvcam_video_async_unregister_subdev(vvcam_mdev); - dev_info(&pdev->dev, "%s:%d\n", __func__, __LINE__); vvcam_video_unregister_ports(vvcam_mdev); - dev_info(&pdev->dev, "%s:%d\n", __func__, __LINE__); v4l2_device_unregister(&vvcam_mdev->v4l2_dev); dev_info(&pdev->dev, "vvcam video driver remove\n"); @@ -573,6 +715,10 @@ static void __exit vvcam_video_exit_module(void) return; } +#ifdef VVCAM_PLATFORM_REGISTER +module_param(mcm_mask, int, 0644); +#endif + module_init(vvcam_video_init_module); module_exit(vvcam_video_exit_module); diff --git a/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_event.c b/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_event.c index 7a62777..940b147 100644 --- a/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_event.c +++ b/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_event.c @@ -51,6 +51,7 @@ * *****************************************************************************/ + #include #include #include diff --git a/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_register.c b/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_register.c index 3b0c141..562c647 100644 --- a/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_register.c +++ b/buildroot-overlay/package/vvcam/v4l2/video/vvcam_video_register.c @@ -72,6 +72,10 @@ #include "vvcam_v4l2_common.h" #include "vvcam_video_event.h" +#ifndef V4L2_PIX_FMT_P010 +#define V4L2_PIX_FMT_P010 v4l2_fourcc('P', '0', '1', '0') /* 24 Y/CbCr 4:2:0 10-bit per component */ +#endif + static struct vvcam_video_fmt_info vvcam_formats_info[] = { { .fourcc = V4L2_PIX_FMT_NV16, @@ -85,6 +89,66 @@ static struct vvcam_video_fmt_info vvcam_formats_info[] = { .fourcc = V4L2_PIX_FMT_YUYV, .mbus = MEDIA_BUS_FMT_YUYV8_1X16, }, + { + .fourcc = V4L2_PIX_FMT_BGR24, + .mbus = MEDIA_BUS_FMT_BGR888_1X24, + }, + { + .fourcc = v4l2_fourcc('B', 'G', '3', 'P'), + .mbus = MEDIA_BUS_FMT_BGR888_3X8, + }, + { + .fourcc = V4L2_PIX_FMT_SBGGR8, + .mbus = MEDIA_BUS_FMT_SBGGR8_1X8, + }, + { + .fourcc = V4L2_PIX_FMT_SGBRG8, + .mbus = MEDIA_BUS_FMT_SGBRG8_1X8, + }, + { + .fourcc = V4L2_PIX_FMT_SGRBG8, + .mbus = MEDIA_BUS_FMT_SGRBG8_1X8, + }, + { + .fourcc = V4L2_PIX_FMT_SRGGB8, + .mbus = MEDIA_BUS_FMT_SRGGB8_1X8, + }, + { + .fourcc = V4L2_PIX_FMT_SBGGR10, + .mbus = MEDIA_BUS_FMT_SBGGR10_1X10, + }, + { + .fourcc = V4L2_PIX_FMT_SGBRG10, + .mbus = MEDIA_BUS_FMT_SGBRG10_1X10, + }, + { + .fourcc = V4L2_PIX_FMT_SGRBG10, + .mbus = MEDIA_BUS_FMT_SGRBG10_1X10, + }, + { + .fourcc = V4L2_PIX_FMT_SRGGB10, + .mbus = MEDIA_BUS_FMT_SRGGB10_1X10, + }, + { + .fourcc = V4L2_PIX_FMT_SBGGR12, + .mbus = MEDIA_BUS_FMT_SBGGR12_1X12, + }, + { + .fourcc = V4L2_PIX_FMT_SGBRG12, + .mbus = MEDIA_BUS_FMT_SGBRG12_1X12, + }, + { + .fourcc = V4L2_PIX_FMT_SGRBG12, + .mbus = MEDIA_BUS_FMT_SGRBG12_1X12, + }, + { + .fourcc = V4L2_PIX_FMT_SRGGB12, + .mbus = MEDIA_BUS_FMT_SRGGB12_1X12, + }, + { + .fourcc = V4L2_PIX_FMT_P010, + .mbus = MEDIA_BUS_FMT_YUYV10_2X10, + }, }; static int vvcam_video_mbus_to_fourcc(uint32_t mbus, uint32_t *fourcc) @@ -131,15 +195,56 @@ static int vvcam_video_vfmt_to_mfmt(struct v4l2_format *f, struct v4l2_subdev_fo } +static const struct v4l2_format_info *vvcam_video_vfmt_info(u32 format) +{ + /* format info for user define or supported by later versions */ + static const struct v4l2_format_info formats[] = { + /* YUV planar formats */ + { + .format = V4L2_PIX_FMT_P010, + .pixel_enc = V4L2_PIXEL_ENC_YUV, + .mem_planes = 1, + .comp_planes = 2, + .bpp = {2, 2, 0, 0}, + .hdiv = 2, + .vdiv = 1, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0) + .bpp_div = {1, 1, 1, 1}, +#endif + }, + }; + + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(formats); i++) { + if (formats[i].format == format) + return &formats[i]; + } + + return NULL; +} + static int vvcam_video_mfmt_to_vfmt( struct v4l2_subdev_format *mfmt, struct v4l2_format *f) { int ret; - const struct v4l2_format_info *info; + const struct v4l2_format_info *info = NULL; uint32_t bytesperline; uint32_t sizeimage = 0; uint32_t width; uint32_t height; int i; + struct v4l2_format_info bg3p_info = { + .format = v4l2_fourcc('B', 'G', '3', 'P'), + .pixel_enc = V4L2_PIXEL_ENC_RGB, + .mem_planes = 3, + .comp_planes = 3, + .bpp = { + 1, 1, 1, 0 + }, + .bpp_div = { 1, 1, 1, 1 }, + .hdiv = 1, + .vdiv = 1 + }; f->fmt.pix.width = mfmt->format.width; f->fmt.pix.height = mfmt->format.height; @@ -147,12 +252,24 @@ static int vvcam_video_mfmt_to_vfmt( struct v4l2_subdev_format *mfmt, struct v4l f->fmt.pix.colorspace = mfmt->format.colorspace; f->fmt.pix.quantization = mfmt->format.quantization; ret = vvcam_video_mbus_to_fourcc(mfmt->format.code, &f->fmt.pix.pixelformat); - if (ret) + if (ret) { return ret; + } width = f->fmt.pix.width; height = f->fmt.pix.height; - info = v4l2_format_info(f->fmt.pix.pixelformat); + if (f->fmt.pix.pixelformat == v4l2_fourcc('B', 'G', '3', 'P')) { + // special format + info = &bg3p_info; + } else { + info = v4l2_format_info(f->fmt.pix.pixelformat); + } + if (info == NULL) { + info = vvcam_video_vfmt_info(f->fmt.pix.pixelformat); + if (info == NULL) + return -EINVAL; + } + bytesperline = info->bpp[0] * width; sizeimage = bytesperline * height; @@ -200,37 +317,43 @@ static int vvcam_video_try_create_pipeline(struct vvcam_video_dev *vvcam_vdev) struct v4l2_subdev_format sd_fmt; struct v4l2_subdev_pad_config pad_cfg; struct v4l2_subdev_state sd_state = { - .pads = &pad_cfg + .pads = &pad_cfg, }; if (vvcam_vdev->pipeline) { return 0; } ret = vvcam_video_create_pipeline_event(vvcam_vdev); - if (ret) + if (ret) { return ret; + } subdev = vvcam_video_remote_subdev(vvcam_vdev); - if (!subdev) + if (!subdev) { return -EINVAL; + } #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) pad = media_pad_remote_pad_first(&vvcam_vdev->pad); #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&sd_fmt, 0, sizeof(sd_fmt)); sd_fmt.pad = pad->index; sd_fmt.which = V4L2_SUBDEV_FORMAT_TRY; ret = v4l2_subdev_call(subdev, pad, get_fmt, &sd_state, &sd_fmt); - if (ret) + if (ret) { return ret; + } ret = vvcam_video_mfmt_to_vfmt(&sd_fmt, &vvcam_vdev->format); - if (ret) + if (ret) { return ret; + } vvcam_vdev->pipeline = 1; + return 0; } @@ -262,10 +385,15 @@ static int vvcam_videoc_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_subdev_mbus_code_enum mbus_code; struct v4l2_subdev_pad_config pad_cfg; struct v4l2_subdev_state sd_state = { - .pads = &pad_cfg + .pads = &pad_cfg, }; int ret = -EINVAL; + ret = vvcam_video_try_create_pipeline(vvcam_vdev); + if (ret) { + return ret; + } + subdev = vvcam_video_remote_subdev(vvcam_vdev); if (subdev) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) @@ -297,7 +425,7 @@ static int vvcam_videoc_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_subdev_format sd_fmt; struct v4l2_subdev_pad_config pad_cfg; struct v4l2_subdev_state sd_state = { - .pads = &pad_cfg + .pads = &pad_cfg, }; int ret; @@ -305,8 +433,9 @@ static int vvcam_videoc_try_fmt_vid_cap(struct file *file, void *priv, return -EINVAL; ret = vvcam_video_try_create_pipeline(vvcam_vdev); - if (ret) + if (ret) { return ret; + } subdev = vvcam_video_remote_subdev(vvcam_vdev); if (!subdev) @@ -317,13 +446,15 @@ static int vvcam_videoc_try_fmt_vid_cap(struct file *file, void *priv, pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&sd_fmt, 0, sizeof(sd_fmt)); sd_fmt.pad = pad->index; sd_fmt.which = V4L2_SUBDEV_FORMAT_TRY; vvcam_video_vfmt_to_mfmt(f, &sd_fmt); ret = v4l2_subdev_call(subdev, pad, set_fmt, &sd_state, &sd_fmt); - if (ret) + if (ret) { return ret; + } ret = vvcam_video_mfmt_to_vfmt(&sd_fmt, f); @@ -340,7 +471,7 @@ static int vvcam_videoc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_subdev_format sd_fmt; struct v4l2_subdev_pad_config pad_cfg; struct v4l2_subdev_state sd_state = { - .pads = &pad_cfg + .pads = &pad_cfg, }; int ret; @@ -357,14 +488,17 @@ static int vvcam_videoc_s_fmt_vid_cap(struct file *file, void *priv, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + + memset(&sd_fmt, 0, sizeof(sd_fmt)); sd_fmt.pad = pad->index; sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; vvcam_video_vfmt_to_mfmt(f, &sd_fmt); ret = v4l2_subdev_call(subdev, pad, set_fmt, &sd_state, &sd_fmt); - if (ret) + if (ret) { return ret; + } vvcam_vdev->format = *f; printk("%d x %d size %d fmt %s \n", @@ -384,8 +518,9 @@ static int vvcam_videoc_g_fmt_vid_cap(struct file *file, void *fh, return -EINVAL; ret = vvcam_video_try_create_pipeline(vvcam_vdev); - if (ret) + if (ret) { return ret; + } *f = vvcam_vdev->format; @@ -417,6 +552,7 @@ static int vvcam_videoc_reqbufs(struct file *file, void *priv, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&pad_requbufs, 0, sizeof(pad_requbufs)); pad_requbufs.pad = pad->index; pad_requbufs.num_buffers = p->count; v4l2_subdev_call(subdev, core, ioctl, VVCAM_PAD_REQUBUFS, &pad_requbufs); @@ -464,6 +600,7 @@ static int vvcam_videoc_queryctrl(struct file *file, void *fh, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&pad_query_ctrl, 0, sizeof(pad_query_ctrl)); pad_query_ctrl.pad = pad->index; pad_query_ctrl.query_ctrl = a; ret = v4l2_subdev_call(subdev, core, ioctl, @@ -492,6 +629,7 @@ static int vvcam_videoc_query_ext_ctrl(struct file *file, void *fh, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&pad_query_ext_ctrl, 0, sizeof(pad_query_ext_ctrl)); pad_query_ext_ctrl.pad = pad->index; pad_query_ext_ctrl.query_ext_ctrl = a; ret = v4l2_subdev_call(subdev, core, ioctl, @@ -520,6 +658,7 @@ static int vvcam_vidioc_g_ctrl(struct file *file, void *fh, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&pad_control, 0, sizeof(pad_control)); pad_control.pad = pad->index; pad_control.control = a; ret = v4l2_subdev_call(subdev, core, ioctl, @@ -548,6 +687,7 @@ static int vvcam_vidioc_s_ctrl(struct file *file, void *fh, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&pad_control, 0, sizeof(pad_control)); pad_control.pad = pad->index; pad_control.control = a; ret = v4l2_subdev_call(subdev, core, ioctl, @@ -576,6 +716,7 @@ static int vvcam_vidioc_g_ext_ctrls(struct file *file, void *fh, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&pad_ext_controls, 0, sizeof(pad_ext_controls)); pad_ext_controls.pad = pad->index; pad_ext_controls.ext_controls = a; ret = v4l2_subdev_call(subdev, core, ioctl, @@ -604,6 +745,7 @@ static int vvcam_vidioc_s_ext_ctrls(struct file *file, void *fh, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&pad_ext_controls, 0, sizeof(pad_ext_controls)); pad_ext_controls.pad = pad->index; pad_ext_controls.ext_controls = a; ret = v4l2_subdev_call(subdev, core, ioctl, @@ -632,6 +774,7 @@ static int vvcam_vidioc_try_ext_ctrls(struct file *file, void *fh, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&pad_ext_controls, 0, sizeof(pad_ext_controls)); pad_ext_controls.pad = pad->index; pad_ext_controls.ext_controls = a; ret = v4l2_subdev_call(subdev, core, ioctl, @@ -660,6 +803,7 @@ static int vvcam_vidioc_querymenu(struct file *file, void *fh, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&pad_querymenu, 0, sizeof(pad_querymenu)); pad_querymenu.pad = pad->index; pad_querymenu.querymenu = a; ret = v4l2_subdev_call(subdev, core, ioctl, @@ -884,6 +1028,7 @@ static void vvcam_video_vb2_buf_queue(struct vb2_buffer *vb) #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&pad_buf, 0, sizeof(pad_buf)); pad_buf.pad = pad->index; pad_buf.buf = buf; v4l2_subdev_call(subdev, core, ioctl, VVCAM_PAD_BUF_QUEUE, &pad_buf); @@ -908,6 +1053,7 @@ static int vvcam_video_vb2_start_streaming(struct vb2_queue *queue, #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&stream_status, 0, sizeof(stream_status)); stream_status.pad = pad->index; stream_status.status = 1; ret = v4l2_subdev_call(subdev, core, ioctl, VVCAM_PAD_S_STREAM, &stream_status); @@ -931,6 +1077,7 @@ static void vvcam_video_vb2_stop_streaming(struct vb2_queue *queue) #else pad = media_entity_remote_pad(&vvcam_vdev->pad); #endif + memset(&stream_status, 0, sizeof(stream_status)); stream_status.pad = pad->index; stream_status.status = 0; v4l2_subdev_call(subdev, core, ioctl, VVCAM_PAD_S_STREAM, &stream_status); diff --git a/buildroot-overlay/package/vvcam/vb/vvcam_cma.c b/buildroot-overlay/package/vvcam/vb/vvcam_cma.c index b16e2cb..5407562 100644 --- a/buildroot-overlay/package/vvcam/vb/vvcam_cma.c +++ b/buildroot-overlay/package/vvcam/vb/vvcam_cma.c @@ -134,7 +134,7 @@ int vvcam_cma_alloc(struct file *file, return -ENOMEM; } cma_buf->size = size; - strncpy(cma_buf->name, name, strlen(name)); + strncpy(cma_buf->name, name, sizeof(cma_buf->name)); cma_buf->private = file; list_add_tail(&cma_buf->list, &cma->buf_list); diff --git a/buildroot-overlay/package/vvcam/vb/vvcam_mmz.c b/buildroot-overlay/package/vvcam/vb/vvcam_mmz.c index aa2a95b..0635578 100644 --- a/buildroot-overlay/package/vvcam/vb/vvcam_mmz.c +++ b/buildroot-overlay/package/vvcam/vb/vvcam_mmz.c @@ -298,7 +298,7 @@ static int vvcam_mmz_alloc(struct file *file, if (mmb == NULL) return -1; - strncpy(mmb->name, name, strlen(name)); + strncpy(mmb->name, name, sizeof(mmb->name)); mmb->private = file; list_add_tail(&mmb->list, &mmz->mmb_list); diff --git a/buildroot-overlay/package/vvcam/vb/vvcam_vb_driver.c b/buildroot-overlay/package/vvcam/vb/vvcam_vb_driver.c index 58dc37c..843f206 100644 --- a/buildroot-overlay/package/vvcam/vb/vvcam_vb_driver.c +++ b/buildroot-overlay/package/vvcam/vb/vvcam_vb_driver.c @@ -357,7 +357,7 @@ static int vvcam_vb_remove(struct platform_device *pdev) } static const struct of_device_id vvcam_vb_of_match[] = { - {.compatible = "verislicon,vb",}, + {.compatible = "verisilicon,vb",}, { /* sentinel */ }, }; diff --git a/buildroot-overlay/package/vvcam/vb/vvcam_vb_driver.h b/buildroot-overlay/package/vvcam/vb/vvcam_vb_driver.h index 90139b6..4fb7fab 100644 --- a/buildroot-overlay/package/vvcam/vb/vvcam_vb_driver.h +++ b/buildroot-overlay/package/vvcam/vb/vvcam_vb_driver.h @@ -51,6 +51,7 @@ * *****************************************************************************/ + #ifndef __VVCAM_VB_DRIVER_H__ #define __VVCAM_VB_DRIVER_H__ diff --git a/buildroot-overlay/package/vvcam/vb/vvcam_vb_platform.h b/buildroot-overlay/package/vvcam/vb/vvcam_vb_platform.h index bf83211..0646936 100644 --- a/buildroot-overlay/package/vvcam/vb/vvcam_vb_platform.h +++ b/buildroot-overlay/package/vvcam/vb/vvcam_vb_platform.h @@ -1,55 +1,57 @@ /**************************************************************************** - * - * The MIT License (MIT) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - ***************************************************************************** - * - * The GPL License (GPL) - * - * Copyright (c) 2023 VeriSilicon Holdings Co., Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; - * - ***************************************************************************** - * - * Note: This software is released under dual MIT and GPL licenses. A - * recipient may use this file under the terms of either the MIT license or - * GPL License. If you wish to use only one license not the other, you can - * indicate your decision by deleting one of the above license notices in your - * version of this file. - * - *****************************************************************************/ +* +* The MIT License (MIT) +* +* Copyright (c) 2014 - 2024 Vivante Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +***************************************************************************** +* +* The GPL License (GPL) +* +* Copyright (C) 2014 - 2024 Vivante Corporation +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +***************************************************************************** +* +* Note: This software is released under dual MIT and GPL licenses. A +* recipient may use this file under the terms of either the MIT license or +* GPL License. If you wish to use only one license not the other, you can +* indicate your decision by deleting one of the above license notices in your +* version of this file. +* +*****************************************************************************/ + #ifndef __VVCAM_VB_PLATFORM_H__ #define __VVCAM_VB_PLATFORM_H__ diff --git a/buildroot-overlay/package/vvcam/vb/vvcam_vb_procfs.c b/buildroot-overlay/package/vvcam/vb/vvcam_vb_procfs.c index b9bb9a3..6536e6b 100644 --- a/buildroot-overlay/package/vvcam/vb/vvcam_vb_procfs.c +++ b/buildroot-overlay/package/vvcam/vb/vvcam_vb_procfs.c @@ -378,8 +378,10 @@ static int find_proc_dir_by_name(const char *root, pfile = filp_open(root, O_RDONLY | O_DIRECTORY, 0); if (pfile->f_op->iterate_shared) { ret = pfile->f_op->iterate_shared(pfile, &fc.ctx); +#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 2, 0) } else { - // ret = pfile->f_op->iterate(pfile, &fc.ctx); + ret = pfile->f_op->iterate(pfile, &fc.ctx); +#endif } if (ret == 0) { diff --git a/buildroot-overlay/package/vvcam/vvcam.mk b/buildroot-overlay/package/vvcam/vvcam.mk index d5bc671..f8405ad 100644 --- a/buildroot-overlay/package/vvcam/vvcam.mk +++ b/buildroot-overlay/package/vvcam/vvcam.mk @@ -10,7 +10,7 @@ VVCAM_SITE = $(realpath $(TOPDIR))"/package/vvcam" VVCAM_SITE_METHOD = local VVCAM_INSTALL_STAGING = YES VVCAM_INSTALL_TARGET = YES -VVCAM_DEPENDENCIES = mxml libmicrohttpd +VVCAM_DEPENDENCIES = mxml libmicrohttpd display VVCAM_SUPPORTS_IN_SOURCE_BUILD = NO $(eval $(kernel-module)) diff --git a/buildroot-overlay/support/dependencies/check-host-cmake.mk b/buildroot-overlay/support/dependencies/check-host-cmake.mk new file mode 100755 index 0000000..b61be92 --- /dev/null +++ b/buildroot-overlay/support/dependencies/check-host-cmake.mk @@ -0,0 +1,10 @@ +# The cmake minimum version is set to either 3.18 or higher, +# depending on the highest minimum version required by any +# of the packages bundled in Buildroot. If a package is +# bumped or a new one added, and it requires a higher +# cmake version than the one provided by the host, our +# cmake infra will catch it and build its own. +# + +BR2_CMAKE = $(HOST_DIR)/bin/cmake +BR2_CMAKE_HOST_DEPENDENCY = host-cmake