From 60917afa10ead974bcae96b3816a6297c4773b0e Mon Sep 17 00:00:00 2001 From: Wooyeon Kim Date: Thu, 14 Mar 2019 17:59:17 +0900 Subject: [PATCH] [COMMON] fimc-is2: add & fixed a 2x5 3dhdr stat - 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 --- .../module_framework/cis/fimc-is-cis-2x5sp.c | 61 +++++++++++++++++++ .../fimc-is-interface-sensor.h | 16 +++++ 2 files changed, 77 insertions(+) diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c index fb3396a70505..db19660d386a 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c @@ -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 */ diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/fimc-is-interface-sensor.h b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/fimc-is-interface-sensor.h index be278cee8016..7f9a4170649e 100755 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/fimc-is-interface-sensor.h +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/fimc-is-interface-sensor.h @@ -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 { -- 2.20.1