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

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

msm: camera: isp: Add check for cid acquire



This change adds a check to validate the cid being acquired,
when custom HW is in the pipeline.

CRs-Fixed: 2524308
Change-Id: I32913e74bc946a4333f77f5e10757c4bd51eab67
Signed-off-by: default avatarKarthik Anantha Ram <kartanan@codeaurora.org>
parent 2269448c
Loading
Loading
Loading
Loading
+33 −13
Original line number Diff line number Diff line
@@ -771,21 +771,41 @@ int cam_ife_csid_cid_reserve(struct cam_ife_csid_hw *csid_hw,
		}
		break;
	case CAM_CPAS_TITAN_480_V100:

		if (cid_reserv->in_port->cust_node != 1)
			break;

		if (cid_reserv->in_port->usage_type == 1) {
			CAM_ERR(CAM_ISP, "Dual IFE is not supported");
		/*
		 * Assigning existing two IFEs for custom in KONA,
		 * this needs to be addressed accordingly for
		 * upcoming targets
		 */
		if (cid_reserv->in_port->cust_node) {
			if (cid_reserv->in_port->usage_type ==
				CAM_ISP_RES_USAGE_DUAL) {
				CAM_ERR(CAM_ISP,
					"Dual IFE is not supported for cust_node %u",
					cid_reserv->in_port->cust_node);
				rc = -EINVAL;
				goto end;
			}

			if (cid_reserv->in_port->cust_node ==
				CAM_ISP_ACQ_CUSTOM_PRIMARY) {
				if (csid_hw->hw_intf->hw_idx != 0) {
			CAM_DBG(CAM_ISP, "CSID%d not eligible",
					CAM_ERR(CAM_ISP, "CSID%d not eligible",
						csid_hw->hw_intf->hw_idx);
					rc = -EINVAL;
					goto end;
				}
			}

			if (cid_reserv->in_port->cust_node ==
				CAM_ISP_ACQ_CUSTOM_SECONDARY) {
				if (csid_hw->hw_intf->hw_idx != 1) {
					CAM_ERR(CAM_ISP, "CSID%d not eligible",
						csid_hw->hw_intf->hw_idx);
					rc = -EINVAL;
					goto end;
				}
			}
		}
		break;
	default:
		break;
@@ -831,7 +851,7 @@ int cam_ife_csid_cid_reserve(struct cam_ife_csid_hw *csid_hw,
	case CAM_IFE_PIX_PATH_RES_IPP:
		if (csid_hw->ipp_res.res_state !=
			CAM_ISP_RESOURCE_STATE_AVAILABLE) {
			CAM_DBG(CAM_ISP,
			CAM_ERR(CAM_ISP,
				"CSID:%d IPP resource not available",
				csid_hw->hw_intf->hw_idx);
			rc = -EINVAL;