From: Sunmi Lee Date: Fri, 6 Jul 2018 08:14:51 +0000 (+0900) Subject: [COMMON] fimc-is2: Implementation of newly added data in using shot_ext X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cb44a69a540bf61f6fcefd728d575377ac3bea7f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] fimc-is2: Implementation of newly added data in using shot_ext 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 --- diff --git a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-3aa.c b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-3aa.c index cb151cf16b48..b0d0fda764e4 100644 --- a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-3aa.c +++ b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-3aa.c @@ -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; } diff --git a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-control.h b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-control.h index b65b8a7a6399..4390c236252c 100644 --- a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-control.h +++ b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-control.h @@ -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; diff --git a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.h b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.h index 5d581fa120f6..11f9c2499a93 100644 --- a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.h +++ b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.h @@ -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,