[COMMON] fimc-is2: modified to get tdnr_enable by setfile
authorWooyeon Kim <wooy88.kim@samsung.com>
Thu, 7 Jun 2018 01:13:55 +0000 (10:13 +0900)
committerEunyoung Lee <ey470.lee@samsung.com>
Tue, 19 Jun 2018 08:50:00 +0000 (17:50 +0900)
 - If tdnr_enable is false in TDNR setfile, set to not enabled

Change-Id: I8d84cfa9bbcebc8c7458cfb86c15bd02f9282ecf
Signed-off-by: Wooyeon Kim <wooy88.kim@samsung.com>
drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-tdnr-v2.c

index 3719347d55555ef801c3964eb844729b1c6c8a18..4c0020c856f32d066ee14dd63106c5ec2a88b092 100644 (file)
@@ -123,20 +123,31 @@ static int fimc_is_hw_mcsc_check_tdnr_mode_pre(struct fimc_is_hw_ip *hw_ip,
        struct fimc_is_hw_mcsc *hw_mcsc;
        struct fimc_is_hw_mcsc_cap *cap = GET_MCSC_HW_CAP(hw_ip);
        u32 lindex, hindex;
+#ifdef MCSC_DNR_USE_TUNING
+       enum exynos_sensor_position sensor_position;
+       tdnr_setfile_contents *tdnr_tuneset;
+#endif
+       bool setfile_tdnr_enable = true;
 
        BUG_ON(!hw_ip->priv_info);
        BUG_ON(!tpu_param);
        BUG_ON(!cap);
 
        hw_mcsc = (struct fimc_is_hw_mcsc *)hw_ip->priv_info;
-
        /* bypass setting at below case
         * 1. dnr_bypass parameter is true
         * 2. internal shot
+        * 3. mcsc setfile "tdnr_enable" is "0"
         */
+#ifdef MCSC_DNR_USE_TUNING
+       sensor_position = hw_ip->hardware->sensor_position[atomic_read(&hw_ip->instance)];
+       tdnr_tuneset = &hw_mcsc->applied_setfile[sensor_position]->tdnr_contents;
+       setfile_tdnr_enable = tdnr_tuneset->tdnr_enable;
+#endif
 
        if ((tpu_param->config.tdnr_bypass == true)
-               || (frame->type == SHOT_TYPE_INTERNAL)) {
+               || (frame->type == SHOT_TYPE_INTERNAL)
+               || setfile_tdnr_enable == false) {
                tdnr_mode = TDNR_MODE_BYPASS;
        } else {
                lindex = frame->shot->ctl.vendor_entry.lowIndexParam;