Parcourir la source

msm: camera: Add LCR in axi bw vote and checks for memory free

Adding LCR resource id in isp bw voting for axi bw voting v1 path
and v2 path. Also, adding checks for unwanted memory free during
cpas probe.

Change-Id: Ib3dca34727b640326893fb227b160a42dab457fc
Signed-off-by: Mukund Madhusudan Atre <[email protected]>
Mukund Madhusudan Atre il y a 6 ans
Parent
commit
396a4cc576
2 fichiers modifiés avec 17 ajouts et 32 suppressions
  1. 9 4
      drivers/cam_cpas/cam_cpas_soc.c
  2. 8 28
      drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

+ 9 - 4
drivers/cam_cpas/cam_cpas_soc.c

@@ -102,12 +102,17 @@ int cam_cpas_node_tree_cleanup(struct cam_cpas *cpas_core,
 	}
 
 	for (i = 0; i < CAM_CPAS_MAX_TREE_LEVELS; i++) {
-		of_node_put(soc_private->level_node[i]);
-		soc_private->level_node[i] = NULL;
+		if (soc_private->level_node[i]) {
+			of_node_put(soc_private->level_node[i]);
+			soc_private->level_node[i] = NULL;
+		}
+	}
+
+	if (soc_private->camera_bus_node) {
+		of_node_put(soc_private->camera_bus_node);
+		soc_private->camera_bus_node = NULL;
 	}
 
-	of_node_put(soc_private->camera_bus_node);
-	soc_private->camera_bus_node = NULL;
 	mutex_destroy(&cpas_core->tree_lock);
 
 	return 0;

+ 8 - 28
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

@@ -2715,7 +2715,8 @@ static int cam_isp_classify_vote_info(
 
 	if ((hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF)
 		|| (hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_RD) ||
-		(hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_PDLIB)) {
+		(hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_PDLIB) ||
+		(hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_LCR)) {
 		if (split_idx == CAM_ISP_HW_SPLIT_LEFT) {
 			if (*camif_l_bw_updated)
 				return rc;
@@ -2890,8 +2891,11 @@ static int cam_isp_blob_bw_update(
 			if (!hw_mgr_res->hw_res[i])
 				continue;
 
-			if ((hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF)
-			|| (hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_RD))
+			if ((hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF) ||
+				(hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_RD) ||
+				(hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_PDLIB)
+				|| (hw_mgr_res->res_id ==
+				CAM_ISP_HW_VFE_IN_LCR))
 				if (i == CAM_ISP_HW_SPLIT_LEFT) {
 					if (camif_l_bw_updated)
 						continue;
@@ -2925,32 +2929,8 @@ static int cam_isp_blob_bw_update(
 					bw_config->rdi_vote[idx].cam_bw_bps;
 				ext_bw_bps =
 					bw_config->rdi_vote[idx].ext_bw_bps;
-			} else if (hw_mgr_res->res_id ==
-				CAM_ISP_HW_VFE_IN_PDLIB) {
-				if (i == CAM_ISP_HW_SPLIT_LEFT) {
-					if (camif_l_bw_updated)
-						continue;
-
-					cam_bw_bps =
-					bw_config->left_pix_vote.cam_bw_bps;
-					ext_bw_bps =
-					bw_config->left_pix_vote.ext_bw_bps;
-
-					camif_l_bw_updated = true;
-				} else {
-					if (camif_r_bw_updated)
-						continue;
-
-					cam_bw_bps =
-					bw_config->right_pix_vote.cam_bw_bps;
-					ext_bw_bps =
-					bw_config->right_pix_vote.ext_bw_bps;
-
-					camif_r_bw_updated = true;
-				}
 			} else {
-				if (hw_mgr_res->res_id != CAM_ISP_HW_VFE_IN_LCR
-					&& hw_mgr_res->hw_res[i]) {
+				if (hw_mgr_res->hw_res[i]) {
 					CAM_ERR(CAM_ISP, "Invalid res_id %u",
 						hw_mgr_res->res_id);
 					rc = -EINVAL;