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

Commit ce84e2ce authored by Mark Woh's avatar Mark Woh
Browse files

msm: camera: isp: Fixed dual ife stripe wm update



Added check in dual ife stripe update config to check
whether the port id is valid or not.  If not valid, we
will not update the config for that write master.

Change-Id: Ie76e58ed3304c1698e2029038390d2131153be7b
Signed-off-by: default avatarMark Woh <mwoh@codeaurora.org>
parent 064143a8
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -95,6 +95,8 @@ static int cam_isp_update_dual_config(
	struct cam_ife_hw_mgr_res                  *hw_mgr_res;
	struct cam_isp_resource_node               *res;
	struct cam_isp_hw_dual_isp_update_args      dual_isp_update_args;
	uint32_t                                    outport_id;
	uint32_t                                    ports_plane_idx;
	size_t                                      len = 0;
	uint32_t                                   *cpu_addr;
	uint32_t                                    i, j;
@@ -111,6 +113,14 @@ static int cam_isp_update_dual_config(
	dual_config = (struct cam_isp_dual_config *)cpu_addr;

	for (i = 0; i < dual_config->num_ports; i++) {

		if (i >= CAM_ISP_IFE_OUT_RES_MAX) {
			CAM_ERR(CAM_UTIL,
				"failed update for i:%d > size_isp_out:%d",
				i, size_isp_out);
			return -EINVAL;
		}

		hw_mgr_res = &res_list_isp_out[i];
		for (j = 0; j < CAM_ISP_HW_SPLIT_MAX; j++) {
			if (!hw_mgr_res->hw_res[j])
@@ -120,6 +130,20 @@ static int cam_isp_update_dual_config(
				continue;

			res = hw_mgr_res->hw_res[j];

			if (res->res_id < CAM_ISP_IFE_OUT_RES_BASE ||
				res->res_id >= CAM_ISP_IFE_OUT_RES_MAX)
				continue;

			outport_id = res->res_id & 0xFF;

			ports_plane_idx = (j * (dual_config->num_ports *
				CAM_PACKET_MAX_PLANES)) +
				(outport_id * CAM_PACKET_MAX_PLANES);

			if (dual_config->stripes[ports_plane_idx].port_id == 0)
				continue;

			dual_isp_update_args.split_id = j;
			dual_isp_update_args.res      = res;
			dual_isp_update_args.dual_cfg = dual_config;