Files
BPI-M2C/imx258-camera-a-group.patch
T

2371 lines
99 KiB
Diff
Raw Normal View History

2026-09-22 09:38:26 +08:00
diff -ruN a/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/recovery-uis7885-2h10.dts b/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/recovery-uis7885-2h10.dts
--- a/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/recovery-uis7885-2h10.dts 2026-07-02 16:56:23.127495823 +0800
+++ b/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/recovery-uis7885-2h10.dts 2026-07-02 16:55:31.716908070 +0800
@@ -642,12 +642,13 @@
};
&i2c0 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_main: sensor-main@20 {
+ status = "disabled";
compatible = "sprd,sensor-main";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -668,6 +669,7 @@
};
sensor_sub: sensor-sub@5a {
+ status = "disabled";
compatible = "sprd,sensor-sub";
reg = <0x5a>;
clock-names = "clk_src","sensor_eb",
@@ -689,12 +691,13 @@
};
&i2c1 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_main2: sensor-main2@20 {
+ status = "disabled";
compatible = "sprd,sensor-main2";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -722,6 +725,7 @@
#size-cells = <0>;
sensor_main3: sensor-main3@20 {
+ status = "disabled";
compatible = "sprd,sensor-main3";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -735,20 +739,20 @@
vddcamd-supply = <&vddcamd2>;
vddcammot-supply = <&vddcammot1>;
mot-gpios = <&ap_gpio 78 0>;
- reset-gpios = <&ap_gpio 43 0>;
+ reset-gpios = <&ap_gpio 152 0>;
sprd,phyid = <2>;/*4*/
- csi = <&csi2>;
power-domains = <&mm_domain>;
};
};
&i2c5 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_sub2: sensor-sensor_sub2@2a {
+ status = "disabled";
compatible = "sprd,sensor-sub2";
reg = <0x2a>;
clock-names = "clk_src","sensor_eb",
@@ -763,11 +767,11 @@
reset-gpios = <&ap_gpio 44 0>;
power-down-gpios = <&ap_gpio 50 0>;
sprd,phyid = <5>;
- csi = <&csi2>;
power-domains = <&mm_domain>;
};
sensor_sub3: sensor-sensor_sub3@2e {
+ status = "disabled";
compatible = "sprd,sensor-sub3";
reg = <0x2e>;
clock-names = "clk_src","sensor_eb",
@@ -782,7 +786,6 @@
reset-gpios = <&ap_gpio 43 0>;
power-down-gpios = <&ap_gpio 49 0>;
sprd,phyid = <7>;
- csi = <&csi3>;
power-domains = <&mm_domain>;
};
};
@@ -811,6 +814,30 @@
};
};
+&i2c4 {
+ status = "okay";
+ clock-frequency = <400000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ sensor_imx258_a: sensor-imx258-a@1a {
+ compatible = "sprd,sensor-main";
+ reg = <0x1a>;
+ clock-names = "clk_src","sensor_eb",
+ "clk_96m","clk_64m",
+ "clk_51m2","clk_48m","clk_26m";
+ clocks = <&mm_clk CLK_SENSOR2>,<&mm_gate CLK_SENSOR2_EN>,
+ <&g5l_pll CLK_TGPLL_96M>,<&g5l_pll CLK_TGPLL_64M>,
+ <&g5l_pll CLK_TGPLL_51M2>,<&g5l_pll CLK_TGPLL_48M>,<&ext_26m>;
+ vddio-supply = <&vddcamio>;
+ reset-gpios = <&ap_gpio 42 0>;
+ power-down-gpios = <&ap_gpio 47 0>;
+ sprd,phyid = <2>;
+ csi = <&csi2>;
+ power-domains = <&mm_domain>;
+ };
+};
+
&pdm_dmic {
status = "okay";
};
diff -ruN a/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/uis7885-2h10-overlay.dts b/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/uis7885-2h10-overlay.dts
--- a/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/uis7885-2h10-overlay.dts 2026-07-02 16:56:23.127495823 +0800
+++ b/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/uis7885-2h10-overlay.dts 2026-07-02 16:55:31.716908070 +0800
@@ -653,12 +653,13 @@
};
&i2c0 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_main: sensor-main@20 {
+ status = "disabled";
compatible = "sprd,sensor-main";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -679,6 +680,7 @@
};
sensor_sub: sensor-sub@5a {
+ status = "disabled";
compatible = "sprd,sensor-sub";
reg = <0x5a>;
clock-names = "clk_src","sensor_eb",
@@ -700,12 +702,13 @@
};
&i2c1 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_main2: sensor-main2@20 {
+ status = "disabled";
compatible = "sprd,sensor-main2";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -733,6 +736,7 @@
#size-cells = <0>;
sensor_main3: sensor-main3@20 {
+ status = "disabled";
compatible = "sprd,sensor-main3";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -746,20 +750,20 @@
vddcamd-supply = <&vddcamd2>;
vddcammot-supply = <&vddcammot1>;
mot-gpios = <&ap_gpio 78 0>;
- reset-gpios = <&ap_gpio 43 0>;
+ reset-gpios = <&ap_gpio 152 0>;
sprd,phyid = <2>;/*4*/
- csi = <&csi2>;
power-domains = <&mm_domain>;
};
};
&i2c5 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_sub2: sensor-sensor_sub2@2a {
+ status = "disabled";
compatible = "sprd,sensor-sub2";
reg = <0x2a>;
clock-names = "clk_src","sensor_eb",
@@ -774,11 +778,11 @@
reset-gpios = <&ap_gpio 44 0>;
power-down-gpios = <&ap_gpio 50 0>;
sprd,phyid = <5>;
- csi = <&csi2>;
power-domains = <&mm_domain>;
};
sensor_sub3: sensor-sensor_sub3@2e {
+ status = "disabled";
compatible = "sprd,sensor-sub3";
reg = <0x2e>;
clock-names = "clk_src","sensor_eb",
@@ -793,7 +797,6 @@
reset-gpios = <&ap_gpio 43 0>;
power-down-gpios = <&ap_gpio 49 0>;
sprd,phyid = <7>;
- csi = <&csi3>;
power-domains = <&mm_domain>;
};
};
@@ -822,6 +825,30 @@
};
};
+&i2c4 {
+ status = "okay";
+ clock-frequency = <400000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ sensor_imx258_a: sensor-imx258-a@1a {
+ compatible = "sprd,sensor-main";
+ reg = <0x1a>;
+ clock-names = "clk_src","sensor_eb",
+ "clk_96m","clk_64m",
+ "clk_51m2","clk_48m","clk_26m";
+ clocks = <&mm_clk CLK_SENSOR2>,<&mm_gate CLK_SENSOR2_EN>,
+ <&g5l_pll CLK_TGPLL_96M>,<&g5l_pll CLK_TGPLL_64M>,
+ <&g5l_pll CLK_TGPLL_51M2>,<&g5l_pll CLK_TGPLL_48M>,<&ext_26m>;
+ vddio-supply = <&vddcamio>;
+ reset-gpios = <&ap_gpio 42 0>;
+ power-down-gpios = <&ap_gpio 47 0>;
+ sprd,phyid = <2>;
+ csi = <&csi2>;
+ power-domains = <&mm_domain>;
+ };
+};
+
&pdm_dmic {
status = "okay";
};
diff -ruN a/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/recovery-uis7885-2h10.dts b/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/recovery-uis7885-2h10.dts
--- a/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/recovery-uis7885-2h10.dts 2026-07-02 16:56:23.128495854 +0800
+++ b/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/recovery-uis7885-2h10.dts 2026-07-02 16:55:31.717908101 +0800
@@ -642,12 +642,13 @@
};
&i2c0 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_main: sensor-main@20 {
+ status = "disabled";
compatible = "sprd,sensor-main";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -668,6 +669,7 @@
};
sensor_sub: sensor-sub@5a {
+ status = "disabled";
compatible = "sprd,sensor-sub";
reg = <0x5a>;
clock-names = "clk_src","sensor_eb",
@@ -689,12 +691,13 @@
};
&i2c1 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_main2: sensor-main2@20 {
+ status = "disabled";
compatible = "sprd,sensor-main2";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -722,6 +725,7 @@
#size-cells = <0>;
sensor_main3: sensor-main3@20 {
+ status = "disabled";
compatible = "sprd,sensor-main3";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -735,20 +739,20 @@
vddcamd-supply = <&vddcamd2>;
vddcammot-supply = <&vddcammot1>;
mot-gpios = <&ap_gpio 78 0>;
- reset-gpios = <&ap_gpio 43 0>;
+ reset-gpios = <&ap_gpio 152 0>;
sprd,phyid = <2>;/*4*/
- csi = <&csi2>;
power-domains = <&mm_domain>;
};
};
&i2c5 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_sub2: sensor-sensor_sub2@2a {
+ status = "disabled";
compatible = "sprd,sensor-sub2";
reg = <0x2a>;
clock-names = "clk_src","sensor_eb",
@@ -763,11 +767,11 @@
reset-gpios = <&ap_gpio 44 0>;
power-down-gpios = <&ap_gpio 50 0>;
sprd,phyid = <5>;
- csi = <&csi2>;
power-domains = <&mm_domain>;
};
sensor_sub3: sensor-sensor_sub3@2e {
+ status = "disabled";
compatible = "sprd,sensor-sub3";
reg = <0x2e>;
clock-names = "clk_src","sensor_eb",
@@ -782,7 +786,6 @@
reset-gpios = <&ap_gpio 43 0>;
power-down-gpios = <&ap_gpio 49 0>;
sprd,phyid = <7>;
- csi = <&csi3>;
power-domains = <&mm_domain>;
};
};
@@ -811,6 +814,30 @@
};
};
+&i2c4 {
+ status = "okay";
+ clock-frequency = <400000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ sensor_imx258_a: sensor-imx258-a@1a {
+ compatible = "sprd,sensor-main";
+ reg = <0x1a>;
+ clock-names = "clk_src","sensor_eb",
+ "clk_96m","clk_64m",
+ "clk_51m2","clk_48m","clk_26m";
+ clocks = <&mm_clk CLK_SENSOR2>,<&mm_gate CLK_SENSOR2_EN>,
+ <&g5l_pll CLK_TGPLL_96M>,<&g5l_pll CLK_TGPLL_64M>,
+ <&g5l_pll CLK_TGPLL_51M2>,<&g5l_pll CLK_TGPLL_48M>,<&ext_26m>;
+ vddio-supply = <&vddcamio>;
+ reset-gpios = <&ap_gpio 42 0>;
+ power-down-gpios = <&ap_gpio 47 0>;
+ sprd,phyid = <2>;
+ csi = <&csi2>;
+ power-domains = <&mm_domain>;
+ };
+};
+
&pdm_dmic {
status = "okay";
};
diff -ruN a/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/uis7885-2h10-overlay.dts b/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/uis7885-2h10-overlay.dts
--- a/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/uis7885-2h10-overlay.dts 2026-07-02 16:56:23.128495854 +0800
+++ b/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/uis7885-2h10-overlay.dts 2026-07-02 16:55:31.717908101 +0800
@@ -653,12 +653,13 @@
};
&i2c0 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_main: sensor-main@20 {
+ status = "disabled";
compatible = "sprd,sensor-main";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -679,6 +680,7 @@
};
sensor_sub: sensor-sub@5a {
+ status = "disabled";
compatible = "sprd,sensor-sub";
reg = <0x5a>;
clock-names = "clk_src","sensor_eb",
@@ -700,12 +702,13 @@
};
&i2c1 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_main2: sensor-main2@20 {
+ status = "disabled";
compatible = "sprd,sensor-main2";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -733,6 +736,7 @@
#size-cells = <0>;
sensor_main3: sensor-main3@20 {
+ status = "disabled";
compatible = "sprd,sensor-main3";
reg = <0x20>;
clock-names = "clk_src","sensor_eb",
@@ -746,20 +750,20 @@
vddcamd-supply = <&vddcamd2>;
vddcammot-supply = <&vddcammot1>;
mot-gpios = <&ap_gpio 78 0>;
- reset-gpios = <&ap_gpio 43 0>;
+ reset-gpios = <&ap_gpio 152 0>;
sprd,phyid = <2>;/*4*/
- csi = <&csi2>;
power-domains = <&mm_domain>;
};
};
&i2c5 {
- status = "okay";
+ status = "disabled";
clock-frequency = <400000>;
#address-cells = <1>;
#size-cells = <0>;
sensor_sub2: sensor-sensor_sub2@2a {
+ status = "disabled";
compatible = "sprd,sensor-sub2";
reg = <0x2a>;
clock-names = "clk_src","sensor_eb",
@@ -774,11 +778,11 @@
reset-gpios = <&ap_gpio 44 0>;
power-down-gpios = <&ap_gpio 50 0>;
sprd,phyid = <5>;
- csi = <&csi2>;
power-domains = <&mm_domain>;
};
sensor_sub3: sensor-sensor_sub3@2e {
+ status = "disabled";
compatible = "sprd,sensor-sub3";
reg = <0x2e>;
clock-names = "clk_src","sensor_eb",
@@ -793,7 +797,6 @@
reset-gpios = <&ap_gpio 43 0>;
power-down-gpios = <&ap_gpio 49 0>;
sprd,phyid = <7>;
- csi = <&csi3>;
power-domains = <&mm_domain>;
};
};
@@ -822,6 +825,30 @@
};
};
+&i2c4 {
+ status = "okay";
+ clock-frequency = <400000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ sensor_imx258_a: sensor-imx258-a@1a {
+ compatible = "sprd,sensor-main";
+ reg = <0x1a>;
+ clock-names = "clk_src","sensor_eb",
+ "clk_96m","clk_64m",
+ "clk_51m2","clk_48m","clk_26m";
+ clocks = <&mm_clk CLK_SENSOR2>,<&mm_gate CLK_SENSOR2_EN>,
+ <&g5l_pll CLK_TGPLL_96M>,<&g5l_pll CLK_TGPLL_64M>,
+ <&g5l_pll CLK_TGPLL_51M2>,<&g5l_pll CLK_TGPLL_48M>,<&ext_26m>;
+ vddio-supply = <&vddcamio>;
+ reset-gpios = <&ap_gpio 42 0>;
+ power-down-gpios = <&ap_gpio 47 0>;
+ sprd,phyid = <2>;
+ csi = <&csi2>;
+ power-domains = <&mm_domain>;
+ };
+};
+
&pdm_dmic {
status = "okay";
};
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/devices/ums9620-2h10/BoardConfig.mk b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/devices/ums9620-2h10/BoardConfig.mk
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/devices/ums9620-2h10/BoardConfig.mk 2026-07-02 16:55:48.164416571 +0800
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/devices/ums9620-2h10/BoardConfig.mk 2026-07-10 15:58:00.000000000 +0800
@@ -44,32 +44,32 @@
#select camera 2M,3M,5M,8M,13M,16M,21M
CAMERA_SUPPORT_SIZE := s32
-FRONT_CAMERA_SUPPORT_SIZE := s16
-BACK_EXT_CAMERA_SUPPORT_SIZE := s16
-FRONT_EXT_CAMERA_SUPPORT_SIZE := s8
-BACK_EXT2_CAMERA_SUPPORT_SIZE := s8
+FRONT_CAMERA_SUPPORT_SIZE :=
+BACK_EXT_CAMERA_SUPPORT_SIZE :=
+FRONT_EXT_CAMERA_SUPPORT_SIZE :=
+BACK_EXT2_CAMERA_SUPPORT_SIZE :=
TARGET_BOARD_SW_GTM_SUPPORT := true
#camera sensor support list
-CAMERA_SENSOR_TYPE_BACK := "imx586,s5kgw1sp03,ov8856_back,ov08a10,ov08a10_back,ov08a10_back_sunny,ov02a10"
-CAMERA_SENSOR_TYPE_FRONT := "imx616"
+CAMERA_SENSOR_TYPE_BACK := "imx258"
+CAMERA_SENSOR_TYPE_FRONT :=
#camera dual sensor
-TARGET_BOARD_CAMERA_DUAL_SENSOR_MODULE := true
+TARGET_BOARD_CAMERA_DUAL_SENSOR_MODULE := false
#dual camera 3A sync
#TARGET_BOARD_CONFIG_CAMERA_DUAL_SYNC := true
#sensor multi-instance
#TARGET_BOARD_CAMERA_SENSOR_MULTI_INSTANCE_SUPPORT := ture
TARGET_BOARD_CAMERA_SENSOR_MULTI_INSTANCE_SUPPORT := false
#4in1
-TARGET_BOARD_CAMERA_4IN1 := true
-TARGET_BOARD_SENSOR_SS4C := true
+TARGET_BOARD_CAMERA_4IN1 := false
+TARGET_BOARD_SENSOR_SS4C := false
#tuning param support list
-TUNING_PARAM_LIST := "s5kgw1sp03_back_main,imx586_replace_back_main,ov08a10_back_tele,ov8856_back_ultrawide,ov8866_front_dual,imx616_front_main,ov02a10_back_macro"
+TUNING_PARAM_LIST := "imx586"
#4in1 ov4c
-TARGET_BOARD_SENSOR_OV4C := true
+TARGET_BOARD_SENSOR_OV4C := false
#tof
-TARGET_CAMERA_SENSOR_TOF := tof_vl53l0
+TARGET_CAMERA_SENSOR_TOF :=
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/Makefile b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/Makefile
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/Makefile 1970-01-01 08:00:00.000000000 +0800
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/Makefile 2026-07-02 16:55:31.717908101 +0800
@@ -0,0 +1,71 @@
+#
+# SPDX-FileCopyrightText: 2020-2022 Unisoc (Shanghai) Technologies Co., Ltd
+# SPDX-License-Identifier: LicenseRef-Unisoc-General-1.0
+#
+# Copyright 2022-2022 Unisoc (Shanghai) Technologies Co., Ltd.
+# Licensed under the Unisoc General Software License, version 1.0 (the License);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# https://www.unisoc.com/en_us/license/UNISOC_GENERAL_LICENSE_V1.0-EN_US
+# Software distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OF ANY KIND, either express or implied.
+# See the Unisoc General Software License, version 1.0 for more details.
+#
+CFLAGS = -Wall -g -O -fPIC
+
+LOCAL_C_INCLUDES :=
+LOCAL_SRC_DIR :=
+LOCAL_SRC_FILES :=
+LOCAL_CFLAGS :=
+
+LOCAL_PATH := $(shell pwd)
+
+PARAM_NAME := $(notdir $(LOCAL_PATH))
+
+include $(LOCAL_PATH)/../../../../../devices/$(BOARD)/BoardConfig.mk
+include $(LOCAL_PATH)/../../../../../camera.mk
+include $(LOCAL_PATH)/../../../../../SprdCtrl.mk
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../inc \
+ $(LOCAL_PATH)/../../../../../$(OEM_DIR)/inc \
+ $(LOCAL_PATH)/../../../../../common/inc \
+ $(LOCAL_PATH)/../../../../../$(ISPDRV_DIR)/isp_tune \
+ $(LOCAL_PATH)/../../../../../$(ISPALG_DIR)/common/inc \
+ $(LOCAL_PATH)/../../../../../$(ISPDRV_DIR)/middleware/inc \
+ $(LOCAL_PATH)/../../../../../$(ISPDRV_DIR)/driver/inc \
+ $(LOCAL_PATH)/../../../../../KIface \
+ $(LOCAL_PATH)/../../../../../KIface/interface \
+ $(LOCAL_PATH)/../../../../../utils/camxmlparser/inc/libxml2 \
+ $(LOCAL_PATH)/../../../../../libcaminiparser
+
+
+LOCAL_SRC_FILES := sensor_imx258_mipi_raw.c
+
+ifeq (1, $(strip $(shell expr $(ANDROID_MAJOR_VER) \>= 8)))
+LOCAL_PROPRIETARY_MODULE := true
+endif
+
+INCLUDE_DIRS = $(addprefix -I , $(LOCAL_C_INCLUDES))
+
+OBJS = $(notdir $(patsubst %.c,%.o,$(LOCAL_SRC_FILES)))
+
+LIBS = -lpthread -lcamcommon -lcamsensor -lcamxmlparser
+
+SRCS = $(LOCAL_SRC_FILES)
+
+TARGET := libsensor_$(PARAM_NAME).so
+
+CFLAGS += $(LOCAL_CFLAGS)
+
+all:$(OBJS)
+ $(CC) -shared -fPIC -o $(TARGET) $(OBJS) $(LIBS)
+
+$(OBJS):$(SRCS)
+ $(CC) $(CFLAGS) $(INCLUDE_DIRS) -c $^
+
+install:
+ cp $(TARGET) $(INSTALL_MOD_PATH)/usr/lib
+
+clean:
+ rm -f *.o
+ rm -f $(TARGET)
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h 2026-07-02 16:55:48.164416571 +0800
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h 2026-07-02 16:55:31.717908101 +0800
@@ -16,7 +16,7 @@
#define VENDOR_NUM 3
-#include <utils/Log.h>
+//#include <utils/Log.h>
#include "sensor.h"
#include "jpeg_exif_header.h"
#include "sensor_drv_u.h"
@@ -24,11 +24,7 @@
#include "sensor_raw.h"
#define SENSOR_NAME "imx258_mipi_raw"
-#ifdef CAMERA_SENSOR_BACK_I2C_SWITCH
-#define I2C_SLAVE_ADDR 0x20
-#else
#define I2C_SLAVE_ADDR 0x34
-#endif
#define BINNING_FACTOR 2
#define imx258_PID_ADDR 0x0016
@@ -865,7 +861,7 @@
{.module_id = MODULE_TRULY,
.module_info = {
.major_i2c_addr = 0x34 >> 1,
- .minor_i2c_addr = 0x20 >> 1,
+ .minor_i2c_addr = 0x34 >> 1,
.i2c_burst_mode = SENSOR_I2C_BURST_REG16_VAL8,
@@ -904,7 +900,7 @@
{.module_id = MODULE_SUNNY,
.module_info = {
.major_i2c_addr = 0x34 >> 1,
- .minor_i2c_addr = 0x20 >> 1,
+ .minor_i2c_addr = 0x34 >> 1,
.reg_addr_value_bits = SENSOR_I2C_REG_16BIT | SENSOR_I2C_VAL_8BIT |
SENSOR_I2C_FREQ_400,
@@ -940,8 +936,8 @@
}},
{.module_id = MODULE_DARLING,
.module_info = {
- .major_i2c_addr = 0x20 >> 1,
- .minor_i2c_addr = 0x20 >> 1,
+ .major_i2c_addr = 0x34 >> 1,
+ .minor_i2c_addr = 0x34 >> 1,
.reg_addr_value_bits = SENSOR_I2C_REG_16BIT | SENSOR_I2C_VAL_8BIT |
SENSOR_I2C_FREQ_400,
diff -ruN a/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/sprd_uis7885_defconfig b/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/sprd_uis7885_defconfig
--- a/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/sprd_uis7885_defconfig
+++ b/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/sprd_uis7885_defconfig
@@ -2428,7 +2428,7 @@
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
-# CONFIG_I2C_CHARDEV is not set
+CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_MUX is not set
# CONFIG_I2C_HELPER_AUTO is not set
# CONFIG_I2C_SMBUS is not set
diff -ruN a/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/recovery_uis7885_defconfig b/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/recovery_uis7885_defconfig
--- a/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/recovery_uis7885_defconfig
+++ b/source_sync_rls_25c/layers/meta-unisoc/recipes-kernel/linux/linux-unisoc-5.4/uis7885/recovery_uis7885_defconfig
@@ -2428,7 +2428,7 @@
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
-# CONFIG_I2C_CHARDEV is not set
+CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_MUX is not set
# CONFIG_I2C_HELPER_AUTO is not set
# CONFIG_I2C_SMBUS is not set
diff -ruN a/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/configs/sprd_uis7885_defconfig b/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/configs/sprd_uis7885_defconfig
--- a/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/configs/sprd_uis7885_defconfig
+++ b/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/configs/sprd_uis7885_defconfig
@@ -2428,7 +2428,7 @@
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
-# CONFIG_I2C_CHARDEV is not set
+CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_MUX is not set
# CONFIG_I2C_HELPER_AUTO is not set
# CONFIG_I2C_SMBUS is not set
diff -ruN a/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/configs/recovery_uis7885_defconfig b/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/configs/recovery_uis7885_defconfig
--- a/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/configs/recovery_uis7885_defconfig
+++ b/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/configs/recovery_uis7885_defconfig
@@ -2428,7 +2428,7 @@
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
-# CONFIG_I2C_CHARDEV is not set
+CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_MUX is not set
# CONFIG_I2C_HELPER_AUTO is not set
# CONFIG_I2C_SMBUS is not set
diff -ruN a/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/ump9620.dtsi b/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/ump9620.dtsi
--- a/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/ump9620.dtsi
+++ b/source_sync_rls_25c/source/kernel/kernel5.4/arch/arm64/boot/dts/sprd/ump9620.dtsi
@@ -482,6 +482,7 @@
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1830000>;
regulator-ramp-delay = <25000>;
+ regulator-always-on;
};
vddwcn: LDO_VDDWCN {
diff -ruN a/source_sync_rls_25c/layers/meta-unisoc/recipes-core/images/unisoc-wayland-image.bb b/source_sync_rls_25c/layers/meta-unisoc/recipes-core/images/unisoc-wayland-image.bb
--- a/source_sync_rls_25c/layers/meta-unisoc/recipes-core/images/unisoc-wayland-image.bb
+++ b/source_sync_rls_25c/layers/meta-unisoc/recipes-core/images/unisoc-wayland-image.bb
@@ -6,5 +6,6 @@
CORE_IMAGE_BASE_INSTALL += " \
packagegroup-unisoc-wayland \
+ i2c-tools \
${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'packagegroup-core-selinux', '', d)} \
"
inherit ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux-image', '', d)}
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
@@ -219,8 +219,8 @@
struct cmr_zoom_param zoom_param;
struct cmr_range_fps_param fps_param;
mZslCaptureExitLoop = false;
- mSprdZslEnabled = true;
- mCaptureMode = CAMERA_ZSL_MODE; // CAMERA_NORMAL_MODE
+ mSprdZslEnabled = false;
+ mCaptureMode = CAMERA_NORMAL_MODE;
memset(&zoom_param, 0, sizeof(struct cmr_zoom_param));
if (mOemUT_cxt == NULL) {
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.c
@@ -727,6 +727,8 @@
* please modify this function acording your spec
*============================================================================*/
static cmr_int imx258_drv_stream_on(cmr_handle handle, cmr_uint param) {
+ cmr_u32 stream_state = 0;
+
UNUSED(param);
SENSOR_IC_CHECK_HANDLE(handle);
@@ -750,6 +752,9 @@
#endif
hw_sensor_write_reg(sns_drv_cxt->hw_handle, 0x0100, 0x01);
+ usleep(5 * 1000);
+ stream_state = hw_sensor_read_reg(sns_drv_cxt->hw_handle, 0x0100);
+ SENSOR_LOGI("stream_on 0x0100=0x%x", stream_state);
return 0;
}
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
@@ -298,45 +298,31 @@ int OemUnitTest::zslSnapshot() {
int ret = CMR_CAMERA_SUCCESS;
- mCaptureMode = CAMERA_ZSL_MODE;
-
- // if not , start Preview
+
+ /*
+ * ZSL is disabled on the current single-camera SBC bring-up path. Keep the
+ * command useful by capturing preview dumps instead of entering the phone ZSL
+ * snapshot flow.
+ */
+ CMR_LOGI("zslSnapshot: capture preview dump");
+ printf("OemUnitTest zslSnapshot preview-dump mode\n");
+
+ camera_dump_cnt_pre = 0;
+ dump_total_count = 5;
+ mCaptureMode = CAMERA_NORMAL_MODE;
+ mSprdZslEnabled = false;
+
if (!isPreviewing()) {
ret = startPreview();
if (ret) {
- CMR_LOGE("When zslSnapshot, fail to start Preview");
+ CMR_LOGE("zslSnapshot: fail to start preview dump");
return ret;
}
}
- std::unique_lock<std::mutex> lck(mLock);
-
- // WAIT CAPTURE DONE
- if (isCapturing()) {
- WaitForCaptureDone();
- }
-
- SET_PARM(mOem, mCameraHandle, CAMERA_PARAM_SHOT_NUM, mPicCaptureCnt);
- SET_PARM(mOem, mCameraHandle, CAMERA_PARAM_EXIF_MIME_TYPE,
- MODE_SINGLE_CAMERA);
-
- struct img_size thumbnail_size = {0, 0};
- SET_PARM(mOem, mCameraHandle, CAMERA_PARAM_THUMB_SIZE,
- (cmr_uint)&thumbnail_size);
-
- ret = mOem->ops->camera_take_picture(mCameraHandle, mCaptureMode);
- if (ret) {
- setCameraState(SPRD_ERROR, STATE_CAPTURE);
- CMR_LOGE("fail to camera_take_picture");
- goto exit;
- }
-
- ret = snapshot_zsl();
-
-exit:
- CMR_LOGD("X");
- return ret;
+ usleep(1000 * 1000);
+ printf("OemUnitTest zslSnapshot preview-dump saved %d frame(s)\n",
+ camera_dump_cnt_pre);
+
+ return CMR_CAMERA_SUCCESS;
}
@@ -770,6 +775,8 @@
value = hw_sensor_read_reg(sns_drv_cxt->hw_handle, 0x0100);
if (value != 0x00) {
hw_sensor_write_reg(sns_drv_cxt->hw_handle, 0x0100, 0x00);
+ value = hw_sensor_read_reg(sns_drv_cxt->hw_handle, 0x0100);
+ SENSOR_LOGI("stream_off 0x0100=0x%x", value);
if (!sns_drv_cxt->is_sensor_close) {
sleep_time = (sns_drv_cxt->sensor_ev_info.preview_framelength *
sns_drv_cxt->line_time_def / 1000000) + 10;
@@ -778,6 +785,7 @@
}
} else {
hw_sensor_write_reg(sns_drv_cxt->hw_handle, 0x0100, 0x00);
+ SENSOR_LOGI("stream_off already stopped, 0x0100=0x%x", value);
}
sns_drv_cxt->is_sensor_close = 0;
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h
@@ -802,21 +802,48 @@
static SENSOR_TRIM_T s_imx258_resolution_trim_tab[VENDOR_NUM] = {
{.module_id = MODULE_TRULY,
- .trim_info = {{0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}},
- /* {0,0, 1040, 768,10325,1296, 812, { 0,0,1040,768}},*/
- {0, 0, 1280, 720, 13939, 960, 796, {0, 0, 1280, 720}},
- {0, 0, 2096, 1552, 20300, 1296, 1644, {0, 0, 2096, 1552}},
- {0, 0, 4208, 3120, 10215, 1296, 3224, {0, 0, 4208, 3120}}}},
+ .trim_info = {{0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}},
+ /* {0, 0, 1040, 768, 10325, 1296, 812, {0, 0, 1040, 768}}, */
+ {.trim_width = 1280, .trim_height = 720,
+ .line_time = 13939, .bps_per_lane = PREVIEW_MIPI_PER_LANE_BPS,
+ .frame_line = 796, .scaler_trim = {0, 0, 1280, 720}},
+ {.trim_width = 2096, .trim_height = 1552,
+ .line_time = 20300, .bps_per_lane = PREVIEW_MIPI_PER_LANE_BPS,
+ .frame_line = 1644, .scaler_trim = {0, 0, 2096, 1552}},
+ {.trim_width = 4208, .trim_height = 3120,
+ .line_time = 10215, .bps_per_lane = SNAPSHOT_MIPI_PER_LANE_BPS,
+ .frame_line = 3224, .scaler_trim = {0, 0, 4208, 3120}}}},
{.module_id = MODULE_SUNNY,
- .trim_info = {{0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}},
- /* {0,0, 1040, 768,10325,1296, 812, { 0,0,1040,768}},*/
- {0, 0, 1280, 720, 13939, 960, 796, {0, 0, 1280, 720}},
- {0, 0, 2080,1560, 20650, 336,1612, {0, 0, 2080, 1560}},
- {0, 0, 4160,3120, 10568,1158,3152, {0, 0, 4160, 3120}}}},
+ .trim_info = {{0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}},
+ /* {0, 0, 1040, 768, 10325, 1296, 812, {0, 0, 1040, 768}}, */
+ {.trim_width = 1280, .trim_height = 720,
+ .line_time = 13939, .bps_per_lane = PREVIEW_MIPI_PER_LANE_BPS,
+ .frame_line = 796, .scaler_trim = {0, 0, 1280, 720}},
+ {.trim_width = 2080, .trim_height = 1560,
+ .line_time = 20650, .bps_per_lane = PREVIEW_MIPI_PER_LANE_BPS,
+ .frame_line = 1612, .scaler_trim = {0, 0, 2080, 1560}},
+ {.trim_width = 4160, .trim_height = 3120,
+ .line_time = 10568, .bps_per_lane = SNAPSHOT_MIPI_PER_LANE_BPS,
+ .frame_line = 3152, .scaler_trim = {0, 0, 4160, 3120}}}},
{.module_id = MODULE_DARLING,
- .trim_info = {{0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}},
- /* {0,0, 1040, 768,10325,1296, 812, { 0,0,1040,768}},*/
- {0, 0, 1280, 720, 13939, 960, 796, {0, 0, 1280, 720}},
- {0, 0, 2096, 1552, 20300, 1296, 1644, {0, 0, 2096, 1552}},
- {0, 0, 4208, 3120, 10215, 1296, 3224, {0, 0, 4208, 3120}}}},
+ .trim_info = {{0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}},
+ /* {0, 0, 1040, 768, 10325, 1296, 812, {0, 0, 1040, 768}}, */
+ {.trim_width = 1280, .trim_height = 720,
+ .line_time = 13939, .bps_per_lane = PREVIEW_MIPI_PER_LANE_BPS,
+ .frame_line = 796, .scaler_trim = {0, 0, 1280, 720}},
+ {.trim_width = 2096, .trim_height = 1552,
+ .line_time = 20300, .bps_per_lane = PREVIEW_MIPI_PER_LANE_BPS,
+ .frame_line = 1644, .scaler_trim = {0, 0, 2096, 1552}},
+ {.trim_width = 4208, .trim_height = 3120,
+ .line_time = 10215, .bps_per_lane = SNAPSHOT_MIPI_PER_LANE_BPS,
+ .frame_line = 3224, .scaler_trim = {0, 0, 4208, 3120}}}},
};
diff -ruN a/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/libcam-sensor-drv_0.0.1.bb b/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/libcam-sensor-drv_0.0.1.bb
--- a/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/libcam-sensor-drv_0.0.1.bb
+++ b/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/libcam-sensor-drv_0.0.1.bb
@@ -70,12 +70,18 @@
install -m 0777 ${S}/classic/Cista/sc031gs_dual/*.so ${D}${libdir}/
fi
if [ ${CAMERA_BOARD} = "ums9620-2h10" ] ; then
- install -m 0777 ${S}/classic/Sony/imx586/*.so ${D}${libdir}/
- install -m 0777 ${S}/classic/Sony/imx616/*.so ${D}${libdir}/
- install -m 0777 ${S}/classic/Samsung/s5kgw1sp03/*.so ${D}${libdir}/
- install -m 0777 ${S}/classic/OmniVision/ov08a10/*.so ${D}${libdir}/
- install -m 0777 ${S}/classic/OmniVision/ov08a10_back/*.so ${D}${libdir}/
- install -m 0777 ${S}/classic/OmniVision/ov08a10_back_sunny/*.so ${D}${libdir}/
- install -m 0777 ${S}/classic/OmniVision/ov8856_back/*.so ${D}${libdir}/
- install -m 0777 ${S}/classic/OmniVision/ov02a10/*.so ${D}${libdir}/
+ for sensor_lib in \
+ ${S}/classic/Sony/imx258/*.so \
+ ${S}/classic/Sony/imx586/*.so \
+ ${S}/classic/Sony/imx616/*.so \
+ ${S}/classic/Samsung/s5kgw1sp03/*.so \
+ ${S}/classic/OmniVision/ov08a10/*.so \
+ ${S}/classic/OmniVision/ov08a10_back/*.so \
+ ${S}/classic/OmniVision/ov08a10_back_sunny/*.so \
+ ${S}/classic/OmniVision/ov8856_back/*.so \
+ ${S}/classic/OmniVision/ov02a10/*.so; do
+ if [ -e "$sensor_lib" ]; then
+ install -m 0777 "$sensor_lib" ${D}${libdir}/
+ fi
+ done
fi
diff -ruN a/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/files/ini-init.sh b/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/files/ini-init.sh
--- a/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/files/ini-init.sh
+++ b/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/files/ini-init.sh
@@ -1,4 +1,9 @@
-cp /etc/cam_ini/camera_property.ini /home/user
+mkdir -p /home/user
+cp /etc/cam_ini/camera_property.ini /home/user/camera_property.ini
+chmod 0644 /home/user/camera_property.ini
+if command -v chcon >/dev/null 2>&1; then
+ chcon --reference=/etc/cam_ini/camera_property.ini /home/user/camera_property.ini || true
+fi
if ! [ -e /home/user/dump ]; then
mkdir /home/user/dump
fi
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/libcaminiparser/cmr_property.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/libcaminiparser/cmr_property.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/libcaminiparser/cmr_property.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/libcaminiparser/cmr_property.c
@@ -1,10 +1,12 @@
#include "cmr_property.h"
#define CMR_INI_DIR_PATH "/home/user/camera_property.ini"
+#define CMR_INI_FALLBACK_PATH "/etc/cam_ini/camera_property.ini"
#if CAM_YOCTO
#include "iniparser.h"
#include <ctype.h>
static dictionary* cmr_ini;
+static const char* cmr_ini_path = CMR_INI_DIR_PATH;
#define ASCIILINESZ (1024)
#define INI_INVALID_KEY ((char*)-1)
#define CMR_INI (cmr_ini)
@@ -12,6 +14,11 @@
int property_parser_init() {
- cmr_ini = iniparser_load(CMR_INI_DIR_PATH);
+ cmr_ini_path = CMR_INI_DIR_PATH;
+ cmr_ini = iniparser_load(cmr_ini_path);
+ if (cmr_ini == NULL) {
+ cmr_ini_path = CMR_INI_FALLBACK_PATH;
+ cmr_ini = iniparser_load(cmr_ini_path);
+ }
if (cmr_ini == NULL) {
return -1;
}
@@ -68,7 +75,9 @@
if(iniparser_set(cmr_ini, section, def)!=0)
return -1 ;
- FILE *ini_file = fopen(CMR_INI_DIR_PATH, "w");
+ FILE *ini_file = fopen(cmr_ini_path, "w");
+ if (ini_file == NULL)
+ return -1;
iniparser_dump_ini(cmr_ini, ini_file);
fclose(ini_file);
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.c
@@ -291,22 +291,24 @@
SENSOR_LOGI("(1:on, 0:off): %ld", power_on);
if (SENSOR_TRUE == power_on) {
+ hw_sensor_power_down(sns_drv_cxt->hw_handle, power_down);
hw_sensor_set_reset_level(sns_drv_cxt->hw_handle, reset_level);
hw_sensor_set_mclk(sns_drv_cxt->hw_handle, SENSOR_DISABLE_MCLK);
- hw_sensor_set_voltage(sns_drv_cxt->hw_handle, SENSOR_AVDD_CLOSED,
- SENSOR_AVDD_CLOSED, SENSOR_AVDD_CLOSED);
- usleep(1 * 1000);
- hw_sensor_set_voltage(sns_drv_cxt->hw_handle, dvdd_val, avdd_val,
- iovdd_val);
+ hw_sensor_set_iovdd_val(sns_drv_cxt->hw_handle, SENSOR_AVDD_CLOSED);
+ usleep(2 * 1000);
+ hw_sensor_set_iovdd_val(sns_drv_cxt->hw_handle, iovdd_val);
usleep(1 * 1000);
- hw_sensor_set_mclk(sns_drv_cxt->hw_handle, SENSOR_DEFALUT_MCLK);
- usleep(1 * 1000);
+ hw_sensor_set_mclk(sns_drv_cxt->hw_handle, EX_MCLK);
+ hw_sensor_power_down(sns_drv_cxt->hw_handle, !power_down);
hw_sensor_set_reset_level(sns_drv_cxt->hw_handle, !reset_level);
+ usleep(5 * 1000);
} else {
hw_sensor_set_reset_level(sns_drv_cxt->hw_handle, reset_level);
+ hw_sensor_power_down(sns_drv_cxt->hw_handle, power_down);
+ usleep(1 * 1000);
hw_sensor_set_mclk(sns_drv_cxt->hw_handle, SENSOR_DISABLE_MCLK);
- hw_sensor_set_voltage(sns_drv_cxt->hw_handle, SENSOR_AVDD_CLOSED,
- SENSOR_AVDD_CLOSED, SENSOR_AVDD_CLOSED);
+ usleep(1 * 1000);
+ hw_sensor_set_iovdd_val(sns_drv_cxt->hw_handle, SENSOR_AVDD_CLOSED);
}
SENSOR_LOGI("(1:on, 0:off): %ld", power_on);
return SENSOR_SUCCESS;
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/ubuntu/n6pro/tmp/etc/sensor_config.xml b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/ubuntu/n6pro/tmp/etc/sensor_config.xml
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/ubuntu/n6pro/tmp/etc/sensor_config.xml 2026-07-02 16:55:48.164416571 +0800
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/ubuntu/n6pro/tmp/etc/sensor_config.xml 2026-07-10 15:58:00.000000000 +0800
@@ -1,152 +1,12 @@
<root>
- <!-->
- sensor id 0
- <-->
<CameraModuleCfg>
<SlotId>0</SlotId>
- <SensorName>s5kgw1sp03</SensorName>
+ <SensorName>imx258</SensorName>
<Facing>BACK</Facing>
<Orientation>90</Orientation>
- <Resource_cost>55</Resource_cost>
- <SensorRole>dualcam_master</SensorRole>
- <SensorRole>multicam_wide</SensorRole>
- <ConflictingDevice>1</ConflictingDevice>
- <VCM>
- <AfName>lc898219</AfName>
- <Mode>0</Mode>
- </VCM>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa0</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>16384</E2promSize>
- </E2prom>
- </OTP>
+ <Resource_cost>100</Resource_cost>
<TuningParameter>
- <TuningName>s5kgw1sp03_back_main</TuningName>
- </TuningParameter>
- </CameraModuleCfg>
- <CameraModuleCfg>
- <SlotId>0</SlotId>
- <SensorName>imx586</SensorName>
- <Facing>BACK</Facing>
- <Orientation>90</Orientation>
- <Resource_cost>55</Resource_cost>
- <SensorRole>dualcam_master</SensorRole>
- <SensorRole>multicam_wide</SensorRole>
- <ConflictingDevice>1</ConflictingDevice>
- <VCM>
- <AfName>lc898229</AfName>
- <Mode>0</Mode>
- </VCM>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa0</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>16384</E2promSize>
- </E2prom>
- </OTP>
- <TuningParameter>
<TuningName>imx586</TuningName>
</TuningParameter>
- </CameraModuleCfg>
- <!-->
- sensor id 1
- <-->
- <CameraModuleCfg>
- <SlotId>1</SlotId>
- <SensorName>imx616</SensorName>
- <Facing>FRONT</Facing>
- <Orientation>270</Orientation>
- <Resource_cost>100</Resource_cost>
- <TuningParameter>
- <TuningName>imx616</TuningName>
- </TuningParameter>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa2</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>16384</E2promSize>
- </E2prom>
- </OTP>
- </CameraModuleCfg>
- <!-->
- sensor id 2
- <-->
- <CameraModuleCfg>
- <SlotId>2</SlotId>
- <SensorName>ov8856_back</SensorName>
- <Facing>BACK</Facing>
- <Orientation>90</Orientation>
- <Resource_cost>45</Resource_cost>
- <SensorRole>dualcam_slave</SensorRole>
- <SensorRole>multicam_superwide</SensorRole>
- <TuningParameter>
- <TuningName>ov8856_back_ultrawide</TuningName>
- </TuningParameter>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa4</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>8192</E2promSize>
- </E2prom>
- </OTP>
- </CameraModuleCfg>
- <!-->
- sensor id 4
- <-->
- <CameraModuleCfg>
- <SlotId>4</SlotId>
- <SensorName>ov08a10_back_sunny</SensorName>
- <Facing>BACK</Facing>
- <Orientation>90</Orientation>
- <Resource_cost>0</Resource_cost>
- <SensorRole>multicam_tele</SensorRole>
- <VCM>
- <AfName>dw9781b</AfName>
- <Mode>0</Mode>
- </VCM>
- <OIS>
- <OISName>dw9781b</OISName>
- <Mode>0</Mode>
- </OIS>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa6</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>16384</E2promSize>
- </E2prom>
- </OTP>
- <TuningParameter>
- <TuningName>ov08a10_back_sunny</TuningName>
- </TuningParameter>
- </CameraModuleCfg>
- <CameraModuleCfg>
- <SlotId>4</SlotId>
- <SensorName>ov08a10_back</SensorName>
- <Facing>BACK</Facing>
- <Orientation>90</Orientation>
- <Resource_cost>0</Resource_cost>
- <SensorRole>multicam_tele</SensorRole>
- <VCM>
- <AfName>dw9800</AfName>
- <Mode>0</Mode>
- </VCM>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa6</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>16384</E2promSize>
- </E2prom>
- </OTP>
- <TuningParameter>
- <TuningName>ov08a10</TuningName>
- </TuningParameter>
- </CameraModuleCfg>
- </root>
+ </CameraModuleCfg>
+</root>
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
@@ -1,5 +1,6 @@
#define LOG_TAG "OemUnitTest"
#include "OemUnitTest.h"
+#include <stdio.h>
#define OEM_LIBRARY_PATH "libcamoem.so"
#define CAMERA_MIN_FPS 5
@@ -286,6 +286,7 @@ int OemUnitTest::startPreview() {
setCameraState(SPRD_INTERNAL_PREVIEW_REQUESTED, STATE_PREVIEW);
ret = mOem->ops->camera_start_preview(mCameraHandle, mCaptureMode);
+ printf("OemUnitTest camera_start_preview ret=%d\n", ret);
if (ret) {
CMR_LOGE("camera_start_preview failed");
setCameraState(SPRD_ERROR, STATE_PREVIEW);
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/SprdOEMCamera.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/SprdOEMCamera.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/SprdOEMCamera.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/SprdOEMCamera.c
@@ -110,7 +110,9 @@ cmr_int camera_start_preview(cmr_handle camera_handle,
goto exit;
}
+ CMR_LOGE("imx258_debug camera_start_preview enter mode %d", mode);
ret = camera_local_start_preview(camera_handle, mode, 0);
+ CMR_LOGE("imx258_debug camera_start_preview ret %ld", ret);
if (ret) {
CMR_LOGE("failed to start preview %ld", ret);
}
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
@@ -11735,6 +11735,9 @@ cmr_int camera_local_start_preview(cmr_handle oem_handle,
int64_t testVal = 60;
struct img_size sn_size;
+ CMR_LOGE("imx258_debug camera_local_start_preview enter mode %d snapshot %ld camera_id %d",
+ mode, is_snapshot, cxt->camera_id);
+
//check camera_res_init_done
pthread_mutex_lock(&close_mutex);
if(cxt->need_wait_init_done_flag) {
@@ -11771,6 +11774,7 @@ cmr_int camera_local_start_preview(cmr_handle oem_handle,
}
ret = camera_set_preview_param(oem_handle, mode, is_snapshot);
+ CMR_LOGE("imx258_debug camera_set_preview_param ret %ld", ret);
if (ret) {
CMR_LOGE("failed to set prev param %ld", ret);
goto exit;
@@ -11802,6 +11806,7 @@ cmr_int camera_local_start_preview(cmr_handle oem_handle,
SETTING_SET_ENVIRONMENT, &setting_param);
ret = cmr_preview_start(prev_cxt->preview_handle, cxt->camera_id);
+ CMR_LOGE("imx258_debug cmr_preview_start ret %ld", ret);
if (ret) {
CMR_LOGE("failed to start prev %ld", ret);
}
@@ -11837,6 +11842,7 @@ cmr_int camera_local_start_preview(cmr_handle oem_handle,
cmr_snapshot_set_param_prepare(cxt->snp_cxt.snapshot_handle, &snp_param);
exit:
+ CMR_LOGE("imx258_debug camera_local_start_preview exit ret %ld", ret);
return ret;
}
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/SprdOEMCamera.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/SprdOEMCamera.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/SprdOEMCamera.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/SprdOEMCamera.c
@@ -13,6 +13,7 @@
#define LOG_TAG "OEMCam"
+#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
@@ -110,8 +111,10 @@ cmr_int camera_start_preview(cmr_handle camera_handle,
goto exit;
}
+ printf("imx258_debug camera_start_preview enter mode %d\n", mode);
CMR_LOGE("imx258_debug camera_start_preview enter mode %d", mode);
ret = camera_local_start_preview(camera_handle, mode, 0);
+ printf("imx258_debug camera_start_preview ret %ld\n", ret);
CMR_LOGE("imx258_debug camera_start_preview ret %ld", ret);
if (ret) {
CMR_LOGE("failed to start preview %ld", ret);
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
@@ -14,6 +14,7 @@
#define LOG_TAG "cmr_oem"
#define _GNU_SOURCE
+#include <stdio.h>
#include <sched.h>
#include <sys/resource.h>
#include <sys/types.h>
@@ -11735,6 +11736,8 @@ cmr_int camera_local_start_preview(cmr_handle oem_handle,
int64_t testVal = 60;
struct img_size sn_size;
+ printf("imx258_debug camera_local_start_preview enter mode %d snapshot %ld camera_id %d\n",
+ mode, is_snapshot, cxt->camera_id);
CMR_LOGE("imx258_debug camera_local_start_preview enter mode %d snapshot %ld camera_id %d",
mode, is_snapshot, cxt->camera_id);
@@ -11774,6 +11777,7 @@ cmr_int camera_local_start_preview(cmr_handle oem_handle,
}
ret = camera_set_preview_param(oem_handle, mode, is_snapshot);
+ printf("imx258_debug camera_set_preview_param ret %ld\n", ret);
CMR_LOGE("imx258_debug camera_set_preview_param ret %ld", ret);
if (ret) {
CMR_LOGE("failed to set prev param %ld", ret);
@@ -11806,6 +11810,7 @@ cmr_int camera_local_start_preview(cmr_handle oem_handle,
SETTING_SET_ENVIRONMENT, &setting_param);
ret = cmr_preview_start(prev_cxt->preview_handle, cxt->camera_id);
+ printf("imx258_debug cmr_preview_start ret %ld\n", ret);
CMR_LOGE("imx258_debug cmr_preview_start ret %ld", ret);
if (ret) {
CMR_LOGE("failed to start prev %ld", ret);
@@ -11842,6 +11847,7 @@ cmr_int camera_local_start_preview(cmr_handle oem_handle,
exit:
+ printf("imx258_debug camera_local_start_preview exit ret %ld\n", ret);
CMR_LOGE("imx258_debug camera_local_start_preview exit ret %ld", ret);
return ret;
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
@@ -14,6 +14,7 @@
#define LOG_TAG "cmr_prev"
#define _GNU_SOURCE
+#include <stdio.h>
#include <sched.h>
#include <sys/resource.h>
#include <sys/types.h>
@@ -3534,6 +3535,10 @@ cmr_int prev_start(struct prev_handle *handle, cmr_u32 camera_id,
snapshot_enable = prev_cxt->prev_param.snapshot_eb;
video_enable = prev_cxt->prev_param.video_eb;
tool_eb = prev_cxt->prev_param.tool_eb;
+ printf("imx258_debug prev_start camera_id %d, prev_status %ld, preview_eb %d, snapshot_eb %d, "
+ "video_enable %d, need_isp %d, pdaf_type %d, work_mode %ld\n",
+ camera_id, prev_cxt->prev_status, preview_enable, snapshot_enable,
+ video_enable, prev_cxt->need_isp, pdaf_type, work_mode);
CMR_LOGE("imx258_debug prev_start camera_id %d, prev_status %ld, preview_eb %d, snapshot_eb %d, "
"video_enable %d, need_isp %d, pdaf_type %d, work_mode %ld",
camera_id, prev_cxt->prev_status, preview_enable, snapshot_enable,
@@ -3624,6 +3629,10 @@ cmr_int prev_start(struct prev_handle *handle, cmr_u32 camera_id,
isp_param.remosaic_type = prev_cxt->prev_param.remosaic_type;
ret = handle->ops.isp_start_video(handle->oem_handle, &isp_param);
+ printf("imx258_debug isp_start_video ret %ld, isp_size %d x %d, dcam_size %d x %d, zsl %d\n",
+ ret, isp_param.size.width, isp_param.size.height,
+ isp_param.dcam_size.width, isp_param.dcam_size.height,
+ isp_param.sprd_zsl_flag);
CMR_LOGE("imx258_debug isp_start_video ret %ld, isp_size %d x %d, dcam_size %d x %d, zsl %d",
ret, isp_param.size.width, isp_param.size.height,
isp_param.dcam_size.width, isp_param.dcam_size.height,
@@ -3656,6 +3665,8 @@ cmr_int prev_start(struct prev_handle *handle, cmr_u32 camera_id,
skip_num = prev_cxt->sensor_info.mipi_cap_skip_num;
CMR_LOGD("channel_bits %d, skip_num %ld", channel_bits, skip_num);
ret = handle->ops.channel_start(handle->oem_handle, channel_bits, skip_num);
+ printf("imx258_debug channel_start ret %ld, channel_bits 0x%x, skip_num %ld\n",
+ ret, channel_bits, skip_num);
CMR_LOGE("imx258_debug channel_start ret %ld, channel_bits 0x%x, skip_num %ld",
ret, channel_bits, skip_num);
if (ret) {
@@ -3734,6 +3745,7 @@ exit:
}
+ printf("imx258_debug prev_start exit ret %ld\n", ret);
CMR_LOGE("imx258_debug prev_start exit ret %ld", ret);
return ret;
}
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
@@ -10435,6 +10435,13 @@ cmr_int camera_set_preview_param(cmr_handle oem_handle,
cmr_bzero(&start_param, sizeof(struct preview_param));
ret = camera_get_preview_param(oem_handle, mode, is_snapshot, &start_param);
+ printf("imx258_debug camera_get_preview_param ret %ld, preview %d x %d eb %d, video %d x %d eb %d, snapshot %d x %d eb %d, zsl %d\n",
+ ret, start_param.preview_size.width, start_param.preview_size.height,
+ start_param.preview_eb, start_param.video_size.width,
+ start_param.video_size.height, start_param.video_eb,
+ start_param.picture_size.width, start_param.picture_size.height,
+ start_param.snapshot_eb, start_param.sprd_zsl_enabled);
if (ret) {
CMR_LOGE("failed to get prev param %ld", ret);
goto exit;
@@ -10450,6 +10457,9 @@ cmr_int camera_set_preview_param(cmr_handle oem_handle,
cmr_bzero(&preview_out, sizeof(struct preview_out_param));
ret = cmr_preview_set_param(prev_cxt->preview_handle, cxt->camera_id,
&start_param, &preview_out);
+ printf("imx258_debug cmr_preview_set_param ret %ld, preview_chn %d sn_mode %d, snapshot_chn %d sn_mode %d\n",
+ ret, preview_out.preview_chn_id, preview_out.preview_sn_mode,
+ preview_out.snapshot_chn_id, preview_out.snapshot_sn_mode);
if (ret) {
CMR_LOGE("failed to set prev param %ld", ret);
goto exit;
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
@@ -7136,6 +7136,13 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
handle->prev_cxt[camera_id].prev_param.tool_eb,
handle->prev_cxt[camera_id].prev_status);
+ printf("imx258_debug prev_set_param_internal enter camera_id %ld, preview_eb %d, snapshot_eb %d, video_eb %d, "
+ "tool_eb %d, prev_status %ld\n",
+ handle->prev_cxt[camera_id].camera_id,
+ handle->prev_cxt[camera_id].prev_param.preview_eb,
+ handle->prev_cxt[camera_id].prev_param.snapshot_eb,
+ handle->prev_cxt[camera_id].prev_param.video_eb,
+ handle->prev_cxt[camera_id].prev_param.tool_eb,
+ handle->prev_cxt[camera_id].prev_status);
CMR_LOGD("camera_id %ld, preview_eb %d, snapshot_eb %d, video_eb %d, "
"tool_eb %d, prev_status %ld",
handle->prev_cxt[camera_id].camera_id,
@@ -7175,12 +7182,20 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
(prev_cxt->cur_raw.sensor_raw_fmt == DCAM_RAW_PACK_10 ? "mipi_raw": "raw"));
}
ret = prev_get_sensor_mode(handle, camera_id);
+ printf("imx258_debug prev_get_sensor_mode ret %ld, prev_mode %ld, cap_mode %ld, video_mode %ld, sensor_out %d x %d\n",
+ ret, handle->prev_cxt[camera_id].prev_mode,
+ handle->prev_cxt[camera_id].cap_mode,
+ handle->prev_cxt[camera_id].video_mode,
+ handle->prev_cxt[camera_id].sensor_out_width,
+ handle->prev_cxt[camera_id].sensor_out_height);
if (ret) {
CMR_LOGE("get sensor mode failed");
goto exit;
}
ret = prev_pre_set(handle, camera_id);
+ printf("imx258_debug prev_pre_set ret %ld\n", ret);
if (ret) {
CMR_LOGE("pre set failed");
goto exit;
@@ -7196,6 +7211,7 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
if (handle->prev_cxt[camera_id].prev_param.preview_eb) {
ret =prev_set_prev_param(handle, camera_id, is_restart, out_param_ptr);
+ printf("imx258_debug prev_set_prev_param ret %ld\n", ret);
if (ret) {
CMR_LOGE("set prev param failed");
goto exit;
@@ -7204,6 +7220,7 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
if (handle->prev_cxt[camera_id].prev_param.video_eb) {
ret = prev_set_video_param(handle, camera_id, is_restart, out_param_ptr);
+ printf("imx258_debug prev_set_video_param ret %ld\n", ret);
if (ret) {
CMR_LOGE("set video param failed");
goto exit;
@@ -7212,6 +7229,7 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
if (handle->prev_cxt[camera_id].prev_param.channel1_eb) {
ret = channel1_configure(handle, camera_id, is_restart, out_param_ptr);
+ printf("imx258_debug channel1_configure ret %ld\n", ret);
if (ret) {
CMR_LOGE("channel1_configure failed");
goto exit;
@@ -7220,6 +7238,7 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
if (handle->prev_cxt[camera_id].prev_param.channel2_eb) {
ret = channel2_configure(handle, camera_id, is_restart, out_param_ptr);
+ printf("imx258_debug channel2_configure ret %ld\n", ret);
if (ret) {
CMR_LOGE("channel2_configure failed");
goto exit;
@@ -7228,6 +7247,7 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
if (handle->prev_cxt[camera_id].prev_param.channel3_eb) {
ret = channel3_configure(handle, camera_id, is_restart, out_param_ptr);
+ printf("imx258_debug channel3_configure ret %ld\n", ret);
if (ret) {
CMR_LOGE("channel3_configure failed");
goto exit;
@@ -7236,6 +7256,7 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
if (handle->prev_cxt[camera_id].prev_param.channel5_eb) {
ret = channel5_configure(handle, camera_id, is_restart, out_param_ptr);
+ printf("imx258_debug channel5_configure ret %ld\n", ret);
if (ret) {
CMR_LOGE("channel0_configure failed");
goto exit;
@@ -7252,6 +7273,7 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
} else {
ret = prev_set_cap_param(handle, camera_id, is_restart, 0,
out_param_ptr);
}
+ printf("imx258_debug prev_set_cap_param ret %ld\n", ret);
if (ret) {
CMR_LOGE("set cap param failed");
goto exit;
@@ -7261,6 +7283,7 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
if (handle->prev_cxt[camera_id].prev_param.channel0_eb) {
ret = channel0_configure(handle, camera_id, is_restart, out_param_ptr);
+ printf("imx258_debug channel0_configure ret %ld\n", ret);
if (ret) {
CMR_LOGE("channel0_configure failed");
goto exit;
@@ -7272,12 +7295,14 @@ cmr_int prev_set_param_internal(struct prev_handle *handle, cmr_u32 camera_id,
camera_id, handle->prev_cxt[camera_id].prev_param.channel4_eb);
if (handle->prev_cxt[camera_id].prev_param.channel4_eb) {
ret = channel4_configure(handle, camera_id, is_restart, out_param_ptr);
+ printf("imx258_debug channel4_configure ret %ld\n", ret);
if (ret) {
CMR_LOGE("channel4_configure failed");
goto exit;
}
}
exit:
+ printf("imx258_debug prev_set_param_internal exit ret %ld\n", ret);
CMR_LOGV("X");
handle->prev_cxt[camera_id].out_ret_val = ret;
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
@@ -237,8 +237,8 @@ int OemUnitTest::startPreview() {
preview_size.width = mPreviewWidth;
preview_size.height = mPreviewHeight;
- capture_size.width = mCaptureWidth;
- capture_size.height = mCaptureHeight;
+ capture_size.width = 0;
+ capture_size.height = 0;
zoom_param.mode = 1;
zoom_param.zoom_level = 1;
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
@@ -3534,10 +3534,10 @@ cmr_int prev_start(struct prev_handle *handle, cmr_u32 camera_id,
snapshot_enable = prev_cxt->prev_param.snapshot_eb;
video_enable = prev_cxt->prev_param.video_eb;
tool_eb = prev_cxt->prev_param.tool_eb;
- CMR_LOGD("camera_id %d, prev_status %ld, preview_eb %d, snapshot_eb %d, "
- "video_enable %d, need_isp %d,pdaf_type %d",
+ CMR_LOGE("imx258_debug prev_start camera_id %d, prev_status %ld, preview_eb %d, snapshot_eb %d, "
+ "video_enable %d, need_isp %d, pdaf_type %d, work_mode %ld",
camera_id, prev_cxt->prev_status, preview_enable, snapshot_enable,
- video_enable, prev_cxt->need_isp, pdaf_type);
+ video_enable, prev_cxt->need_isp, pdaf_type, work_mode);
if (preview_enable && PREVIEWING == prev_cxt->prev_status) {
CMR_LOGE("is previewing now, do nothing");
@@ -3624,6 +3624,10 @@ cmr_int prev_start(struct prev_handle *handle, cmr_u32 camera_id,
isp_param.remosaic_type = prev_cxt->prev_param.remosaic_type;
ret = handle->ops.isp_start_video(handle->oem_handle, &isp_param);
+ CMR_LOGE("imx258_debug isp_start_video ret %ld, isp_size %d x %d, dcam_size %d x %d, zsl %d",
+ ret, isp_param.size.width, isp_param.size.height,
+ isp_param.dcam_size.width, isp_param.dcam_size.height,
+ isp_param.sprd_zsl_flag);
if (ret) {
CMR_LOGE("isp start video failed");
ret = CMR_CAMERA_FAIL;
@@ -3652,6 +3656,8 @@ cmr_int prev_start(struct prev_handle *handle, cmr_u32 camera_id,
skip_num = prev_cxt->sensor_info.mipi_cap_skip_num;
CMR_LOGD("channel_bits %d, skip_num %ld", channel_bits, skip_num);
ret = handle->ops.channel_start(handle->oem_handle, channel_bits, skip_num);
+ CMR_LOGE("imx258_debug channel_start ret %ld, channel_bits 0x%x, skip_num %ld",
+ ret, channel_bits, skip_num);
if (ret) {
CMR_LOGE("channel_start failed");
ret = CMR_CAMERA_FAIL;
@@ -3728,6 +3734,7 @@ exit:
}
+ CMR_LOGE("imx258_debug prev_start exit ret %ld", ret);
return ret;
}
diff -ruN a/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/files/uis7885-2h10/sensor_config.xml b/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/files/uis7885-2h10/sensor_config.xml
--- a/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/files/uis7885-2h10/sensor_config.xml 2026-07-02 16:55:48.164416571 +0800
+++ b/source_sync_rls_25c/layers/meta-unisoc/recipes-multimedia/libcamera/files/uis7885-2h10/sensor_config.xml 2026-07-10 15:58:00.000000000 +0800
@@ -1,152 +1,12 @@
<root>
- <!-->
- sensor id 0
- <-->
<CameraModuleCfg>
<SlotId>0</SlotId>
- <SensorName>s5kgw1sp03</SensorName>
+ <SensorName>imx258</SensorName>
<Facing>BACK</Facing>
<Orientation>90</Orientation>
- <Resource_cost>55</Resource_cost>
- <SensorRole>dualcam_master</SensorRole>
- <SensorRole>multicam_wide</SensorRole>
- <ConflictingDevice>1</ConflictingDevice>
- <VCM>
- <AfName>lc898219</AfName>
- <Mode>0</Mode>
- </VCM>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa0</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>16384</E2promSize>
- </E2prom>
- </OTP>
+ <Resource_cost>100</Resource_cost>
<TuningParameter>
- <TuningName>s5kgw1sp03_back_main</TuningName>
- </TuningParameter>
- </CameraModuleCfg>
- <CameraModuleCfg>
- <SlotId>0</SlotId>
- <SensorName>imx586</SensorName>
- <Facing>BACK</Facing>
- <Orientation>90</Orientation>
- <Resource_cost>55</Resource_cost>
- <SensorRole>dualcam_master</SensorRole>
- <SensorRole>multicam_wide</SensorRole>
- <ConflictingDevice>1</ConflictingDevice>
- <VCM>
- <AfName>lc898229</AfName>
- <Mode>0</Mode>
- </VCM>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa0</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>16384</E2promSize>
- </E2prom>
- </OTP>
- <TuningParameter>
<TuningName>imx586</TuningName>
</TuningParameter>
- </CameraModuleCfg>
- <!-->
- sensor id 1
- <-->
- <CameraModuleCfg>
- <SlotId>1</SlotId>
- <SensorName>imx616</SensorName>
- <Facing>FRONT</Facing>
- <Orientation>270</Orientation>
- <Resource_cost>100</Resource_cost>
- <TuningParameter>
- <TuningName>imx616</TuningName>
- </TuningParameter>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa2</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>16384</E2promSize>
- </E2prom>
- </OTP>
- </CameraModuleCfg>
- <!-->
- sensor id 2
- <-->
- <CameraModuleCfg>
- <SlotId>2</SlotId>
- <SensorName>ov8856_back</SensorName>
- <Facing>BACK</Facing>
- <Orientation>90</Orientation>
- <Resource_cost>45</Resource_cost>
- <SensorRole>dualcam_slave</SensorRole>
- <SensorRole>multicam_superwide</SensorRole>
- <TuningParameter>
- <TuningName>ov8856_back_ultrawide</TuningName>
- </TuningParameter>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa4</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>8192</E2promSize>
- </E2prom>
- </OTP>
- </CameraModuleCfg>
- <!-->
- sensor id 4
- <-->
- <CameraModuleCfg>
- <SlotId>4</SlotId>
- <SensorName>ov08a10_back_sunny</SensorName>
- <Facing>BACK</Facing>
- <Orientation>90</Orientation>
- <Resource_cost>0</Resource_cost>
- <SensorRole>multicam_tele</SensorRole>
- <VCM>
- <AfName>dw9781b</AfName>
- <Mode>0</Mode>
- </VCM>
- <OIS>
- <OISName>dw9781b</OISName>
- <Mode>0</Mode>
- </OIS>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa6</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>16384</E2promSize>
- </E2prom>
- </OTP>
- <TuningParameter>
- <TuningName>ov08a10_back_sunny</TuningName>
- </TuningParameter>
- </CameraModuleCfg>
- <CameraModuleCfg>
- <SlotId>4</SlotId>
- <SensorName>ov08a10_back</SensorName>
- <Facing>BACK</Facing>
- <Orientation>90</Orientation>
- <Resource_cost>0</Resource_cost>
- <SensorRole>multicam_tele</SensorRole>
- <VCM>
- <AfName>dw9800</AfName>
- <Mode>0</Mode>
- </VCM>
- <OTP>
- <E2prom>
- <OtpName>general</OtpName>
- <I2cAddr>0xa6</I2cAddr>
- <E2promNum>3</E2promNum>
- <E2promSize>16384</E2promSize>
- </E2prom>
- </OTP>
- <TuningParameter>
- <TuningName>ov08a10</TuningName>
- </TuningParameter>
- </CameraModuleCfg>
- </root>
+ </CameraModuleCfg>
+</root>
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
@@ -3482,7 +3482,6 @@ cmr_int prev_start(struct prev_handle *handle, cmr_u32 camera_id,
CMR_MSG_INIT(message);
cmr_int ret = CMR_CAMERA_SUCCESS;
struct prev_context *prev_cxt = NULL;
- struct internal_param *inter_param = NULL;
cmr_u32 preview_enable = 0;
cmr_u32 snapshot_enable = 0;
cmr_u32 video_enable = 0;
@@ -3587,16 +3586,6 @@ cmr_int prev_start(struct prev_handle *handle, cmr_u32 camera_id,
is_restart, is_sn_reopen);
}
- inter_param = (struct internal_param *)malloc(sizeof(struct internal_param));
- if (!inter_param) {
- CMR_LOGE("No mem!");
- ret = CMR_CAMERA_NO_MEM;
- goto exit;
- }
- cmr_bzero(inter_param, sizeof(struct internal_param));
- inter_param->param1 = (void *)((unsigned long)camera_id);
-
if (prev_cxt->need_isp) {
isp_param.size.width = sensor_mode_info->trim_width;
if (prev_cxt->need_binning) {
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
@@ -674,6 +674,7 @@ cmr_int cmr_preview_set_param(cmr_handle preview_handle, cmr_u32 camera_id,
CMR_MSG_INIT(message);
cmr_int ret = CMR_CAMERA_SUCCESS;
cmr_int call_ret = CMR_CAMERA_SUCCESS;
+ struct internal_param *inter_param = NULL;
struct prev_handle *handle = (struct prev_handle *)preview_handle;
if (!preview_handle || !param_ptr || !out_param_ptr) {
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_preview.c
@@ -3621,6 +3621,14 @@ cmr_int prev_start(struct prev_handle *handle, cmr_u32 camera_id,
sensor_mode_info->trim_width, sensor_mode_info->trim_height);
isp_param.remosaic_type = prev_cxt->prev_param.remosaic_type;
+ printf("imx258_debug before isp_start_video, isp_size %d x %d, dcam_size %d x %d, zsl %d, remosaic %d\n",
+ isp_param.size.width, isp_param.size.height,
+ isp_param.dcam_size.width, isp_param.dcam_size.height,
+ isp_param.sprd_zsl_flag, isp_param.remosaic_type);
+ CMR_LOGE("imx258_debug before isp_start_video, isp_size %d x %d, dcam_size %d x %d, zsl %d, remosaic %d",
+ isp_param.size.width, isp_param.size.height,
+ isp_param.dcam_size.width, isp_param.dcam_size.height,
+ isp_param.sprd_zsl_flag, isp_param.remosaic_type);
ret = handle->ops.isp_start_video(handle->oem_handle, &isp_param);
printf("imx258_debug isp_start_video ret %ld, isp_size %d x %d, dcam_size %d x %d, zsl %d\n",
ret, isp_param.size.width, isp_param.size.height,
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/oem2v6/src/cmr_oem.c
@@ -7179,6 +7179,17 @@ cmr_int camera_isp_start_video(cmr_handle oem_handle,
goto exit;
}
+ printf("imx258_debug camera_isp_start_video enter, size %d x %d, dcam %d x %d, work_mode %d, snapshot %d, zsl %d\n",
+ param_ptr->size.width, param_ptr->size.height,
+ param_ptr->dcam_size.width, param_ptr->dcam_size.height,
+ param_ptr->work_mode, param_ptr->is_snapshot,
+ param_ptr->sprd_zsl_flag);
+ CMR_LOGE("imx258_debug camera_isp_start_video enter, size %d x %d, dcam %d x %d, work_mode %d, snapshot %d, zsl %d",
+ param_ptr->size.width, param_ptr->size.height,
+ param_ptr->dcam_size.width, param_ptr->dcam_size.height,
+ param_ptr->work_mode, param_ptr->is_snapshot,
+ param_ptr->sprd_zsl_flag);
CMR_LOGV("E");
cmr_bzero(&isp_param, sizeof(struct isp_video_start));
@@ -7247,6 +7258,8 @@ cmr_int camera_isp_start_video(cmr_handle oem_handle,
CMR_LOGE("cmr_sensor_get_mode failed");
goto exit;
}
+ printf("imx258_debug camera_isp_start_video sn_mode %u\n", sn_mode);
+ CMR_LOGE("imx258_debug camera_isp_start_video sn_mode %u", sn_mode);
setPsParam(cxt->camera_id, PREVIEW_TYPE, 0, SPRD_TAG_SENSOR_MODE, &sn_mode);
@@ -7257,6 +7270,16 @@ cmr_int camera_isp_start_video(cmr_handle oem_handle,
goto exit;
}
sensor_mode_info = &exp_info.mode_info[sn_mode];
+ printf("imx258_debug camera_isp_start_video sensor_mode_info %d x %d trim %d x %d out %d x %d line %d frame %d\n",
+ sensor_mode_info->width, sensor_mode_info->height,
+ sensor_mode_info->trim_width, sensor_mode_info->trim_height,
+ sensor_mode_info->out_width, sensor_mode_info->out_height,
+ sensor_mode_info->line_time, sensor_mode_info->frame_line);
+ CMR_LOGE("imx258_debug camera_isp_start_video sensor_mode_info %d x %d trim %d x %d out %d x %d line %d frame %d",
+ sensor_mode_info->width, sensor_mode_info->height,
+ sensor_mode_info->trim_width, sensor_mode_info->trim_height,
+ sensor_mode_info->out_width, sensor_mode_info->out_height,
+ sensor_mode_info->line_time, sensor_mode_info->frame_line);
isp_param.resolution_info.sensor_size.w = sensor_mode_info->width;
isp_param.resolution_info.sensor_size.h = sensor_mode_info->height;
@@ -7304,6 +7327,12 @@ cmr_int camera_isp_start_video(cmr_handle oem_handle,
CMR_LOGE("get sensor fps info failed %ld", ret);
goto exit;
}
+ printf("imx258_debug camera_isp_start_video fps max %u min %u high %u skip %u\n",
+ fps_info.max_fps, fps_info.min_fps,
+ fps_info.is_high_fps, fps_info.high_fps_skip_num);
+ CMR_LOGE("imx258_debug camera_isp_start_video fps max %u min %u high %u skip %u",
+ fps_info.max_fps, fps_info.min_fps,
+ fps_info.is_high_fps, fps_info.high_fps_skip_num);
cmr_bzero(&setting_param, sizeof(setting_param));
setting_param.camera_id = cxt->camera_id;
ret = cmr_setting_ioctl(cxt->setting_cxt.setting_handle,
@@ -7349,6 +7378,8 @@ cmr_int camera_isp_start_video(cmr_handle oem_handle,
if ((NULL == sns_ex_info_ptr->name) ||
(NULL == sns_ex_info_ptr->sensor_version_info)) {
+ printf("imx258_debug camera_isp_start_video init_static_info begin\n");
+ CMR_LOGE("imx258_debug camera_isp_start_video init_static_info begin");
ret = cmr_sensor_init_static_info(cxt);
if (ret) {
cmr_sensor_deinit_static_info(cxt);
@@ -7356,6 +7387,8 @@ cmr_int camera_isp_start_video(cmr_handle oem_handle,
goto exit;
}
+ printf("imx258_debug camera_isp_start_video init_static_info done\n");
+ CMR_LOGE("imx258_debug camera_isp_start_video init_static_info done");
}
sensor_info_ptr = &cxt->sn_cxt.sensor_info;
if (NULL != sns_ex_info_ptr->sns_binning_factor &&
@@ -7391,6 +7424,10 @@ cmr_int camera_isp_start_video(cmr_handle oem_handle,
camera_construct_scenario(oem_handle);
isp_param.scenario_info = info;
camera_isp_set_offline_num(info->app_mode, &isp_param.offline_frame_num);
+ printf("imx258_debug camera_isp_start_video before isp_video_start, app_mode %d offline %d\n",
+ info->app_mode, isp_param.offline_frame_num);
+ CMR_LOGE("imx258_debug camera_isp_start_video before isp_video_start, app_mode %d offline %d",
+ info->app_mode, isp_param.offline_frame_num);
ret = isp_video_start(isp_cxt->isp_handle, &isp_param);
if (ret) {
isp_cxt->is_work = 0;
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/sensor/sensor_drv/classic/Sony/imx258/sensor_imx258_mipi_raw.h
@@ -71,7 +71,8 @@
/* please don't change it */
#define EX_MCLK 24
-#define PDAF_TYPE2
+/* Disable PDAF for the single-camera SBC bring-up path. */
+/* #define PDAF_TYPE2 */
/*==============================================================================
* Description:
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
@@ -21,6 +21,7 @@
#include <math.h>
#include <dlfcn.h>
+#include <stdio.h>
#include <cmr_property.h>
//#include <cutils/sched_policy.h>
#include <sched.h>
@@ -13033,11 +13034,21 @@ cmr_int isp_alg_fw_start(cmr_handle isp_alg_handle, struct isp_video_start * in_
return ret;
}
+ printf("imx258_debug isp_alg_fw_start enter, camera %ld, work_mode %d, size %d x %d, dcam %d x %d, zsl %d, pdaf_enable %d\n",
+ cxt->camera_id, in_ptr->work_mode, in_ptr->size.w, in_ptr->size.h,
+ in_ptr->dcam_size.w, in_ptr->dcam_size.h, in_ptr->zsl_flag,
+ in_ptr->pdaf_enable);
+ ISP_LOGE("imx258_debug isp_alg_fw_start enter, camera %ld, work_mode %d, size %d x %d, dcam %d x %d, zsl %d, pdaf_enable %d",
+ cxt->camera_id, in_ptr->work_mode, in_ptr->size.w, in_ptr->size.h,
+ in_ptr->dcam_size.w, in_ptr->dcam_size.h, in_ptr->zsl_flag,
+ in_ptr->pdaf_enable);
cxt->raw_snapshot = 0;
pmg_start(cxt->pmg_handle);
+ printf("imx258_debug isp_alg_fw_start after pmg_start\n");
ISP_LOGI("cam%ld init status %d\n", cxt->camera_id, cxt->init_status);
isp_alg_fw_init_async_done(cxt);
+ printf("imx258_debug isp_alg_fw_start after init_async status %d\n", cxt->init_status);
if (cxt->init_status == FW_INIT_ERR) {
ISP_LOGE("cam%ld fw init error\n", cxt->camera_id);
@@ -13045,9 +13056,11 @@ cmr_int isp_alg_fw_start(cmr_handle isp_alg_handle, struct isp_video_start * in_
}
ret = isp_dev_access_ioctl(cxt->dev_access_handle, ISP_DEV_RESET, NULL, NULL);
+ printf("imx258_debug isp_alg_fw_start after ISP_DEV_RESET ret %ld\n", ret);
/* free/reset statis buffers of previous session */
ret = isp_dev_free_buf(cxt->dev_access_handle, &cxt->stats_mem_info);
+ printf("imx258_debug isp_alg_fw_start after isp_dev_free_buf ret %ld\n", ret);
/* gtm_ltm_on != 1/0,means not set */
cxt->gtm_ltm_on = (-1);
@@ -13100,6 +13113,10 @@ cmr_int isp_alg_fw_start(cmr_handle isp_alg_handle, struct isp_video_start * in_
if (get_dump_block_enable(_PROP_PM_CONTEXT_RAW_CAP))
cxt->dump_cxt->scenario_info = (void *)scenario_info;
isp_convert_scenario_info(scenario_info, &convert_scen_info);
+ printf("imx258_debug isp_alg_fw_start scenario app_id %d sensor %d x %d app_mode %d scene %d\n",
+ convert_scen_info.app_id, convert_scen_info.resolution.width,
+ convert_scen_info.resolution.height, convert_scen_info.app_mode,
+ convert_scen_info.scene_mode);
ISP_LOGD("scenario info: app_id:%d, sensor size:%d, %d,"
" app_mode:%d, auto_scene:%d, has_face:%d, scene_mode:%d, zoom_flag:%f",
convert_scen_info.app_id, convert_scen_info.resolution.width, convert_scen_info.resolution.height,
@@ -13157,7 +13174,12 @@ cmr_int isp_alg_fw_start(cmr_handle isp_alg_handle, struct isp_video_start * in_
break;
}
pm_input.its_cts_flag = cxt->app_id;
+ printf("imx258_debug isp_alg_fw_start before ISP_PM_CMD_SET_MODE mode0 %d size0 %d x %d sets %d\n",
+ pm_input.mode[0], pm_input.img_w[0], pm_input.img_h[0],
+ pm_input.pm_sets_num);
ret = camera_pm_ioctl(cxt->handle_pm, ISP_PM_CMD_SET_MODE, &pm_input, &pm_output);
+ printf("imx258_debug isp_alg_fw_start after ISP_PM_CMD_SET_MODE ret %ld scenario0 0x%llx scenario1 0x%llx\n",
+ ret, (unsigned long long)pm_output.scenario_id[0],
+ (unsigned long long)pm_output.scenario_id[1]);
ispalg_set_manual_param_to_pm(cxt);
ISP_RETURN_IF_FAIL(ret, ("fail to isp pm set mode"));
@@ -13183,6 +13205,7 @@ cmr_int isp_alg_fw_start(cmr_handle isp_alg_handle, struct isp_video_start * in_
cxt->gtm_ltm_on, cxt->pinpon_flag, pm_input.its_cts_flag);
ret = camera_pm_ioctl(cxt->handle_pm, ISP_PM_CMD_SET_SCERANIO_ID_LOCK, &pm_input, NULL);
+ printf("imx258_debug isp_alg_fw_start after SET_SCERANIO_ID_LOCK ret %ld\n", ret);
if (cxt->work_mode) {
ISP_LOGV("work_mode %d", cxt->work_mode);
ret = ispalg_update_param_through_smart(isp_alg_handle, &(cxt->smart_info), cxt->pinpon_flag);
@@ -13331,13 +13354,19 @@ cmr_int isp_alg_fw_start(cmr_handle isp_alg_handle, struct isp_video_start * in_
}
}
if (cxt->ops.lsc_ops.ioctrl) {
+ printf("imx258_debug isp_alg_fw_start skip ALSC_UPDATE_TUNNING_PARAM ptr %p size %d for bringup\n",
+ lsc_param.ptr, lsc_param.data_size);
- ret = cxt->ops.lsc_ops.ioctrl(cxt->lsc_cxt.handle, ALSC_UPDATE_TUNNING_PARAM, (void *)&lsc_param, NULL);
- ISP_TRACE_IF_FAIL(ret, ("fail to alsc tunningparam"));
+ ret = ISP_SUCCESS;
}
cxt->commn_cxt.param_index = ispalg_get_param_index(cxt->commn_cxt.input_size_trim, &in_ptr->size);
+ printf("imx258_debug isp_alg_fw_start skip ispalg_update_alg_param param_index %d for bringup\n",
+ cxt->commn_cxt.param_index);
- ret = ispalg_update_alg_param(cxt);
- ISP_RETURN_IF_FAIL(ret, ("fail to isp smart param calc"));
+ ret = ISP_SUCCESS;
ISP_LOGI("pdaf_support = %d, pdaf_enable = %d, is_multi_mode = %d",
@@ -13420,17 +13449,25 @@ cmr_int isp_alg_fw_start(cmr_handle isp_alg_handle, struct isp_video_start * in_
ret = isp_dev_access_ioctl(cxt->dev_access_handle, ISP_DEV_SET_EBD_CFG, 0, 0);
ISP_RETURN_IF_FAIL(ret, ("fail to cfg embedded line"));
}
+ printf("imx258_debug isp_alg_fw_start skip ispalg_update_alsc_result for bringup\n");
- ret = ispalg_update_alsc_result(cxt, (void *)&fwstart_info);
- ISP_RETURN_IF_FAIL(ret, ("fail to update alsc result"));
+ ret = ISP_SUCCESS;
if (cxt->ops.lsc_ops.ioctrl) {
+ printf("imx258_debug isp_alg_fw_start skip ALSC_CMD_SET_DEBUGMODE for bringup\n");
- ret = cxt->ops.lsc_ops.ioctrl(cxt->lsc_cxt.handle, ALSC_CMD_SET_DEBUGMODE, (void *)&in_ptr->dv_mode, NULL);
- ISP_TRACE_IF_FAIL(ret, ("fail to alsc tunningparam"));
+ ret = ISP_SUCCESS;
}
+ printf("imx258_debug isp_alg_fw_start before ISP_DEV_CFG_START\n");
ret = isp_dev_access_ioctl(cxt->dev_access_handle, ISP_DEV_CFG_START, NULL, NULL);
+ printf("imx258_debug isp_alg_fw_start after ISP_DEV_CFG_START ret %ld\n", ret);
ISP_TRACE_IF_FAIL(ret, ("fail to do cfg start"));
+ printf("imx258_debug isp_alg_fw_start before ispalg_cfg_param\n");
ret = ispalg_cfg_param(cxt, PARAM_CFG_START);
+ printf("imx258_debug isp_alg_fw_start after ispalg_cfg_param ret %ld\n", ret);
ISP_RETURN_IF_FAIL(ret, ("fail to do ispalg_cfg_param"));
pmg_set_start_flag(cxt->pmg_handle, PARAM_CFG_START);
@@ -13448,16 +13485,22 @@ cmr_int isp_alg_fw_start(cmr_handle isp_alg_handle, struct isp_video_start * in_
ISP_TRACE_IF_FAIL(ret, ("fail to do anti_flicker param update"));
if (cxt->is_simulator == 0) {
- ret = ispalg_ae_set_work_mode(cxt, cxt->commn_cxt.pm_scenario_id[0], 1, in_ptr);
- ISP_RETURN_IF_FAIL(ret, ("fail to do ae cfg"));
+ printf("imx258_debug isp_alg_fw_start skip ispalg_ae_set_work_mode for bringup\n");
+ cxt->ae_cxt.sw_bypass = 1;
+ cxt->ae_cxt.win_num.w = 32;
+ cxt->ae_cxt.win_num.h = 32;
+ ret = ISP_SUCCESS;
} else {
ISP_LOGD("bypass AE for simulator\n");
}
if (cxt->ops.awb_ops.ioctrl) {
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/UT/OemUnitTest/OemUnitTest.cpp
@@ -381,75 +381,42 @@ int OemUnitTest::takePicture() {
- CMR_LOGI("E");
- int ret = CMR_CAMERA_SUCCESS;
- std::unique_lock<std::mutex> lck(mLock);
- mCaptureMode = CAMERA_NORMAL_MODE;
-
- mCaptureWidth = 800;
- mCaptureHeight = 600;
-
- if (SPRD_ERROR == mCameraState.capture_state) {
- CMR_LOGE("takePicture in error status, deinit capture at first ");
- } else if (SPRD_IDLE != mCameraState.capture_state) {
- if (SPRD_WAITING_JPEG == getCaptureState()) {
- if (!WaitForCaptureDone()) {
- CMR_LOGE("take picture: wait timeout, direct return!");
- goto exit;
- }
- } else {
- CMR_LOGE("take picture: action alread exist, direct return!");
- ret = CMR_CAMERA_FAIL;
- goto exit;
- }
- }
-
- if (NULL == mCameraHandle || NULL == mOem || NULL == mOem->ops) {
- CMR_LOGE("takePicture: oem is null or oem ops is null");
- ret = CMR_CAMERA_FAIL;
- goto exit;
- }
-
- mOem->ops->camera_fast_ctrl(mCameraHandle, CAMERA_FAST_MODE_FD, 0);
-
- if (!isZslMode()) {
- if (isPreviewing()) {
- CMR_LOGI("call stopPreview in takePicture");
-
- if (stopPreviewInternal()) {
- ret = CMR_CAMERA_FAIL;
- CMR_LOGE(" fail to stop preview ");
- goto exit;
- } else {
- CMR_LOGI("preview stop ");
- }
- }
-
- if (!isCameraInit()) {
- CMR_LOGE("camera initialize error!, camera state = %d",
- getCameraStateStr(getCameraState()));
- ret = CMR_CAMERA_FAIL;
- goto exit;
- }
- }
-
- if (isCapturing()) {
- CMR_LOGI("Wait For Capture Done");
- WaitForCaptureDone();
- }
-
- CMR_LOGI("setCameraState(SPRD_INTERNAL_RAW_REQUESTED, STATE_CAPTURE);");
- setCameraState(SPRD_INTERNAL_RAW_REQUESTED, STATE_CAPTURE);
-
- setSnapshotParams();
-
- if (mCameraHandle == NULL || mOem == NULL || mOem->ops == NULL ||
- CMR_CAMERA_SUCCESS !=
- mOem->ops->camera_take_picture(mCameraHandle, mCaptureMode)) {
- setCameraState(SPRD_ERROR, STATE_CAPTURE);
- CMR_LOGE("takePicture: fail to camera_take_picture.");
-
- ret = CMR_CAMERA_FAIL;
- goto exit;
- }
-
- CMR_LOGI("X");
-exit:
- return ret;
+ int ret = CMR_CAMERA_SUCCESS;
+
+ /*
+ * SBC bring-up path: the normal snapshot/JPEG pipeline still depends on
+ * phone-oriented capture tuning and fails before it can return a frame.
+ * Reuse the verified preview path so the "take" command captures fresh
+ * frames into /home/user/dump for inspection.
+ */
+ CMR_LOGI("takePicture: capture preview dump");
+ printf("OemUnitTest takePicture preview-dump mode\n");
+
+ if (NULL == mCameraHandle || NULL == mOem || NULL == mOem->ops) {
+ CMR_LOGE("takePicture: oem is null or oem ops is null");
+ return CMR_CAMERA_FAIL;
+ }
+
+ camera_dump_cnt_pre = 0;
+ dump_total_count = 5;
+ mCaptureMode = CAMERA_NORMAL_MODE;
+ mSprdZslEnabled = false;
+
+ if (!isPreviewing()) {
+ ret = startPreview();
+ if (ret) {
+ CMR_LOGE("takePicture: fail to start preview dump");
+ return ret;
+ }
+ }
+
+ usleep(1000 * 1000);
+ printf("OemUnitTest takePicture preview-dump saved %d frame(s)\n",
+ camera_dump_cnt_pre);
+
+ return CMR_CAMERA_SUCCESS;
}
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
@@ -13502,20 +13502,32 @@ cmr_int isp_alg_fw_start(cmr_handle isp_alg_handle, struct isp_video_start * in_
printf("imx258_debug isp_alg_fw_start after ispalg_cfg_param ret %ld\n", ret);
ISP_RETURN_IF_FAIL(ret, ("fail to do ispalg_cfg_param"));
+ printf("imx258_debug isp_alg_fw_start before pmg_set_start_flag\n");
pmg_set_start_flag(cxt->pmg_handle, PARAM_CFG_START);
+ printf("imx258_debug isp_alg_fw_start after pmg_set_start_flag\n");
+ printf("imx258_debug isp_alg_fw_start before afl handle config handle %p version %d\n",
+ cxt->afl_cxt.handle, cxt->afl_cxt.version);
if (cxt->afl_cxt.handle) {
((struct isp_anti_flicker_cfg *)cxt->afl_cxt.handle)->width = cxt->commn_cxt.prv_size.w;
((struct isp_anti_flicker_cfg *)cxt->afl_cxt.handle)->height = cxt->commn_cxt.prv_size.h;
}
+ printf("imx258_debug isp_alg_fw_start after afl handle config\n");
cxt->afl_cxt.hw_bypass = 1;
+ cxt->afl_cxt.sw_bypass = 1;
+ if (cxt->afl_cxt.version && !cxt->afl_cxt.sw_bypass) {
if (cxt->ops.afl_ops.config_new) {
printf("imx258_debug isp_alg_fw_start before afl config_new\n");
ret = cxt->ops.afl_ops.config_new(cxt->afl_cxt.handle);
printf("imx258_debug isp_alg_fw_start after afl config_new ret %ld\n", ret);
}
+ } else {
+ printf("imx258_debug isp_alg_fw_start skip afl config_new version %d sw_bypass %d\n",
+ cxt->afl_cxt.version, cxt->afl_cxt.sw_bypass);
}
+ printf("imx258_debug isp_alg_fw_start before AFL ISP_TRACE ret %ld\n", ret);
ISP_TRACE_IF_FAIL(ret, ("fail to do anti_flicker param update"));
+ printf("imx258_debug isp_alg_fw_start after AFL ISP_TRACE\n");
if (cxt->is_simulator == 0) {
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
@@ -4772,14 +4772,22 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
void *ptr;
cmr_u32 update_flag = 0;
printf("imx258_debug ispalg_cfg_param enter cfg_type %u\n", cfg_type);
- ISP_LOGD("E");
+ /* Avoid ISP_LOGD here while tracing heap corruption; log macro may malloc. */
+ printf("imx258_debug ispalg_cfg_param stream_on %d\n", cxt->stream_on);
if (cxt->stream_on == 0)
return 0;
@@ -4782,11 +4790,16 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
if (cfg_type == PARAM_CFG_START) {
+ printf("imx258_debug ispalg_cfg_param before ispalg_get_gtm_enable\n");
ispalg_get_gtm_enable((cmr_handle) cxt);
+ printf("imx258_debug ispalg_cfg_param after ispalg_get_gtm_enable\n");
}
+ printf("imx258_debug ispalg_cfg_param before pm_getting_lock\n");
pthread_mutex_lock(&cxt->pm_getting_lock);
+ printf("imx258_debug ispalg_cfg_param after pm_getting_lock\n");
memset((void *)&cfg, 0x00, sizeof(cfg));
diff -ruN a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
--- a/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
+++ b/source_sync_rls_25c/source/unisoc/multimedia/camera/libcamera/pss/isp2.7/middleware/isp_alg_fw.c
@@ -4771,6 +4771,7 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
cmr_u32 update_flag = 0;
+ int imx258_cfg_debug = (cfg_type == PARAM_CFG_START);
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param enter cfg_type %u\n", cfg_type);
ISP_LOGD("E");
if (cxt->stream_on == 0)
return 0;
@@ -4792,7 +4793,11 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
ispalg_ai_pro_param_compatible((cmr_handle) cxt);
#endif
cmd = ispalg_get_param_type(cfg_type);
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param before camera_pm_ioctl cmd %d pinpon %u\n",
+ cmd, cxt->pinpon_flag);
ret = camera_pm_ioctl(cxt->handle_pm, cmd, &cxt->pinpon_flag, &output);
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param after camera_pm_ioctl ret %ld prv_num %u cap_num %u\n",
+ ret, output.prv_param_num, output.cap_param_num);
ISP_RETURN_IF_FAIL(ret, ("fail to get isp block settings"));
/* lock pm to avoid parameter is updated by algo while driver reading */
@@ -4800,10 +4805,16 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
ispalg_get_param_by_cfg_type(cxt, &start, cfg_type, &gtm_ltm_on, &work_mode, &scene_id);
update_flag = ((output.prv_param_num == 0) ? 0 : 1);
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param cfg start %u scene %u work_mode %u gtm_ltm_on %u update_flag %u\n",
+ start, scene_id, work_mode, gtm_ltm_on, update_flag);
if (!flag_start_end) {
flag_start_end = 1;
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param before pmg_cfg start scene %u update %u\n",
+ scene_id, update_flag);
pmg_cfg_param_start_end(cxt->pmg_handle, 0, scene_id, update_flag);
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param after pmg_cfg start\n");
}
ISP_LOGV("update number:%d, gtm: %d %d %d\n", output.prv_param_num,
@@ -4834,6 +4845,8 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
param_data = output.prv_param_data;
for (i = 0; i < output.prv_param_num; i++) {
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param prv block index %u id 0x%04x ptr %p size %u\n",
+ i, param_data->id, param_data->data_ptr, param_data->data_size);
#if __DISABLE_OTHER_ALG_
if (cxt->gtm_ltm_all_on == 1) {
@@ -4903,6 +4916,8 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
#endif
ISP_LOGV("cfg block 0x%04x for scene %d, frame_id:%d\n",
param_data->id, sub_block_info.scene_id, cxt->frame_id_sof);
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param before isp_dev_cfg_block index %u id 0x%04x scene %u\n",
+ i, param_data->id, sub_block_info.scene_id);
#if __DISABLE_NOUSE_CODE__
time_t t_cur;
@@ -4915,6 +4930,8 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
cxt->dump_cxt->cur_pre_time = ptm;
#endif
isp_dev_cfg_block(cxt->dev_access_handle, &sub_block_info, param_data->id);
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param after isp_dev_cfg_block index %u id 0x%04x\n",
+ i, param_data->id);
param_data++;
}
@@ -4956,6 +4973,7 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
struct isp_dev_hist2_info hist2_info;
struct isp_dev_hist_info hist_info;
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param before hist cfg\n");
memset(&hist2_info, 0, sizeof(struct isp_dev_hist2_info));
hist2_info.bypass = 0;
@@ -4965,6 +4983,7 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
sub_block_info.block_info = &hist2_info;
sub_block_info.scene_id = PM_SCENE_PRE;
ret = isp_dev_cfg_block(cxt->dev_access_handle, &sub_block_info, ISP_BLK_HIST2);
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param after HIST2 ret %ld\n", ret);
memset(&hist_info, 0, sizeof(struct isp_dev_hist_info));
@@ -4974,11 +4993,16 @@ cmr_s32 ispalg_cfg_param(cmr_handle isp_alg_handle, cmr_u32 cfg_type)
sub_block_info.block_info = &hist_info;
sub_block_info.scene_id = PM_SCENE_PRE;
ret = isp_dev_cfg_block(cxt->dev_access_handle, &sub_block_info, ISP_BLK_HIST);
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param after HIST ret %ld\n", ret);
}
- if (flag_start_end)
+ if (flag_start_end) {
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param before pmg_cfg end scene %u update %u\n",
+ scene_id, update_flag);
ret = pmg_cfg_param_start_end(cxt->pmg_handle, 1, scene_id, update_flag);
+ if (imx258_cfg_debug)
+ printf("imx258_debug ispalg_cfg_param after pmg_cfg end ret %ld\n", ret);
+ }
// prev config end
if ((work_mode == 0) && cxt->zsl_flag && cxt->ai_sfnr_flag && (cmd == ISP_PM_CMD_GET_ISP_ALL_SETTING)) {
+ cxt->awb_cxt.sw_bypass = 1;
+ printf("imx258_debug isp_alg_fw_start skip AWB start ioctrls for bringup\n");
+#if 0
+ printf("imx258_debug isp_alg_fw_start before AWB work mode\n");
ret = cxt->ops.awb_ops.ioctrl(cxt->awb_cxt.handle,
AWB_CTRL_CMD_SET_WORK_MODE,
&in_ptr->work_mode, NULL);
+ printf("imx258_debug isp_alg_fw_start after AWB work mode ret %ld\n", ret);
ISP_RETURN_IF_FAIL(ret, ("fail to set_awb_work_mode"));
+ printf("imx258_debug isp_alg_fw_start before AWB AE_STAT_WIN_NUM %u x %u\n",
+ cxt->ae_cxt.win_num.w, cxt->ae_cxt.win_num.h);
ret = cxt->ops.awb_ops.ioctrl(cxt->awb_cxt.handle,
AWB_CTRL_CMD_SET_AE_STAT_WIN_NUM,
+ &cxt->ae_cxt.win_num, NULL);
+ printf("imx258_debug isp_alg_fw_start after AWB AE_STAT_WIN_NUM ret %ld\n", ret);
+ ISP_RETURN_IF_FAIL(ret, ("fail to set_awb_aem_stat_win"));
+
+ printf("imx258_debug isp_alg_fw_start before AWB GET_PIX_CNT %u x %u\n",
+ cxt->commn_cxt.prv_size.w, cxt->commn_cxt.prv_size.h);
+ ret = cxt->ops.awb_ops.ioctrl(cxt->awb_cxt.handle,
+ AWB_CTRL_CMD_GET_PIX_CNT, &cxt->commn_cxt.prv_size, NULL);
+ printf("imx258_debug isp_alg_fw_start after AWB GET_PIX_CNT ret %ld\n", ret);
+ ISP_RETURN_IF_FAIL(ret, ("fail to get_awb_pix_cnt"));
+
+ printf("imx258_debug isp_alg_fw_start before AWB GET_FLASH_AWB_ENABLE\n");
+ ret = cxt->ops.awb_ops.ioctrl(cxt->awb_cxt.handle,
+ AWB_CTRL_CMD_GET_FLASH_AWB_ENABLE, NULL, &flash_awb_en);
+ printf("imx258_debug isp_alg_fw_start after AWB GET_FLASH_AWB_ENABLE ret %ld enable %u\n",
+ ret, flash_awb_en);
+ ISP_TRACE_IF_FAIL(ret, ("fail to get flash awb enable"));
+ printf("imx258_debug isp_alg_fw_start skip AWB UPDATE_TUNING_PARAM ptr %p size %u for bringup\n",
+ awb_param.ptr, awb_param.data_size);
+ ret = ISP_SUCCESS;
+#endif
@@ -13612,8 +13653,11 @@ cmr_int isp_alg_fw_start(cmr_handle isp_alg_handle, struct isp_video_start * in_
}
/* malloc statis/lsc and other buffers and mapping buffers to dev. */
+ printf("imx258_debug isp_alg_fw_start before ispalg_calc_stats_size\n");
ispalg_calc_stats_size(cxt);
+ printf("imx258_debug isp_alg_fw_start before isp_dev_prepare_buf\n");
ret = isp_dev_prepare_buf(cxt->dev_access_handle, &cxt->stats_mem_info);
+ printf("imx258_debug isp_alg_fw_start after isp_dev_prepare_buf ret %ld\n", ret);
ISP_RETURN_IF_FAIL(ret, ("fail to prepare buf"));
if (cxt->ops.awb_ops.ioctrl) {