Prechádzať zdrojové kódy

Merge "msm: camera: isp: Fix trigger for SFE overflow information print" into camera-kernel.lnx.5.0

Savita Patted 4 rokov pred
rodič
commit
12bfa5491f

+ 5 - 4
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

@@ -521,17 +521,18 @@ static int cam_ife_hw_mgr_notify_overflow(
 	for (i = 0; i < hw_mgr_ctx->num_base; i++) {
 
 		res_id = -1;
-		if (hw_mgr_ctx->base[i].idx != evt->hw_idx)
-			continue;
 
 		if (hw_mgr_ctx->base[i].hw_type == CAM_ISP_HW_TYPE_VFE) {
+			if (hw_mgr_ctx->base[i].idx != evt->hw_idx)
+				continue;
+
 			hw_if = g_ife_hw_mgr.ife_devices[evt->hw_idx]->hw_intf;
 			res_id = ife_res_id;
 		} else if (hw_mgr_ctx->base[i].hw_type == CAM_ISP_HW_TYPE_SFE) {
-			if (evt->in_core_type >= CAM_SFE_HW_NUM_MAX)
+			if (hw_mgr_ctx->base[i].idx != evt->in_core_idx)
 				continue;
 
-			hw_if = g_ife_hw_mgr.sfe_devices[evt->in_core_type];
+			hw_if = g_ife_hw_mgr.sfe_devices[evt->in_core_idx];
 			res_id = sfe_res_id;
 		} else {
 			continue;

+ 15 - 6
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c

@@ -868,6 +868,19 @@ static int cam_ife_csid_ver2_rx_top_half(
 	return 0;
 }
 
+static inline uint32_t cam_ife_csid_ver2_input_core_to_hw_idx(int core_sel)
+{
+	switch (core_sel) {
+	case CAM_IFE_CSID_INPUT_CORE_SEL_SFE_0: return 0;
+	case CAM_IFE_CSID_INPUT_CORE_SEL_SFE_1: return 1;
+	/**
+	 * For all invalid cases, return a very large value
+	 * that can never be a valid hw idx.
+	 */
+	default: return 0xFFFF;
+	}
+}
+
 static int cam_ife_csid_ver2_handle_event_err(
 	struct cam_ife_csid_ver2_hw  *csid_hw,
 	uint32_t                      irq_status,
@@ -903,13 +916,9 @@ static int cam_ife_csid_ver2_handle_event_err(
 			csid_hw->hw_intf->hw_idx, err_type, irq_status);
 	}
 
-	if (csid_hw->top_cfg.input_core_type == CAM_IFE_CSID_INPUT_CORE_SEL_SFE_0)
-		evt.in_core_type = 0;
-	else if (csid_hw->top_cfg.input_core_type == CAM_IFE_CSID_INPUT_CORE_SEL_SFE_1)
-		evt.in_core_type = 1;
+	evt.in_core_idx = cam_ife_csid_ver2_input_core_to_hw_idx(csid_hw->top_cfg.input_core_type);
 
-	csid_hw->event_cb(csid_hw->token,
-		CAM_ISP_HW_EVENT_ERROR, (void *)&evt);
+	csid_hw->event_cb(csid_hw->token, CAM_ISP_HW_EVENT_ERROR, (void *)&evt);
 
 	return 0;
 }

+ 2 - 2
drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_isp_hw.h

@@ -244,7 +244,7 @@ struct cam_isp_blanking_config {
  * @err_type:       Error type if any
  * @reg_val:        Any critical register value captured during irq handling
  * @hw_type:        Hw Type sending the event
- * @in_core_type:   Input core type if CSID error evt
+ * @in_core_idx:   Input core type if CSID error evt
  *
  */
 struct cam_isp_hw_event_info {
@@ -254,7 +254,7 @@ struct cam_isp_hw_event_info {
 	uint32_t                       err_type;
 	uint32_t                       reg_val;
 	uint32_t                       hw_type;
-	uint32_t                       in_core_type;
+	uint32_t                       in_core_idx;
 };
 
 /**