From: Sunmi Lee Date: Mon, 11 Jun 2018 11:27:46 +0000 (+0900) Subject: [COMMON] fimc-is2: Code cleanup related to ENABLE_HYBRID_FD X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=78429c91d4c237f7d7fb96677ca40ec2d21dff74;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] fimc-is2: Code cleanup related to ENABLE_HYBRID_FD Change-Id: I76052de73f7f35083f5bcb9659c200c2b66b76ac Signed-off-by: Sunmi Lee --- diff --git a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-library.c b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-library.c index 508803f1d63f..d94c96b29c28 100644 --- a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-library.c +++ b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-library.c @@ -1828,8 +1828,8 @@ static void fimc_is_get_hybrid_fd_data(u32 instance, return; } - if (lib_vra->post_detection_enable[instance]) { #ifdef ENABLE_HYBRID_FD + if (lib_vra->post_detection_enable[instance]) { struct fimc_is_lib_support *lib = &gPtr_lib_support; u32 offset_region; struct is_region *is_region; @@ -1887,8 +1887,9 @@ static void fimc_is_get_hybrid_fd_data(u32 instance, fd_in_size->height); spin_unlock_irqrestore(&fdae_info->slock, flags); + } else #endif - } else { + { face_data->face_num = 0; } } 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 61a011a2432e..023fec0930f0 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 @@ -220,8 +220,8 @@ int fimc_is_lib_vra_set_post_detect_output(struct fimc_is_lib_vra *lib_vra, return 0; } - #endif + static void fimc_is_lib_vra_callback_end_input(u32 instance, u32 frame_index, unsigned char *base_address) { @@ -480,6 +480,8 @@ int fimc_is_lib_vra_alloc_memory(struct fimc_is_lib_vra *lib_vra, ulong dma_addr alloc_info->max_tr_res_frames = 5; #if defined(ENABLE_HYBRID_FD) alloc_info->max_hybrid_faces = MAX_HYBRID_FACES; +#else + alloc_info->max_hybrid_faces = 0; #endif status = CALL_VRAOP(lib_vra, ex_get_memory_sizes, @@ -613,6 +615,10 @@ int fimc_is_lib_vra_init_frame_work(struct fimc_is_lib_vra *lib_vra, callbacks->frw_invoke_hybrid_pr_ptr = NULL; callbacks->frw_abort_hybrid_pr_ptr = NULL; callbacks->sen_post_detect_ready_ptr = fimc_is_lib_vra_callback_post_detect_ready; +#else + callbacks->frw_invoke_hybrid_pr_ptr = NULL; + callbacks->frw_abort_hybrid_pr_ptr = NULL; + callbacks->sen_post_detect_ready_ptr = NULL; #endif lib_vra->fr_work_init.hw_clock_freq_mhz = 533; /* Not used */ @@ -926,7 +932,9 @@ int fimc_is_lib_vra_stop_instance(struct fimc_is_lib_vra *lib_vra, u32 instance) } lib_vra->all_face_num[instance] = 0; +#ifdef ENABLE_HYBRID_FD lib_vra->pdt_all_face_num[instance] = 0; +#endif lib_vra->af_all_face_num[instance] = 0; clear_bit(VRA_INST_APPLY_TUNE_SET, &lib_vra->inst_state[instance]); @@ -959,7 +967,9 @@ int fimc_is_lib_vra_stop(struct fimc_is_lib_vra *lib_vra) for (i = 0; i < VRA_TOTAL_SENSORS; i++) { lib_vra->all_face_num[i] = 0; +#ifdef ENABLE_HYBRID_FD lib_vra->pdt_all_face_num[i] = 0; +#endif lib_vra->af_all_face_num[i] = 0; clear_bit(VRA_INST_APPLY_TUNE_SET, &lib_vra->inst_state[i]); } diff --git a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.h b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.h index ec59774d64b5..c0114f0d1a67 100644 --- a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.h +++ b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.h @@ -122,10 +122,12 @@ struct fimc_is_lib_vra_interface_funcs { enum api_vra_type (*frame_work_abort)(void *fr_obj_ptr, vra_boolean reset_tr_data_base); enum api_vra_type (*frame_work_terminate)(void *fr_obj_ptr); -#ifdef ENABLE_HYBRID_FD + /* The set_post_detect_output is added with the ENABLE_HYBRID_FD. + * This function was deprecated after including CNN hardware in VRA block. + * But, we keep this interface function for backward compatibility + */ enum api_vra_type (*set_post_detect_output)(void *sen_obj_ptr, vra_boolean post_detect_output); -#endif #ifdef ENABLE_VRA_CHANGE_SETFILE_PARSING int (*copy_tune_set)(void *sen_obj_ptr, vra_uint32 instance_id, struct lib_vra_tune_set *set); int (*apply_tune_set)(void *sen_obj_ptr, vra_uint32 instance_id, vra_uint32 index);