Jelajahi Sumber

msm: camera: isp: Add support for IFE epoch config

Add support to configure IFE epoch for SFE QCFA HDR
or binning use-cases.

CRs-Fixed: 2841729
Change-Id: I958656ddbe4e28d3247e317b021da5e963b03679
Signed-off-by: Karthik Anantha Ram <[email protected]>
Karthik Anantha Ram 4 tahun lalu
induk
melakukan
933cf650a1

+ 2 - 0
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

@@ -4280,6 +4280,8 @@ static int cam_ife_mgr_acquire_get_unified_structure_v2(
 		                           CAM_ISP_DYNAMIC_SENOR_SWITCH_EN);
 	in_port->can_use_lite             =  in->feature_flag &
 						CAM_ISP_CAN_USE_LITE_MODE;
+	in_port->sfe_binned_epoch_cfg     = (in->feature_flag &
+		CAM_ISP_SFE_BINNED_EPOCH_CFG_ENABLE);
 
 	in_port->data = kcalloc(in->num_out_res,
 		sizeof(struct cam_isp_out_port_generic_info),

+ 1 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h

@@ -135,6 +135,7 @@ struct cam_isp_in_port_generic_info {
 	uint32_t                        secure_mode;
 	uint32_t                        dynamic_sensor_switch_en;
 	uint32_t                        can_use_lite;
+	uint32_t                        sfe_binned_epoch_cfg;
 	struct cam_isp_out_port_generic_info    *data;
 };
 

+ 5 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c

@@ -64,6 +64,7 @@ struct cam_vfe_mux_ver4_data {
 	bool                               is_offline;
 
 	bool                               is_pixel_path;
+	bool                               sfe_binned_epoch_cfg;
 
 	struct timespec64                     sof_ts;
 	struct timespec64                     epoch_ts;
@@ -373,6 +374,8 @@ int cam_vfe_top_acquire_resource(
 		acquire_data->vfe_in.in_port->horizontal_bin;
 	res_data->vbi_value      = 0;
 	res_data->hbi_value      = 0;
+	res_data->sfe_binned_epoch_cfg = (bool)
+		acquire_data->vfe_in.in_port->sfe_binned_epoch_cfg;
 
 	if (res_data->is_dual)
 		res_data->dual_hw_idx = acquire_data->vfe_in.dual_hw_idx;
@@ -1023,7 +1026,8 @@ static int cam_vfe_resource_start(
 	/* Epoch line cfg will still be configured at midpoint of the frame width.
 	 * We use '/4' instead of '/2' because it is multipixel path.
 	 */
-	if (rsrc_data->horizontal_bin || rsrc_data->qcfa_bin)
+	if (rsrc_data->horizontal_bin || rsrc_data->qcfa_bin ||
+		rsrc_data->sfe_binned_epoch_cfg)
 		val >>= 1;
 
 	cam_io_w_mb(val, rsrc_data->mem_base +

+ 1 - 0
include/uapi/camera/media/cam_isp.h

@@ -169,6 +169,7 @@
 #define CAM_ISP_PARAM_FETCH_SECURITY_MODE      BIT(0)
 #define CAM_ISP_CAN_USE_LITE_MODE              BIT(1)
 #define CAM_ISP_DYNAMIC_SENOR_SWITCH_EN        BIT(2)
+#define CAM_ISP_SFE_BINNED_EPOCH_CFG_ENABLE    BIT(3)
 
 /* ISP core cfg flag params */
 #define CAM_ISP_PARAM_CORE_CFG_HDR_MUX_SEL BIT(0)