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

Commit bb7f28b7 authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: isp: Return error if cdm acquire fails" into dev/msm-4.9-camx

parents 55d8186d 35868804
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -1271,15 +1271,16 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv,

	cdm_acquire.id = CAM_CDM_VIRTUAL;
	cdm_acquire.cam_cdm_callback = cam_ife_cam_cdm_callback;
	if (!cam_cdm_acquire(&cdm_acquire)) {
	rc = cam_cdm_acquire(&cdm_acquire);
	if (rc) {
		CAM_ERR(CAM_ISP, "Failed to acquire the CDM HW");
		goto free_ctx;
	}

	CAM_DBG(CAM_ISP, "Successfully acquired the CDM HW hdl=%x",
		cdm_acquire.handle);
	ife_ctx->cdm_handle = cdm_acquire.handle;
	ife_ctx->cdm_ops = cdm_acquire.ops;
	} else {
		CAM_ERR(CAM_ISP, "Failed to acquire the CDM HW");
		goto err;
	}

	isp_resource = (struct cam_isp_resource *)acquire_args->acquire_info;

@@ -1325,7 +1326,7 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv,
	rc = cam_ife_mgr_process_base_info(ife_ctx);
	if (rc) {
		CAM_ERR(CAM_ISP, "Process base info failed");
		return -EINVAL;
		goto free_res;
	}

	acquire_args->ctxt_to_hw_map = ife_ctx;
@@ -1338,6 +1339,8 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv,
	return 0;
free_res:
	cam_ife_hw_mgr_release_hw_for_ctx(ife_ctx);
	cam_cdm_release(ife_ctx->cdm_handle);
free_ctx:
	cam_ife_hw_mgr_put_ctx(&ife_hw_mgr->free_ctx_list, &ife_ctx);
err:
	CAM_DBG(CAM_ISP, "Exit...(rc=%d)", rc);