Forráskód Böngészése

msm: camera: isp: Reorganize IFE bus ver3 for v880

Update the correct WM idx for ALSC client for v880. The
change also removes dependency on comp group type for
buf done irq masking. The order is not maintained in HW
so breaking that assumption in SW, and making the buf done
irq bit mask as an array for comp groups.

CRs-Fixed: 3254772
Change-Id: I7ac1dcf4150761b2f6f124e389a5e5b1ea67bd83
Signed-off-by: Karthik Anantha Ram <[email protected]>
Karthik Anantha Ram 3 éve
szülő
commit
df3ff7d33b

+ 3 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe480.h

@@ -1604,7 +1604,9 @@ static struct cam_vfe_bus_ver3_hw_info vfe480_bus_hw_info = {
 	},
 
 	.num_comp_grp    = 14,
-	.comp_done_shift = 6,
+	.comp_done_shift = {
+		6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+	},
 	.top_irq_shift   = 7,
 	.support_consumed_addr = true,
 	.max_out_res = CAM_ISP_IFE_OUT_RES_BASE + 25,

+ 3 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe680.h

@@ -2237,7 +2237,9 @@ static struct cam_vfe_bus_ver3_hw_info vfe680_bus_hw_info = {
 	},
 	.num_comp_grp          = 17,
 	.support_consumed_addr = true,
-	.comp_done_shift       = 0,
+	.comp_done_shift = {
+		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+	},
 	.top_irq_shift         = 0,
 	.max_out_res           = CAM_ISP_IFE_OUT_RES_BASE + 33,
 	.pack_align_shift      = 5,

+ 3 - 7
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe780.h

@@ -1797,7 +1797,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.mid[0]        = 34,
 			.num_wm        = 1,
 			.line_based    = 1,
-			.bufdone_shift = 2,
 			.wm_idx        = {
 				23,
 			},
@@ -1813,7 +1812,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.mid[0]        = 35,
 			.num_wm        = 1,
 			.line_based    = 1,
-			.bufdone_shift = 2,
 			.wm_idx        = {
 				24,
 			},
@@ -1828,7 +1826,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.source_group  = CAM_VFE_BUS_VER3_SRC_GRP_4,
 			.mid[0]        = 36,
 			.num_wm        = 1,
-			.bufdone_shift = 2,
 			.line_based    = 1,
 			.wm_idx        = {
 				25,
@@ -1924,7 +1921,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.source_group  = CAM_VFE_BUS_VER3_SRC_GRP_1,
 			.mid[0]        = 8,
 			.num_wm        = 1,
-			.bufdone_shift = 2,
 			.wm_idx        = {
 				20,
 			},
@@ -2071,7 +2067,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.source_group  = CAM_VFE_BUS_VER3_SRC_GRP_1,
 			.mid[0]        = 9,
 			.num_wm        = 1,
-			.bufdone_shift = 2,
 			.wm_idx        = {
 				21,
 			},
@@ -2100,7 +2095,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.source_group  = CAM_VFE_BUS_VER3_SRC_GRP_1,
 			.mid[0]        = 10,
 			.num_wm        = 1,
-			.bufdone_shift = 2,
 			.wm_idx        = {
 				22,
 			},
@@ -2275,7 +2269,9 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 	},
 	.num_comp_grp          = 15,
 	.support_consumed_addr = true,
-	.comp_done_shift       = 0,
+	.comp_done_shift = {
+		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16,
+	},
 	.top_irq_shift         = 0,
 	.max_out_res           = CAM_ISP_IFE_OUT_RES_BASE + 36,
 	.pack_align_shift      = 5,

+ 4 - 8
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe880.h

@@ -1872,7 +1872,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.mid[0]        = 34,
 			.num_wm        = 1,
 			.line_based    = 1,
-			.bufdone_shift = 2,
 			.wm_idx        = {
 				23,
 			},
@@ -1888,7 +1887,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.mid[0]        = 35,
 			.num_wm        = 1,
 			.line_based    = 1,
-			.bufdone_shift = 2,
 			.wm_idx        = {
 				24,
 			},
@@ -1903,7 +1901,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.source_group  = CAM_VFE_BUS_VER3_SRC_GRP_4,
 			.mid[0]        = 36,
 			.num_wm        = 1,
-			.bufdone_shift = 2,
 			.line_based    = 1,
 			.wm_idx        = {
 				25,
@@ -1999,7 +1996,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.source_group  = CAM_VFE_BUS_VER3_SRC_GRP_1,
 			.mid[0]        = 8,
 			.num_wm        = 1,
-			.bufdone_shift = 2,
 			.wm_idx        = {
 				20,
 			},
@@ -2146,7 +2142,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.source_group  = CAM_VFE_BUS_VER3_SRC_GRP_1,
 			.mid[0]        = 9,
 			.num_wm        = 1,
-			.bufdone_shift = 2,
 			.wm_idx        = {
 				21,
 			},
@@ -2175,7 +2170,6 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.source_group  = CAM_VFE_BUS_VER3_SRC_GRP_1,
 			.mid[0]        = 10,
 			.num_wm        = 1,
-			.bufdone_shift = 2,
 			.wm_idx        = {
 				22,
 			},
@@ -2236,7 +2230,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.mid[0]        = 30,
 			.num_wm        = 1,
 			.wm_idx        = {
-				28,
+				27,
 			},
 			.name          = {
 				"STATS_ALSC",
@@ -2365,7 +2359,9 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 	},
 	.num_comp_grp          = 16,
 	.support_consumed_addr = true,
-	.comp_done_shift       = 0,
+	.comp_done_shift = {
+		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 11,
+	},
 	.top_irq_shift         = 0,
 	.max_out_res           = CAM_ISP_IFE_OUT_RES_BASE + 37,
 	.pack_align_shift      = 5,

+ 4 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe_lite48x.h

@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _CAM_VFE_LITE48x_H_
@@ -427,7 +428,9 @@ static struct cam_vfe_bus_ver3_hw_info vfe48x_bus_hw_info = {
 		},
 	},
 	.num_comp_grp    = 4,
-	.comp_done_shift = 4,
+	.comp_done_shift = {
+		4, 5, 6, 7,
+	},
 	.top_irq_shift   = 4,
 	.support_consumed_addr = true,
 	.max_out_res = CAM_ISP_IFE_OUT_RES_BASE + 25,

+ 4 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe_lite68x.h

@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 
@@ -552,7 +553,9 @@ static struct cam_vfe_bus_ver3_hw_info vfe680x_bus_hw_info = {
 	},
 	.num_comp_grp    = 5,
 	.support_consumed_addr = true,
-	.comp_done_shift = 0,
+	.comp_done_shift = {
+		0, 1, 2, 3, 4,
+	},
 	.top_irq_shift   = 0,
 	.max_out_res = CAM_ISP_IFE_OUT_RES_BASE + 33,
 };

+ 4 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe_lite78x.h

@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 
@@ -547,7 +548,9 @@ static struct cam_vfe_bus_ver3_hw_info vfe_lite78x_bus_hw_info = {
 	},
 	.num_comp_grp    = 5,
 	.support_consumed_addr = true,
-	.comp_done_shift = 0,
+	.comp_done_shift = {
+		0, 1, 2, 3, 4,
+	},
 	.top_irq_shift   = 0,
 	.max_out_res = CAM_ISP_IFE_OUT_RES_BASE + 34,
 };

+ 3 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe_lite88x.h

@@ -455,7 +455,9 @@ static struct cam_vfe_bus_ver3_hw_info vfe_lite88x_bus_hw_info = {
 	},
 	.num_comp_grp    = 5,
 	.support_consumed_addr = true,
-	.comp_done_shift = 0,
+	.comp_done_shift = {
+		0, 1, 2, 3, 4,
+	},
 	.top_irq_shift   = 0,
 	.max_out_res = CAM_ISP_IFE_OUT_RES_BASE + 34,
 };

+ 5 - 15
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c

@@ -96,7 +96,6 @@ struct cam_vfe_bus_ver3_common_data {
 	uint32_t                                    secure_mode;
 	uint32_t                                    num_sec_out;
 	uint32_t                                    addr_no_sync;
-	uint32_t                                    comp_done_shift;
 	uint32_t                                    supported_irq;
 	bool                                        comp_config_needed;
 	bool                                        is_lite;
@@ -161,6 +160,7 @@ struct cam_vfe_bus_ver3_comp_grp_data {
 	struct cam_vfe_bus_ver3_common_data         *common_data;
 
 	uint64_t                                     composite_mask;
+	uint32_t                                     comp_done_shift;
 	uint32_t                                     is_master;
 	uint32_t                                     is_dual;
 	uint32_t                                     dual_slave_core;
@@ -175,7 +175,6 @@ struct cam_vfe_bus_ver3_comp_grp_data {
 struct cam_vfe_bus_ver3_vfe_out_data {
 	uint32_t                              out_type;
 	uint32_t                              source_group;
-	uint32_t                              buf_done_mask_shift;
 	struct cam_vfe_bus_ver3_common_data  *common_data;
 	struct cam_vfe_bus_ver3_priv         *bus_priv;
 
@@ -1815,10 +1814,7 @@ skip_comp_cfg:
 			common_data->common_reg->ubwc_static_ctrl);
 	}
 
-	bus_irq_reg_mask[CAM_VFE_BUS_VER3_IRQ_REG0] =
-		(0x1 << (rsrc_data->comp_grp_type +
-		vfe_out_data->buf_done_mask_shift +
-		rsrc_data->common_data->comp_done_shift));
+	bus_irq_reg_mask[CAM_VFE_BUS_VER3_IRQ_REG0] = BIT(rsrc_data->comp_done_shift);
 
 	CAM_DBG(CAM_ISP, "Start Done VFE:%d comp_grp:%d bus_irq_mask_0: 0x%X",
 		rsrc_data->common_data->core_index,
@@ -1869,9 +1865,7 @@ static int cam_vfe_bus_ver3_handle_comp_done_bottom_half(
 	cam_ife_irq_regs = evt_payload->irq_reg_val;
 	status_0 = cam_ife_irq_regs[CAM_IFE_IRQ_BUS_VER3_REG_STATUS0];
 
-	if (status_0 & BIT(rsrc_data->comp_grp_type +
-		vfe_out->buf_done_mask_shift +
-		rsrc_data->common_data->comp_done_shift)) {
+	if (status_0 & BIT(rsrc_data->comp_done_shift)) {
 		evt_payload->evt_id = CAM_ISP_HW_EVENT_DONE;
 		rc = CAM_VFE_IRQ_STATUS_SUCCESS;
 	}
@@ -1908,6 +1902,7 @@ static int cam_vfe_bus_ver3_init_comp_grp(uint32_t index,
 	rsrc_data->comp_grp_type   = index;
 	rsrc_data->common_data     = &ver3_bus_priv->common_data;
 	rsrc_data->dual_slave_core = CAM_VFE_BUS_VER3_VFE_CORE_MAX;
+	rsrc_data->comp_done_shift = ver3_hw_info->comp_done_shift[index];
 
 	if (rsrc_data->comp_grp_type != CAM_VFE_BUS_VER3_COMP_GRP_0 &&
 		rsrc_data->comp_grp_type != CAM_VFE_BUS_VER3_COMP_GRP_1)
@@ -2404,8 +2399,7 @@ static int cam_vfe_bus_ver3_handle_vfe_out_done_top_half(uint32_t evt_id,
 
 	status_0 = th_payload->evt_status_arr[CAM_IFE_IRQ_BUS_VER3_REG_STATUS0];
 
-	if (status_0 & BIT(resource_data->comp_grp_type +
-		rsrc_data->common_data->comp_done_shift)) {
+	if (status_0 & BIT(resource_data->comp_done_shift)) {
 		trace_cam_log_event("bufdone", "bufdone_IRQ",
 			status_0, resource_data->comp_grp_type);
 	}
@@ -2559,8 +2553,6 @@ static int cam_vfe_bus_ver3_init_vfe_out_resource(uint32_t  index,
 
 	rsrc_data->source_group =
 		ver3_hw_info->vfe_out_hw_info[index].source_group;
-	rsrc_data->buf_done_mask_shift =
-		ver3_hw_info->vfe_out_hw_info[index].bufdone_shift;
 	rsrc_data->out_type     =
 		ver3_hw_info->vfe_out_hw_info[index].vfe_out_type;
 	rsrc_data->common_data  = &ver3_bus_priv->common_data;
@@ -4462,8 +4454,6 @@ int cam_vfe_bus_ver3_init(
 	bus_priv->common_data.hw_intf            = hw_intf;
 	bus_priv->common_data.vfe_irq_controller = vfe_irq_controller;
 	bus_priv->common_data.common_reg         = &ver3_hw_info->common_reg;
-	bus_priv->common_data.comp_done_shift    =
-		ver3_hw_info->comp_done_shift;
 	bus_priv->common_data.hw_init            = false;
 
 	bus_priv->common_data.is_lite = soc_private->is_ife_lite;

+ 2 - 3
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.h

@@ -193,10 +193,9 @@ struct cam_vfe_bus_ver3_vfe_out_hw_info {
 	uint32_t                            max_width;
 	uint32_t                            max_height;
 	uint32_t                            source_group;
-	uint32_t                         mid[CAM_VFE_BUS_VER3_MAX_MID_PER_PORT];
+	uint32_t                            mid[CAM_VFE_BUS_VER3_MAX_MID_PER_PORT];
 	uint32_t                            num_wm;
 	uint32_t                            line_based;
-	uint32_t                            bufdone_shift;
 	uint32_t                            wm_idx[PLANE_MAX];
 	uint8_t                            *name[PLANE_MAX];
 };
@@ -234,7 +233,7 @@ struct cam_vfe_bus_ver3_hw_info {
 	struct cam_vfe_constraint_error_info
 		constraint_error_list[CAM_VFE_BUS_VER3_CONS_ERR_MAX];
 	uint32_t num_comp_grp;
-	uint32_t comp_done_shift;
+	uint32_t comp_done_shift[CAM_VFE_BUS_VER3_COMP_GRP_MAX];
 	uint32_t top_irq_shift;
 	bool support_consumed_addr;
 	uint32_t max_out_res;