浏览代码

Merge "msm: camera: isp: Fix logic to get correct bus port on page fault" into camera-kernel.lnx.7.0

Camera Software Integration 1 年之前
父节点
当前提交
6c0e1c6d17

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

@@ -13711,6 +13711,7 @@ static void cam_ife_mgr_pf_dump_mid_info(
 	int                                 rc = 0;
 
 	get_res.mid = hw_cmd_args->u.pf_cmd_args->pf_args->pf_smmu_info->mid;
+	get_res.pid = hw_cmd_args->u.pf_cmd_args->pf_args->pf_smmu_info->pid;
 	cmd_update.cmd_type = CAM_ISP_HW_CMD_GET_RES_FOR_MID;
 	cmd_update.data = (void *) &get_res;
 

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

@@ -436,11 +436,13 @@ struct cam_isp_hw_get_wm_update {
  * @Brief:           Get the out resource id for given mid
  *
  * @mid:             Mid number of hw outport numb
+ * @pid:             Pid number associated with mid
  * @out_res_id:      Out resource id
  *
  */
 struct cam_isp_hw_get_res_for_mid {
 	uint32_t                       mid;
+	uint32_t                       pid;
 	uint32_t                       out_res_id;
 };
 

+ 24 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe780.h

@@ -1876,6 +1876,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"RDI_0",
 			},
+			.pid_mask      = 0x700,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_RDI1,
@@ -1892,6 +1893,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"RDI_1",
 			},
+			.pid_mask      = 0x700,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_RDI2,
@@ -1908,6 +1910,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"RDI_2",
 			},
+			.pid_mask      = 0x700,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_FULL,
@@ -1925,6 +1928,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 				"FULL_Y",
 				"FULL_C",
 			},
+			.pid_mask      = 0x70000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_DS4,
@@ -1940,6 +1944,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"DS_4",
 			},
+			.pid_mask      = 0x70000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_DS16,
@@ -1955,6 +1960,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"DS_16",
 			},
+			.pid_mask      = 0x70000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_RAW_DUMP,
@@ -1970,6 +1976,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"PIXEL_RAW",
 			},
+			.pid_mask      = 0x700,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_FD,
@@ -1987,6 +1994,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 				"FD_Y",
 				"FD_C",
 			},
+			.pid_mask      = 0x70000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_2PD,
@@ -2002,6 +2010,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"PDAF_0_2PD",
 			},
+			.pid_mask      = 0x7000000,
 		},
 		{
 			.vfe_out_type  =
@@ -2018,6 +2027,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"STATS_TL_BG",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_CAF,
@@ -2033,6 +2043,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"STATS_BF",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_AWB_BG,
@@ -2048,6 +2059,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"STATS_AWB_BGB",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_BHIST,
@@ -2063,6 +2075,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"STATS_BHIST",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_BAYER_RS,
@@ -2078,6 +2091,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"STATS_RS",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_IHIST,
@@ -2093,6 +2107,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"STATS_IHIST",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_FULL_DISP,
@@ -2110,6 +2125,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 				"FULL_DISP_Y",
 				"FULL_DISP_C",
 			},
+			.pid_mask      = 0x70000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_DS4_DISP,
@@ -2125,6 +2141,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"DISP_DS_4",
 			},
+			.pid_mask      = 0x70000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_DS16_DISP,
@@ -2140,6 +2157,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"DISP_DS_16",
 			},
+			.pid_mask      = 0x70000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_PREPROCESS_2PD,
@@ -2155,6 +2173,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"PDAF_1_PREPROCESS_2PD",
 			},
+			.pid_mask      = 0x7000000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_AWB_BFW,
@@ -2170,6 +2189,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"AWB_BFW",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED,
@@ -2185,6 +2205,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"PDAF_2_PARSED_DATA",
 			},
+			.pid_mask      = 0x7000000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_AEC_BE,
@@ -2200,6 +2221,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"AEC_BE",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_LTM_STATS,
@@ -2215,6 +2237,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"LTM",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  =
@@ -2231,6 +2254,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
 			.name          = {
 				"GTM_BHIST",
 			},
+			.pid_mask      = 0x700000,
 		},
 	},
 

+ 25 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe880.h

@@ -1962,6 +1962,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"RDI_0",
 			},
+			.pid_mask      = 0x700,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_RDI1,
@@ -1978,6 +1979,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"RDI_1",
 			},
+			.pid_mask      = 0x700,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_RDI2,
@@ -1994,6 +1996,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"RDI_2",
 			},
+			.pid_mask      = 0x700,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_FULL,
@@ -2011,6 +2014,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 				"FULL_Y",
 				"FULL_C",
 			},
+			.pid_mask      = 0x70000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_DS4,
@@ -2026,6 +2030,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"DS_4",
 			},
+			.pid_mask      = 0x7000000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_DS16,
@@ -2041,6 +2046,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"DS_16",
 			},
+			.pid_mask      = 0x7000000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_RAW_DUMP,
@@ -2056,6 +2062,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"PIXEL_RAW",
 			},
+			.pid_mask      = 0x700,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_FD,
@@ -2073,6 +2080,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 				"FD_Y",
 				"FD_C",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_2PD,
@@ -2088,6 +2096,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"PDAF_0_2PD",
 			},
+			.pid_mask      = 0x7000000,
 		},
 		{
 			.vfe_out_type  =
@@ -2104,6 +2113,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"STATS_TL_BG",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_CAF,
@@ -2119,6 +2129,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"STATS_BF",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_AWB_BG,
@@ -2134,6 +2145,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"STATS_AWB_BGB",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_BHIST,
@@ -2149,6 +2161,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"STATS_BHIST",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_BAYER_RS,
@@ -2164,6 +2177,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"STATS_RS",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_IHIST,
@@ -2179,6 +2193,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"STATS_IHIST",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_FULL_DISP,
@@ -2196,6 +2211,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 				"FULL_DISP_Y",
 				"FULL_DISP_C",
 			},
+			.pid_mask      = 0x70000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_DS4_DISP,
@@ -2211,6 +2227,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"DISP_DS_4",
 			},
+			.pid_mask      = 0x7000000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_DS16_DISP,
@@ -2226,6 +2243,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"DISP_DS_16",
 			},
+			.pid_mask      = 0x7000000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_PREPROCESS_2PD,
@@ -2241,6 +2259,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"PDAF_1_PREPROCESS_2PD",
 			},
+			.pid_mask      = 0x7000000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_AWB_BFW,
@@ -2256,6 +2275,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"AWB_BFW",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED,
@@ -2271,6 +2291,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"PDAF_2_PARSED_DATA",
 			},
+			.pid_mask      = 0x7000000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_STATS_AEC_BE,
@@ -2286,6 +2307,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"AEC_BE",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  = CAM_VFE_BUS_VER3_VFE_OUT_LTM_STATS,
@@ -2301,6 +2323,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"LTM",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  =
@@ -2317,6 +2340,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"GTM_BHIST",
 			},
+			.pid_mask      = 0x700000,
 		},
 		{
 			.vfe_out_type  =
@@ -2333,6 +2357,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe880_bus_hw_info = {
 			.name          = {
 				"STATS_ALSC",
 			},
+			.pid_mask      = 0x700000,
 		},
 	},
 

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

@@ -207,6 +207,7 @@ struct cam_vfe_bus_ver3_vfe_out_data {
 	bool                             mc_based;
 	bool                             cntxt_cfg_except;
 	uint32_t                         dst_hw_ctxt_id_mask;
+	uint64_t                         pid_mask;
 };
 
 struct cam_vfe_bus_ver3_priv {
@@ -2414,6 +2415,8 @@ static int cam_vfe_bus_ver3_init_vfe_out_resource(uint32_t  index,
 		}
 	}
 
+	rsrc_data->pid_mask = ver3_hw_info->vfe_out_hw_info[index].pid_mask;
+
 	vfe_out->start = cam_vfe_bus_ver3_start_vfe_out;
 	vfe_out->stop = cam_vfe_bus_ver3_stop_vfe_out;
 	vfe_out->top_half_handler =
@@ -4346,7 +4349,9 @@ static int cam_vfe_bus_get_res_for_mid(
 	struct cam_vfe_bus_ver3_vfe_out_data   *out_data = NULL;
 	struct cam_isp_hw_get_cmd_update       *cmd_update = cmd_args;
 	struct cam_isp_hw_get_res_for_mid       *get_res = NULL;
+	uint32_t num_mid = 0, port_mid[CAM_VFE_BUS_VER3_VFE_OUT_MAX] = {0};
 	int i, j;
+	bool pid_found = false;
 
 	get_res = (struct cam_isp_hw_get_res_for_mid *)cmd_update->data;
 	if (!get_res) {
@@ -4364,11 +4369,22 @@ static int cam_vfe_bus_get_res_for_mid(
 
 		for (j = 0; j < out_data->num_mid; j++) {
 			if (out_data->mid[j] == get_res->mid)
-				goto end;
+				port_mid[num_mid++] = i;
+		}
+	}
+
+	for (i = 0; i < num_mid; i++) {
+		out_data = (struct cam_vfe_bus_ver3_vfe_out_data   *)
+			bus_priv->vfe_out[i].res_priv;
+		get_res->out_res_id = bus_priv->vfe_out[port_mid[i]].res_id;
+		if (out_data->pid_mask & (1 << get_res->pid)) {
+			get_res->out_res_id = bus_priv->vfe_out[port_mid[i]].res_id;
+			pid_found = true;
+			goto end;
 		}
 	}
 
-	if (i == bus_priv->num_out) {
+	if (!num_mid) {
 		CAM_ERR(CAM_ISP,
 			"VFE:%u mid:%d does not match with any out resource",
 			bus_priv->common_data.core_index, get_res->mid);
@@ -4377,9 +4393,9 @@ static int cam_vfe_bus_get_res_for_mid(
 	}
 
 end:
-	CAM_INFO(CAM_ISP, "VFE:%u match mid :%d  out resource:0x%x found",
-		bus_priv->common_data.core_index, get_res->mid, bus_priv->vfe_out[i].res_id);
-	get_res->out_res_id = bus_priv->vfe_out[i].res_id;
+	CAM_INFO(CAM_ISP, "VFE:%u match mid :%d  out resource:0x%x found, is pid found %d",
+		bus_priv->common_data.core_index, get_res->mid, bus_priv->vfe_out[i].res_id,
+		 pid_found);
 	return 0;
 }
 

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

@@ -224,8 +224,9 @@ struct cam_vfe_bus_ver3_vfe_out_hw_info {
 	uint32_t                            wm_idx[PLANE_MAX];
 	uint32_t                            mc_grp_shift;
 	uint8_t                            *name[PLANE_MAX];
+	uint64_t                            pid_mask;
 	bool                                mc_based;
-	bool                               cntxt_cfg_except;
+	bool                                cntxt_cfg_except;
 };
 
 /*