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

Commit d7c20bce authored by Karthik Anantha Ram's avatar Karthik Anantha Ram Committed by Venkat Chinta
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 9fdce6ca
Loading
Loading
Loading
Loading
+31 −9
Original line number Diff line number Diff line
@@ -773,19 +773,41 @@ int cam_ife_csid_cid_reserve(struct cam_ife_csid_hw *csid_hw,
		break;
	case CAM_CPAS_TITAN_480_V100:
	case CAM_CPAS_TITAN_580_V100:
		if (cid_reserv->in_port->cust_node == 1) {
			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;
@@ -828,7 +850,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;