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

Commit 428dd925 authored by YUE CHEN's avatar YUE CHEN
Browse files

msm: ais: program decode fmt of IPP for crop



If enable crop feature, need program thedecode format
of IPP_CFG0 as per RDIs which use the same vc in case
of one camera multiple streams.

Change-Id: I026b0154d37166e7f4294069f9c53088ee3feb09
Signed-off-by: default avatarYUE CHEN <yueche@codeaurora.org>
parent 560e9929
Loading
Loading
Loading
Loading
+42 −4
Original line number Diff line number Diff line
@@ -1078,6 +1078,8 @@ static int cam_ife_csid_enable_hw(struct cam_ife_csid_hw *csid_hw)
		goto err;
	}

	memset(csid_hw->vc_info, 0xff, sizeof(csid_hw->vc_info));

	csid_hw->hw_info->hw_state = CAM_HW_STATE_POWER_UP;
	/* Reset CSID top */
	rc = cam_ife_csid_global_reset(csid_hw);
@@ -2063,7 +2065,8 @@ static int cam_ife_csid_init_config_rdi_path(
	struct cam_ife_csid_path_cfg           *path_data;
	const struct cam_ife_csid_reg_offset   *csid_reg;
	struct cam_hw_soc_info                 *soc_info;
	uint32_t path_format = 0, plain_fmt = 0, val = 0, id, in_bpp = 0;
	uint32_t path_format = 0, plain_fmt = 0, val = 0, id, in_bpp = 0,
		i = 0, tmp = 0;
	uint32_t format_measure_addr;

	path_data = (struct cam_ife_csid_path_cfg *) res->res_priv;
@@ -2182,6 +2185,28 @@ static int cam_ife_csid_init_config_rdi_path(
	/* Enable the RPP path */
	val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
		csid_reg->rdi_reg[id]->csid_rdi_cfg0_addr);

	/* program the IPP CFG0 for full IFE in case of crop*/
	if ((csid_hw->hw_intf->hw_idx == 0 ||
		csid_hw->hw_intf->hw_idx == 1) && path_data->crop_enable &&
		csid_hw->ipp_cfg == false) {
		for (i = 0; i < CAM_IFE_PIX_PATH_RES_RDI_3; i++) {
			/*checking for multiple streams of same VC*/
			if (csid_hw->vc_info[i] == path_data->vc) {
				tmp = path_format <<
					csid_reg->cmn_reg->fmt_shift_val;

				cam_io_w_mb(tmp, soc_info->reg_map[0].mem_base +
					csid_reg->ipp_reg->csid_pxl_cfg0_addr);

				csid_hw->ipp_cfg = true;
				break;
			}
		}
	}

	csid_hw->vc_info[id] = path_data->vc;

	val |= (1 << csid_reg->cmn_reg->path_en_shift_val);

	if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_HBI_VBI_INFO)
@@ -2236,11 +2261,13 @@ static int cam_ife_csid_deinit_rdi_path(
	struct cam_ife_csid_hw          *csid_hw,
	struct cam_isp_resource_node    *res)
{
	int rc = 0;
	int rc = 0, i = 0;
	uint32_t id, val, format_measure_addr;
	const struct cam_ife_csid_reg_offset      *csid_reg;
	struct cam_hw_soc_info                    *soc_info;
	struct cam_ife_csid_path_cfg              *path_data;

	path_data = (struct cam_ife_csid_path_cfg *) res->res_priv;
	csid_reg = csid_hw->csid_info->csid_reg;
	soc_info = &csid_hw->hw_info->soc_info;
	id = res->res_id;
@@ -2272,6 +2299,16 @@ static int cam_ife_csid_deinit_rdi_path(
			format_measure_addr);
	}

	csid_hw->vc_info[id] = 0xff;

	for (i = 0; i < CAM_IFE_PIX_PATH_RES_RDI_3; i++) {
		if (csid_hw->vc_info[i] == path_data->vc &&
			csid_hw->ipp_cfg == true) {
			csid_hw->ipp_cfg = false;
			break;
		}
	}

	res->res_state = CAM_ISP_RESOURCE_STATE_RESERVED;
	return rc;
}
@@ -2398,6 +2435,7 @@ static int cam_ife_csid_disable_rdi_path(
	cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
		csid_reg->rdi_reg[id]->csid_rdi_ctrl_addr);


	return rc;
}

+3 −1
Original line number Diff line number Diff line
@@ -553,9 +553,11 @@ struct cam_ife_csid_hw {
	uint64_t                         clk_rate;
	struct cam_isp_sensor_dimension  ipp_path_config;
	struct cam_isp_sensor_dimension  ppp_path_config;
	struct cam_isp_sensor_dimension  rdi_path_config[4];
	struct cam_isp_sensor_dimension  rdi_path_config[CAM_IFE_CSID_RDI_MAX];
	uint32_t                         hbi;
	uint32_t                         vbi;
	uint32_t                         vc_info[CAM_IFE_CSID_RDI_MAX];
	bool                             ipp_cfg;
	bool                             sof_irq_triggered;
	uint32_t                         irq_debug_cnt;
	uint32_t                         error_irq_count;