소스 검색

Merge "msm: camera: isp: Acquire correct IFE & SFE" into camera-kernel.lnx.7.0

Camera Software Integration 1 년 전
부모
커밋
f718db2d53

+ 17 - 1
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -3659,6 +3659,14 @@ static int cam_ife_hw_mgr_acquire_csid_hw(
 				continue;
 			}
 
+			if (csid_caps->is_ife_sfe_mapped &&
+				(ife_ctx->ctx_type == CAM_IFE_CTX_TYPE_SFE) &&
+				!ife_hw_mgr->sfe_devices[hw_intf->hw_idx]) {
+				CAM_DBG(CAM_ISP, "No sfe_device with idx: %d, ctx_idx: %u",
+					hw_intf->hw_idx, ife_ctx->ctx_index);
+				continue;
+			}
+
 			rc = hw_intf->hw_ops.reserve(hw_intf->hw_priv,
 				csid_acquire, sizeof(*csid_acquire));
 			if (rc) {
@@ -3693,6 +3701,14 @@ static int cam_ife_hw_mgr_acquire_csid_hw(
 
 		compat_count++;
 
+		if (ife_hw_mgr->csid_hw_caps[hw_intf->hw_idx].is_ife_sfe_mapped &&
+			(ife_ctx->ctx_type == CAM_IFE_CTX_TYPE_SFE) &&
+			!ife_hw_mgr->sfe_devices[hw_intf->hw_idx]) {
+			CAM_DBG(CAM_ISP, "No sfe_device with idx: %d, ctx_idx: %u",
+				hw_intf->hw_idx, ife_ctx->ctx_index);
+			continue;
+		}
+
 		rc = hw_intf->hw_ops.reserve(hw_intf->hw_priv, csid_acquire,
 			sizeof(struct cam_csid_hw_reserve_resource_args));
 		if (!rc)

+ 2 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid860.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _CAM_IFE_CSID_860_H_
@@ -84,6 +84,7 @@ static struct cam_ife_csid_ver2_reg_info cam_ife_csid_860_reg_info = {
 	.width_fuse_max_val = 1,
 	.fused_max_dualife_width = {7296, 5344, UINT_MAX},
 	.fused_max_width = {7296, 7296, UINT_MAX},
+	.is_ife_sfe_mapped = true,
 };
 
 #endif /*_CAM_IFE_CSID_860_H_ */

+ 2 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid880.h

@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _CAM_IFE_CSID_880_H_
@@ -1508,5 +1508,6 @@ static struct cam_ife_csid_ver2_reg_info cam_ife_csid_880_reg_info = {
 	.num_path_err_irqs  = ARRAY_SIZE(cam_ife_csid_880_path_irq_desc),
 	.num_top_regs       = 1,
 	.num_rx_regs        = 1,
+	.is_ife_sfe_mapped  = true,
 };
 #endif /*_CAM_IFE_CSID_880_H_ */

+ 2 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/iopoll.h>
@@ -2427,6 +2427,7 @@ int cam_ife_csid_ver2_get_hw_caps(void *hw_priv,
 	hw_caps->is_lite = soc_private->is_ife_csid_lite;
 	hw_caps->sfe_ipp_input_rdi_res = csid_reg->cmn_reg->sfe_ipp_input_rdi_res;
 	hw_caps->camif_irq_support = csid_reg->cmn_reg->camif_irq_support;
+	hw_caps->is_ife_sfe_mapped = csid_reg->is_ife_sfe_mapped;
 
 	CAM_DBG(CAM_ISP,
 		"CSID:%u num-rdis:%d, num-pix:%d, major:%d minor:%d ver:%d",

+ 2 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.h

@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _CAM_IFE_CSID_HW_VER2_H_
@@ -747,6 +747,7 @@ struct cam_ife_csid_ver2_reg_info {
 	const uint32_t                                    fused_max_width[
 		   CAM_IFE_CSID_WIDTH_FUSE_VAL_MAX];
 	const uint32_t                                    width_fuse_max_val;
+	bool                                              is_ife_sfe_mapped;
 };
 
 /*

+ 2 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_lite860.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _CAM_IFE_CSID_LITE_860_H_
@@ -42,6 +42,7 @@ static struct cam_ife_csid_ver2_reg_info cam_ife_csid_lite_860_reg_info = {
 	.num_path_err_irqs  = ARRAY_SIZE(cam_ife_csid_lite_880_path_irq_desc),
 	.num_top_regs       = 1,
 	.num_rx_regs        = 1,
+	.is_ife_sfe_mapped  = true,
 };
 
 #endif /* _CAM_IFE_CSID_LITE_860_H_ */

+ 2 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_lite880.h

@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _CAM_IFE_CSID_LITE_880_H_
@@ -1067,5 +1067,6 @@ static struct cam_ife_csid_ver2_reg_info cam_ife_csid_lite_880_reg_info = {
 	.num_path_err_irqs  = ARRAY_SIZE(cam_ife_csid_lite_880_path_irq_desc),
 	.num_top_regs       = 1,
 	.num_rx_regs        = 1,
+	.is_ife_sfe_mapped  = true,
 };
 #endif /* _CAM_IFE_CSID_LITE_780_H_ */

+ 3 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h

@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _CAM_CSID_HW_INTF_H_
@@ -108,6 +108,7 @@ enum cam_ife_csid_secondary_evt_type {
  * @rup_en:                flag to indicate if rup is on csid side
  * @only_master_rup:       flag to indicate if only master RUP
  * @camif_irq_support:     flag to indicate if CSID supports CAMIF irq
+ * @is_ife_sfe_mapped:     flag to indicate if IFE & SFE are one-one mapped
  */
 struct cam_ife_csid_hw_caps {
 	uint32_t      num_rdis;
@@ -122,6 +123,7 @@ struct cam_ife_csid_hw_caps {
 	bool          rup_en;
 	bool          only_master_rup;
 	bool          camif_irq_support;
+	bool          is_ife_sfe_mapped;
 };
 
 struct cam_isp_out_port_generic_info {