[COMMON] fimc-is2: Implementation of newly added data in using shot_ext
authorSunmi Lee <carrotsm.lee@samsung.com>
Fri, 6 Jul 2018 08:14:51 +0000 (17:14 +0900)
committerSunyoung Kang <sy0816.kang@samsung.com>
Mon, 23 Jul 2018 08:06:18 +0000 (17:06 +0900)
In hw-3aa shot function, frame information for uvsp was written in shot_ext.
Also cal_data was saved in fimc_is_hardware in apply_setfile funciton.

PR JIRA ID: CPR-39

Change-Id: I19f79af152691aea5f1ddf73d75c7928145843e7
Signed-off-by: Sunmi Lee <carrotsm.lee@samsung.com>
drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-3aa.c
drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-control.h
drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.h

index cb151cf16b4855324df96fe23312b1bcc01b4afe..b0d0fda764e434a4707b1b8c0a741485396ce6bc 100644 (file)
@@ -283,6 +283,7 @@ static int fimc_is_hw_3aa_shot(struct fimc_is_hw_ip *hw_ip, struct fimc_is_frame
        struct is_region *region;
        struct taa_param *param;
        u32 lindex, hindex;
+       u32 input_w, input_h, crop_x, crop_y, output_w = 0, output_h = 0;
        bool frame_done = false;
 
        FIMC_BUG(!hw_ip);
@@ -357,6 +358,10 @@ static int fimc_is_hw_3aa_shot(struct fimc_is_hw_ip *hw_ip, struct fimc_is_frame
                lindex, hindex, frame->instance);
 
        /* DMA settings */
+       input_w = param_set->otf_input.bayer_crop_width;
+       input_h = param_set->otf_input.bayer_crop_height;
+       crop_x = param_set->otf_input.bayer_crop_offset_x;
+       crop_y = param_set->otf_input.bayer_crop_offset_y;
        if (param_set->dma_input.cmd != DMA_INPUT_COMMAND_DISABLE) {
                for (i = 0; i < frame->planes; i++) {
                        param_set->input_dva[i] = frame->dvaddr_buffer[i];
@@ -372,6 +377,10 @@ static int fimc_is_hw_3aa_shot(struct fimc_is_hw_ip *hw_ip, struct fimc_is_frame
                                        frame->instance, hw_ip, frame->fcount, i);
                        }
                }
+               input_w = param_set->dma_input.bayer_crop_width;
+               input_h = param_set->dma_input.bayer_crop_height;
+               crop_x = param_set->dma_input.bayer_crop_offset_x;
+               crop_y = param_set->dma_input.bayer_crop_offset_y;
        }
 
        if (param_set->dma_output_before_bds.cmd != DMA_OUTPUT_COMMAND_DISABLE) {
@@ -403,6 +412,8 @@ static int fimc_is_hw_3aa_shot(struct fimc_is_hw_ip *hw_ip, struct fimc_is_frame
                        }
 #endif
                }
+               output_w = param_set->dma_output_after_bds.width;
+               output_h = param_set->dma_output_after_bds.height;
        }
 
        if (param_set->dma_output_efd.cmd != DMA_OUTPUT_COMMAND_DISABLE) {
@@ -427,6 +438,20 @@ static int fimc_is_hw_3aa_shot(struct fimc_is_hw_ip *hw_ip, struct fimc_is_frame
                }
        }
 
+       if (frame->shot_ext) {
+               frame->shot_ext->binning_ratio_x = (u16)param_set->sensor_config.sensor_binning_ratio_x;
+               frame->shot_ext->binning_ratio_y = (u16)param_set->sensor_config.sensor_binning_ratio_y;
+               frame->shot_ext->crop_taa_x = crop_x;
+               frame->shot_ext->crop_taa_y = crop_y;
+               if (output_w && output_h) {
+                       frame->shot_ext->bds_ratio_x = (input_w / output_w);
+                       frame->shot_ext->bds_ratio_y = (input_h / output_h);
+               } else {
+                       frame->shot_ext->bds_ratio_x = 1;
+                       frame->shot_ext->bds_ratio_y = 1;
+               }
+       }
+
 config:
        param_set->instance_id = frame->instance;
        param_set->fcount = frame->fcount;
@@ -784,6 +809,8 @@ static int fimc_is_hw_3aa_apply_setfile(struct fimc_is_hw_ip *hw_ip, u32 scenari
        msinfo_hw("load cal data, position: %d, addr: 0x%lx \n", instance, hw_ip,
                                sensor_position, cal_addr);
        ret = fimc_is_lib_isp_load_cal_data(&hw_3aa->lib[instance], instance, cal_addr);
+       ret = fimc_is_lib_isp_get_cal_data(&hw_3aa->lib[instance], instance,
+               &hw_ip->hardware->cal_info[sensor_position], CAL_TYPE_LSC_UVSP);
 
        return ret;
 }
index b65b8a7a6399147664f70545c577104c19d330b7..4390c236252c9f28cb46cd869c423eaa0e05c46e 100644 (file)
@@ -141,6 +141,26 @@ enum fimc_is_setfile_type {
        SETFILE_MAX
 };
 
+enum cal_type {
+       CAL_TYPE_AF = 1,
+       CAL_TYPE_LSC_UVSP = 2,
+       CAL_TYPE_MAX
+};
+
+struct cal_info {
+       /* case CAL_TYPE_AF:
+        * Not implemented yet
+        */
+       /* case CLA_TYPE_LSC_UVSP
+        * data[0]: lsc_center_x;
+        * data[1]: lsc_center_y;
+        * data[2]: lsc_radial_biquad_a;
+        * data[3]: lsc_radial_biquad_b;
+        * data[4] - data[15]: reserved
+        */
+       u32 data[16];
+};
+
 struct hw_debug_info {
        u32                     fcount;
        u32                     cpuid[DEBUG_POINT_MAX];
@@ -358,6 +378,7 @@ struct fimc_is_hardware {
        /* for access mcuctl regs */
        void __iomem                    *base_addr_mcuctl;
 
+       struct cal_info                 cal_info[SENSOR_POSITION_END];
        atomic_t                        streaming[SENSOR_POSITION_END];
        atomic_t                        bug_count;
        atomic_t                        log_count;
index 5d581fa120f67e24b1a445bafc6e00956eaf1166..11f9c2499a937b6aa3a15149043ae456a71734fd 100644 (file)
@@ -185,10 +185,6 @@ struct lib_tune_set {
        int decrypt_flag;
 };
 
-struct cal_info {
-       u32 data[16];
-};
-
 #define LIB_ISP_ADDR           (DDK_LIB_ADDR + LIB_ISP_OFFSET)
 enum lib_func_type {
        LIB_FUNC_3AA = 1,