From cef3245a5c1ebd62b807cbb11af755b5b1cc672d Mon Sep 17 00:00:00 2001 From: Sunmi Lee Date: Fri, 8 Jun 2018 13:52:45 +0900 Subject: [PATCH] [COMMON] fimc-is2: Code cleanup related to ENABLE_REPROCESSING_FD Change-Id: I7b06ef08fd4e14ee85330185295b565b9280aa55 Signed-off-by: Sunmi Lee --- .../exynos/fimc-is2/hardware/fimc-is-hw-vra.c | 32 +++++++-------- .../interface/fimc-is-interface-vra.c | 41 ++++++------------- 2 files changed, 28 insertions(+), 45 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-vra.c b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-vra.c index 0b8c64ac2fb8..ed6e4ebb5fd6 100644 --- a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-vra.c +++ b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-vra.c @@ -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; diff --git a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.c b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.c index 28809ef0d2b2..61a011a2432e 100644 --- a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.c +++ b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.c @@ -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, -- 2.20.1