[COMMON] fimc-is2: Code cleanup related to ENABLE_REPROCESSING_FD
authorSunmi Lee <carrotsm.lee@samsung.com>
Fri, 8 Jun 2018 04:52:45 +0000 (13:52 +0900)
committerSunyoung Kang <sy0816.kang@samsung.com>
Mon, 23 Jul 2018 08:05:00 +0000 (17:05 +0900)
Change-Id: I7b06ef08fd4e14ee85330185295b565b9280aa55
Signed-off-by: Sunmi Lee <carrotsm.lee@samsung.com>
drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-vra.c
drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.c

index 0b8c64ac2fb8e7fb8906bb1db010ace575dd8df2..ed6e4ebb5fd6bc2c86e7901f3022a2c9967c3f61 100644 (file)
@@ -243,24 +243,24 @@ static int fimc_is_hw_vra_ch1_handle_interrupt(u32 id, void *context)
                                atomic_set(&hw_ip->status.Vvalid, V_BLANK);
                                fimc_is_hw_vra_save_debug_info(hw_ip, lib_vra, DEBUG_POINT_FRAME_END);
 #ifdef ENABLE_REPROCESSING_FD
-                               if (instance != 0) {
-                                       set_bit(instance, &lib_vra->done_vra_hw_intr);
-
-                                       spin_lock(&lib_vra->reprocess_fd_lock);
-                                       if (test_bit(instance, &lib_vra->done_vra_hw_intr)
-                                               && test_bit(instance, &lib_vra->done_vra_callback_out_ready)) {
-                                               clear_bit(instance, &lib_vra->done_vra_callback_out_ready);
-                                               clear_bit(instance, &lib_vra->done_vra_hw_intr);
-                                               spin_unlock(&lib_vra->reprocess_fd_lock);
-
-                                               fimc_is_hardware_frame_done(hw_ip, NULL, -1,
-                                                       FIMC_IS_HW_CORE_END, IS_SHOT_SUCCESS, true);
-                                       } else
-                                               spin_unlock(&lib_vra->reprocess_fd_lock);
-                               } else
-#endif
+                               set_bit(instance, &lib_vra->done_vra_hw_intr);
+
+                               spin_lock(&lib_vra->reprocess_fd_lock);
+                               if (test_bit(instance, &lib_vra->done_vra_hw_intr)
+                                       && test_bit(instance, &lib_vra->done_vra_callback_out_ready)) {
+                                       clear_bit(instance, &lib_vra->done_vra_callback_out_ready);
+                                       clear_bit(instance, &lib_vra->done_vra_hw_intr);
+                                       spin_unlock(&lib_vra->reprocess_fd_lock);
+
                                        fimc_is_hardware_frame_done(hw_ip, NULL, -1,
                                                FIMC_IS_HW_CORE_END, IS_SHOT_SUCCESS, true);
+                               } else {
+                                       spin_unlock(&lib_vra->reprocess_fd_lock);
+                               }
+#else
+                               fimc_is_hardware_frame_done(hw_ip, NULL, -1,
+                                       FIMC_IS_HW_CORE_END, IS_SHOT_SUCCESS, true);
+#endif
                                wake_up(&hw_ip->status.wait_queue);
 
                                hw_ip->mframe = NULL;
index 28809ef0d2b2ac5f0eb7514e5d352eb7ea19a8c0..61a011a2432eb9dd8cfa5cf6f3529505a30841bc 100644 (file)
@@ -117,19 +117,18 @@ static void fimc_is_lib_vra_callback_final_output_ready(u32 instance,
 #endif
 
 #ifdef ENABLE_REPROCESSING_FD
-       if (instance != 0) {
-               spin_lock_irqsave(&lib_vra->reprocess_fd_lock, lib_vra->reprocess_fd_flag);
-               set_bit(instance, &lib_vra->done_vra_callback_out_ready);
-
-               if (test_bit(instance, &lib_vra->done_vra_hw_intr)
-                       && test_bit(instance, &lib_vra->done_vra_callback_out_ready)) {
-                       clear_bit(instance, &lib_vra->done_vra_callback_out_ready);
-                       clear_bit(instance, &lib_vra->done_vra_hw_intr);
-                       spin_unlock_irqrestore(&lib_vra->reprocess_fd_lock, lib_vra->reprocess_fd_flag);
-                       fimc_is_hardware_frame_done(lib_vra->hw_ip, NULL, -1,
-                               FIMC_IS_HW_CORE_END, IS_SHOT_SUCCESS, true);
-               } else
-                       spin_unlock_irqrestore(&lib_vra->reprocess_fd_lock, lib_vra->reprocess_fd_flag);
+       spin_lock_irqsave(&lib_vra->reprocess_fd_lock, lib_vra->reprocess_fd_flag);
+       set_bit(instance, &lib_vra->done_vra_callback_out_ready);
+
+       if (test_bit(instance, &lib_vra->done_vra_hw_intr)
+               && test_bit(instance, &lib_vra->done_vra_callback_out_ready)) {
+               clear_bit(instance, &lib_vra->done_vra_callback_out_ready);
+               clear_bit(instance, &lib_vra->done_vra_hw_intr);
+               spin_unlock_irqrestore(&lib_vra->reprocess_fd_lock, lib_vra->reprocess_fd_flag);
+               fimc_is_hardware_frame_done(lib_vra->hw_ip, NULL, -1,
+                       FIMC_IS_HW_CORE_END, IS_SHOT_SUCCESS, true);
+       } else {
+               spin_unlock_irqrestore(&lib_vra->reprocess_fd_lock, lib_vra->reprocess_fd_flag);
        }
 #endif
 }
@@ -198,22 +197,6 @@ static void fimc_is_lib_vra_callback_post_detect_ready(u32 instance,
                                faces_ptr[i].extra.rot, faces_ptr[i].extra.mirror_x,
                                faces_ptr[i].extra.hw_rot_and_mirror);
        }
-#ifdef ENABLE_REPROCESSING_FD
-       if (instance != 0) {
-               spin_lock_irqsave(&lib_vra->reprocess_fd_lock, lib_vra->reprocess_fd_flag);
-               set_bit(instance, &lib_vra->done_vra_callback_out_ready);
-
-               if (test_bit(instance, &lib_vra->done_vra_hw_intr)
-                       && test_bit(instance, &lib_vra->done_vra_callback_out_ready)) {
-                       clear_bit(instance, &lib_vra->done_vra_callback_out_ready);
-                       clear_bit(instance, &lib_vra->done_vra_hw_intr);
-                       spin_unlock_irqrestore(&lib_vra->reprocess_fd_lock, lib_vra->reprocess_fd_flag);
-                       fimc_is_hardware_frame_done(lib_vra->hw_ip, NULL, -1,
-                               FIMC_IS_HW_CORE_END, IS_SHOT_SUCCESS, true);
-               } else
-                       spin_unlock_irqrestore(&lib_vra->reprocess_fd_lock, lib_vra->reprocess_fd_flag);
-       }
-#endif
 }
 
 int fimc_is_lib_vra_set_post_detect_output(struct fimc_is_lib_vra *lib_vra,