[COMMON] fimc-is2: Code cleanup related to ENABLE_HYBRID_FD
authorSunmi Lee <carrotsm.lee@samsung.com>
Mon, 11 Jun 2018 11:27:46 +0000 (20:27 +0900)
committerSunyoung Kang <sy0816.kang@samsung.com>
Mon, 23 Jul 2018 08:05:18 +0000 (17:05 +0900)
Change-Id: I76052de73f7f35083f5bcb9659c200c2b66b76ac
Signed-off-by: Sunmi Lee <carrotsm.lee@samsung.com>
drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-library.c
drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.c
drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-vra.h

index 508803f1d63f6a05de3e86491fe7acffe97bd77f..d94c96b29c284648f6a05056f25d8c973c467dd8 100644 (file)
@@ -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;
        }
 }
index 61a011a2432eb9dd8cfa5cf6f3529505a30841bc..023fec0930f0e025a5722b07ce49af0cf7303a93 100644 (file)
@@ -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]);
        }
index ec59774d64b572915c715bbd1251a4b531d8acc5..c0114f0d1a6784ddfd3f646974215c2adc789a75 100644 (file)
@@ -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);