[COMMON] fimc-is2: add & fixed a 2x5 3dhdr stat
authorWooyeon Kim <wooy88.kim@samsung.com>
Thu, 14 Mar 2019 08:59:17 +0000 (17:59 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:33 +0000 (20:23 +0300)
 - motion stat update interface added
 - fix wrong register update method for some stats

 PR JIRA ID: CPR-828

Change-Id: Idab1c8dceb671cd8a1f22fa2785455d3d4ea7ba8
Signed-off-by: Wooyeon Kim <wooy88.kim@samsung.com>
drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c
drivers/media/platform/exynos/fimc-is2/sensor/module_framework/fimc-is-interface-sensor.h

index fb3396a70505a5cbfc02e34e9abef26c855623b2..db19660d386a63ab7957f6d16fb56d6183176a41 100644 (file)
@@ -2192,6 +2192,67 @@ int sensor_2x5sp_cis_set_3hdr_stat(struct v4l2_subdev *subdev, bool streaming, v
                ret = fimc_is_sensor_write16(client, 0x4E06, y_sum_roi.roi_start_y);
                if (ret < 0)
                        goto p_err;
+       } else {
+               /* update 3hdr motion stat */
+               ret = fimc_is_sensor_write16(client, 0x6028, 0x2001);
+               if (ret < 0)
+                       goto p_err;
+
+               ret |= fimc_is_sensor_write16(client, 0x602A, 0x29D8);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_indication);
+
+               ret |= fimc_is_sensor_write16(client, 0x602A, 0x2A52);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_high_end_ty2ty1);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_high_end_ty3ty2);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_high_start_ty2ty1);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_high_start_ty3ty2);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_low_end_ty2ty1);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_low_end_ty3ty2);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_low_start_ty2ty1);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_low_start_ty3ty2);
+
+               dbg_sensor(2, "[%s] motion idc(%d) high21(e:%d, s:%d), low21(e:%d, s:%d)\n",
+                               __func__,
+                               (u16)per_frame_stat.motion_indication,
+                               (u16)per_frame_stat.motion_high_end_ty2ty1,
+                               (u16)per_frame_stat.motion_high_start_ty2ty1,
+                               (u16)per_frame_stat.motion_low_end_ty2ty1,
+                               (u16)per_frame_stat.motion_low_start_ty2ty1);
+               dbg_sensor(2, "[%s] motion high32(e:%d, s:%d), low32(e:%d, s:%d)\n",
+                               __func__,
+                               (u16)per_frame_stat.motion_high_end_ty3ty2,
+                               (u16)per_frame_stat.motion_high_start_ty3ty2,
+                               (u16)per_frame_stat.motion_low_end_ty3ty2,
+                               (u16)per_frame_stat.motion_low_start_ty3ty2);
+
+               ret |= fimc_is_sensor_write16(client, 0x602A, 0x2A68);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.decision_thresh_override);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_abs_high_ty3ty2);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_abs_low_ty3ty2);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_abs_high_ty2ty1);
+               ret |= fimc_is_sensor_write16(client, 0x6F12,
+                               (u16)per_frame_stat.motion_abs_low_ty2ty1);
+
+               dbg_sensor(2, "[%s] motion DTO(%d), abs(h32:%d, l32:%d), abs(h21:%d, l21:%d)\n",
+                               __func__,
+                               (u16)per_frame_stat.decision_thresh_override,
+                               (u16)per_frame_stat.motion_abs_high_ty3ty2,
+                               (u16)per_frame_stat.motion_abs_low_ty3ty2,
+                               (u16)per_frame_stat.motion_abs_high_ty2ty1,
+                               (u16)per_frame_stat.motion_abs_low_ty2ty1);
        }
 
        /* restore 0x4000_XXXX */
index be278cee8016c2fd8afce09b4a3d4dc2eab72a5a..7f9a4170649ed451b46f8a258a49bfeb44c69cd3 100755 (executable)
@@ -248,6 +248,22 @@ struct sensor_lsi_3hdr_stat_control_per_frame {
        int r_weight;
        int b_weight;
        int g_weight;
+
+       /* stat for 3dhdr motion */
+       u32 motion_indication;
+       u32 motion_high_end_ty2ty1;
+       u32 motion_high_start_ty2ty1;
+       u32 motion_low_end_ty2ty1;
+       u32 motion_low_start_ty2ty1;
+       u32 motion_high_end_ty3ty2;
+       u32 motion_high_start_ty3ty2;
+       u32 motion_low_end_ty3ty2;
+       u32 motion_low_start_ty3ty2;
+       u32 decision_thresh_override;
+       u32 motion_abs_high_ty3ty2;
+       u32 motion_abs_low_ty3ty2;
+       u32 motion_abs_high_ty2ty1;
+       u32 motion_abs_low_ty2ty1;
 };
 
 typedef struct {