[COMMON] fimc-is: fix a bug TDNR mode setting at each other instance
authorWooyeon Kim <wooy88.kim@samsung.com>
Tue, 14 Aug 2018 07:50:22 +0000 (16:50 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:59 +0000 (20:22 +0300)
 - if device is used a multi-instance, TDNR mode should set 2DNR mode
   as other instance is operated

 PR JIRA ID: CPR-166

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

index f79a34d5f43589f70cca3aeae031d557dc8ecac2..f12941d8fe7f2d0af4a20022f25c2d6ca5f1f921 100644 (file)
@@ -857,6 +857,7 @@ config:
        msdbg_hw(2, "shot: mcsc_out_st[0x%lx]\n", instance, hw_ip,
                mcsc_out_st);
 
+       hw_mcsc->instance = instance;
        clear_bit(MCSC_RST_CHK, &mcsc_out_st);
        set_bit(HW_CONFIG, &hw_ip->state);
 
@@ -957,7 +958,6 @@ int fimc_is_hw_mcsc_update_param(struct fimc_is_hw_ip *hw_ip,
                control_cmd = true;
                msdbg_hw(2, "update_param: hw_ip->instance(%d), control_cmd(%d)\n",
                        instance, hw_ip, hw_mcsc->instance, control_cmd);
-               hw_mcsc->instance = instance;
        }
 
        if (control_cmd || (lindex & LOWBIT_OF(PARAM_MCS_INPUT))
index 1eabaaac9dd5b163e5f12c932a870e4561231036..218ca9dd4bee9920276039a3592562090be4433e 100644 (file)
@@ -188,12 +188,14 @@ static int fimc_is_hw_mcsc_check_tdnr_mode_pre(struct fimc_is_hw_ip *hw_ip,
                 * 2. head group shot count is "0"(first shot)
                 * 3. tdnr wdma size changed
                 * 4. tdnr wdma dma out disabled
-                * 5. setfile tuneset changed(TODO)
+                * 5. instance is changed
+                * 6. setfile tuneset changed(TODO)
                 */
                if ((cur_mode == TDNR_MODE_BYPASS)
                        || (!atomic_read(&head->scount))
                        || (lindex & LOWBIT_OF(PARAM_MCS_INPUT))
-                       || (hindex & HIGHBIT_OF(PARAM_MCS_INPUT)))
+                       || (hindex & HIGHBIT_OF(PARAM_MCS_INPUT))
+                       || (atomic_read(&hw_ip->instance) != hw_mcsc->instance))
                        tdnr_mode = TDNR_MODE_2DNR; /* first frame */
                else
                        /* set to 3DNR mode */