Browse Source

Merge "msm: camera: isp: Fixing KW errors" into camera-kernel.lnx.5.0

Haritha Chintalapati 4 năm trước cách đây
mục cha
commit
6a2595de76

+ 12 - 2
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

@@ -2581,7 +2581,8 @@ static int cam_ife_hw_mgr_acquire_ife_src_for_sfe(
 			break;
 			break;
 	}
 	}
 
 
-	if (rc || !vfe_acquire.vfe_in.rsrc_node) {
+	if (i == CAM_IFE_HW_NUM_MAX || rc ||
+			!vfe_acquire.vfe_in.rsrc_node) {
 		CAM_ERR(CAM_ISP, "Unable to acquire LEFT IFE res: %d",
 		CAM_ERR(CAM_ISP, "Unable to acquire LEFT IFE res: %d",
 			vfe_acquire.vfe_in.res_id);
 			vfe_acquire.vfe_in.res_id);
 		return -EAGAIN;
 		return -EAGAIN;
@@ -5122,7 +5123,7 @@ static int cam_isp_blob_bw_update_v2(
 	struct cam_vfe_bw_update_args_v2       bw_upd_args;
 	struct cam_vfe_bw_update_args_v2       bw_upd_args;
 	struct cam_sfe_bw_update_args          sfe_bw_update_args;
 	struct cam_sfe_bw_update_args          sfe_bw_update_args;
 	int                                    rc = -EINVAL;
 	int                                    rc = -EINVAL;
-	uint32_t                               i, split_idx;
+	uint32_t                               i, split_idx = INT_MIN;
 	bool                                   nrdi_l_bw_updated = false;
 	bool                                   nrdi_l_bw_updated = false;
 	bool                                   nrdi_r_bw_updated = false;
 	bool                                   nrdi_r_bw_updated = false;
 
 
@@ -5178,6 +5179,11 @@ static int cam_isp_blob_bw_update_v2(
 		}
 		}
 	}
 	}
 
 
+	if (split_idx == CAM_ISP_HW_SPLIT_MAX || split_idx == INT_MIN) {
+		CAM_ERR(CAM_ISP, "Invalide hw res");
+		return -EINVAL;
+	}
+
 	nrdi_l_bw_updated = false;
 	nrdi_l_bw_updated = false;
 	nrdi_r_bw_updated = false;
 	nrdi_r_bw_updated = false;
 	list_for_each_entry(hw_mgr_res, &ctx->res_list_sfe_src, list) {
 	list_for_each_entry(hw_mgr_res, &ctx->res_list_sfe_src, list) {
@@ -8814,6 +8820,10 @@ static int cam_ife_hw_mgr_update_cmd_buffer(
 		if (!cmd_buf_count->csid_cnt)
 		if (!cmd_buf_count->csid_cnt)
 			return rc;
 			return rc;
 		res_list = &ctx->res_list_ife_csid;
 		res_list = &ctx->res_list_ife_csid;
+	}else {
+		CAM_ERR(CAM_ISP,
+			"Invalide hw_type=%d", ctx->base[base_idx].hw_type);
+		return -EINVAL;
 	}
 	}
 
 
 	if (!ctx->internal_cdm) {
 	if (!ctx->internal_cdm) {

+ 1 - 1
drivers/cam_isp/isp_hw_mgr/cam_isp_hw_mgr.h

@@ -11,7 +11,7 @@
 #include "cam_tasklet_util.h"
 #include "cam_tasklet_util.h"
 #include "cam_isp_hw.h"
 #include "cam_isp_hw.h"
 
 
-#define CAM_ISP_HW_NUM_MAX                       7
+#define CAM_ISP_HW_NUM_MAX                       8
 
 
 /**
 /**
  * struct cam_isp_hw_mgr_ctx - common acquired context for managers
  * struct cam_isp_hw_mgr_ctx - common acquired context for managers

+ 1 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver1.c

@@ -987,7 +987,7 @@ static int cam_ife_csid_ver1_stop_rdi_path(
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
-	if (res->res_id >= CAM_IFE_PIX_PATH_RES_MAX) {
+	if (res->res_id >= CAM_IFE_CSID_RDI_MAX) {
 		CAM_DBG(CAM_ISP, "CSID:%d Invalid res id%d",
 		CAM_DBG(CAM_ISP, "CSID:%d Invalid res id%d",
 			csid_hw->hw_intf->hw_idx, res->res_id);
 			csid_hw->hw_intf->hw_idx, res->res_id);
 		return -EINVAL;
 		return -EINVAL;