Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dc92160 authored by Karthik Anantha Ram's avatar Karthik Anantha Ram Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: isp: Dynamic update of epoch0 line config



Currently epoch0 is configured to 20 lines from start of frame,
this change dynamically updates the configuration based on the
chosen sensor dimension for a given use case.

Change-Id: I66474c39ea19b83a2137e5f2417a2cef88164a5b
Signed-off-by: default avatarKarthik Anantha Ram <kartanan@codeaurora.org>
parent 1d993caf
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -204,6 +204,9 @@ static int cam_vfe_camif_resource_start(
{
	struct cam_vfe_mux_camif_data       *rsrc_data;
	uint32_t                             val = 0;
	uint32_t                             epoch0_irq_mask;
	uint32_t                             epoch1_irq_mask;
	uint32_t                             computed_epoch_line_cfg;

	if (!camif_res) {
		CAM_ERR(CAM_ISP, "Error! Invalid input arguments");
@@ -243,9 +246,16 @@ static int cam_vfe_camif_resource_start(
		rsrc_data->common_reg->module_ctrl[
		CAM_VFE_TOP_VER2_MODULE_STATS]->cgc_ovd);

	/* epoch config with 20 line */
	cam_io_w_mb(rsrc_data->reg_data->epoch_line_cfg,
	/* epoch config */
	epoch0_irq_mask = ((rsrc_data->last_line - rsrc_data->first_line) / 2) +
		rsrc_data->first_line;
	epoch1_irq_mask = rsrc_data->reg_data->epoch_line_cfg & 0xFFFF;
	computed_epoch_line_cfg = (epoch0_irq_mask << 16) | epoch1_irq_mask;
	cam_io_w_mb(computed_epoch_line_cfg,
		rsrc_data->mem_base + rsrc_data->camif_reg->epoch_irq);
	CAM_DBG(CAM_ISP, "first_line:%u last_line:%u epoch_line_cfg: 0x%x",
		rsrc_data->first_line, rsrc_data->last_line,
		computed_epoch_line_cfg);

	camif_res->res_state = CAM_ISP_RESOURCE_STATE_STREAMING;