Pārlūkot izejas kodu

msm: camera: isp: Add multiple MIDs support for per port

Add multiple MIDs support for TFE. This will help to parse
request dump during PF issue.

CRs-Fixed: 3206699
Change-Id: I0f6f82a1c217fde9a4f5628913bf8f5b43e4c2ee
Signed-off-by: Alok Chauhan <[email protected]>
Alok Chauhan 1 gadu atpakaļ
vecāks
revīzija
1b002763fa

+ 11 - 11
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe530.h

@@ -760,7 +760,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_5,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_1,
-			.mid              = 23,
+			.mid[0]              = 23,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_RDI1,
@@ -768,7 +768,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_6,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_2,
-			.mid              = 24,
+			.mid[0]              = 24,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_RDI2,
@@ -776,7 +776,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_7,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_3,
-			.mid              = 25,
+			.mid[0]              = 25,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_FULL,
@@ -784,7 +784,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = 4096,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_0,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 16,
+			.mid[0]              = 16,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_RAW_DUMP,
@@ -792,7 +792,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = 4096,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_1,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 17,
+			.mid[0]              = 17,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_PDAF,
@@ -800,7 +800,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = 4096,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_7,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_3,
-			.mid              = 25,
+			.mid[0]              = 25,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_HDR_BE,
@@ -808,7 +808,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_3,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 21,
+			.mid[0]              = 21,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_HDR_BHIST,
@@ -816,7 +816,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_2,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 19,
+			.mid[0]              = 19,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_TL_BG,
@@ -824,7 +824,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_2,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 18,
+			.mid[0]              = 18,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_AWB_BG,
@@ -832,7 +832,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_3,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 20,
+			.mid[0]              = 20,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_BF,
@@ -840,7 +840,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_4,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 22,
+			.mid[0]              = 22,
 		},
 	},
 	.num_comp_grp             = 8,

+ 16 - 15
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe640.h

@@ -1043,7 +1043,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_5,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_1,
-			.mid              = 4,
+			.mid[0]              = 4,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_RDI1,
@@ -1051,7 +1051,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_6,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_2,
-			.mid              = 5,
+			.mid[0]              = 5,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_RDI2,
@@ -1059,7 +1059,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_7,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_3,
-			.mid              = 6,
+			.mid[0]              = 6,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_FULL,
@@ -1067,7 +1067,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = 4096,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_0,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 16,
+			.mid[0]              = 16,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_RAW_DUMP,
@@ -1075,7 +1075,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = 4096,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_1,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 7,
+			.mid[0]              = 7,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_PDAF,
@@ -1083,7 +1083,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = 4096,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_8,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 26,
+			.mid[0]              = 26,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_HDR_BE,
@@ -1091,7 +1091,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_3,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 21,
+			.mid[0]              = 21,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_HDR_BHIST,
@@ -1099,7 +1099,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_2,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 18,
+			.mid[0]              = 18,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_TL_BG,
@@ -1107,7 +1107,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_2,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 17,
+			.mid[0]              = 17,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_AWB_BG,
@@ -1115,7 +1115,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_3,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 19,
+			.mid[0]              = 19,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_BF,
@@ -1123,7 +1123,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_4,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 21,
+			.mid[0]              = 21,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_STATS_RS,
@@ -1131,7 +1131,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_10,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 27,
+			.mid[0]              = 27,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_DS4,
@@ -1139,7 +1139,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_0,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 22,
+			.mid[0]              = 22,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_DS16,
@@ -1147,7 +1147,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = -1,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_0,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 23,
+			.mid[0]              = 23,
 		},
 		{
 			.tfe_out_id       = CAM_TFE_BUS_TFE_OUT_AI,
@@ -1155,7 +1155,8 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 			.max_height       = 1920,
 			.composite_group  = CAM_TFE_BUS_COMP_GRP_9,
 			.rup_group_id     = CAM_TFE_BUS_RUP_GRP_0,
-			.mid              = 24,
+			.mid[0]              = 24,
+			.mid[1]              = 25,
 		},
 	},
 	.num_comp_grp             = 11,

+ 11 - 5
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_bus.c

@@ -38,6 +38,7 @@ static const char drv_name[] = "tfe_bus";
 #define MAX_REG_VAL_PAIR_SIZE    \
 	(MAX_BUF_UPDATE_REG_NUM * 2 * CAM_PACKET_MAX_PLANES)
 
+
 enum cam_tfe_bus_packer_format {
 	PACKER_FMT_PLAIN_128,
 	PACKER_FMT_PLAIN_8,
@@ -150,7 +151,7 @@ struct cam_tfe_bus_tfe_out_data {
 	uint32_t                         secure_mode;
 	void                            *priv;
 	cam_hw_mgr_event_cb_func         event_cb;
-	uint32_t                         mid;
+	uint32_t                         mid[CAM_TFE_BUS_MAX_MID_PER_PORT];
 };
 
 struct cam_tfe_bus_priv {
@@ -1650,6 +1651,7 @@ static int cam_tfe_bus_init_tfe_out_resource(uint32_t  index,
 	struct cam_tfe_bus_tfe_out_data *rsrc_data = NULL;
 	int rc = 0;
 	int32_t tfe_out_id = hw_info->tfe_out_hw_info[index].tfe_out_id;
+	int i;
 
 	if (tfe_out_id < 0 ||
 		tfe_out_id >= CAM_TFE_BUS_TFE_OUT_MAX) {
@@ -1691,7 +1693,9 @@ static int cam_tfe_bus_init_tfe_out_resource(uint32_t  index,
 	rsrc_data->max_height      =
 		hw_info->tfe_out_hw_info[index].max_height;
 	rsrc_data->secure_mode  = CAM_SECURE_MODE_NON_SECURE;
-	rsrc_data->mid = hw_info->tfe_out_hw_info[index].mid;
+
+	for (i = 0; i < CAM_TFE_BUS_MAX_MID_PER_PORT; i++)
+		rsrc_data->mid[i] = hw_info->tfe_out_hw_info[index].mid[i];
 
 	tfe_out->hw_intf = bus_priv->common_data.hw_intf;
 
@@ -2291,7 +2295,7 @@ static int cam_tfe_bus_get_res_id_for_mid(
 	struct cam_isp_hw_get_cmd_update   *cmd_update =
 		(struct cam_isp_hw_get_cmd_update   *)cmd_args;
 	struct cam_isp_hw_get_res_for_mid       *get_res = NULL;
-	int i;
+	int i, j;
 
 	get_res = (struct cam_isp_hw_get_res_for_mid *)cmd_update->data;
 	if (!get_res) {
@@ -2307,8 +2311,10 @@ static int cam_tfe_bus_get_res_id_for_mid(
 		if (!tfe_out_data)
 			continue;
 
-		if (tfe_out_data->mid == get_res->mid)
-			goto end;
+		for (j = 0; j < CAM_TFE_BUS_MAX_MID_PER_PORT; j++) {
+			if (tfe_out_data->mid[j] == get_res->mid)
+				goto end;
+		}
 	}
 
 	if (i == bus_priv->num_out) {

+ 2 - 2
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_bus.h

@@ -19,7 +19,7 @@
 #define CAM_TFE_BUS_CLIENT_NAME_MAX_LENGTH 32
 
 #define CAM_TFE_BUS_1_0             0x1000
-#define CAM_TFE_BUS_MAX_MID_PER_PORT        1
+#define CAM_TFE_BUS_MAX_MID_PER_PORT        2
 
 
 #define CAM_TFE_ADD_REG_VAL_PAIR(buf_array, index, offset, val)    \
@@ -174,7 +174,7 @@ struct cam_tfe_bus_tfe_out_hw_info {
 	uint32_t                            max_height;
 	uint32_t                            composite_group;
 	uint32_t                            rup_group_id;
-	uint32_t                            mid;
+	uint32_t                            mid[CAM_TFE_BUS_MAX_MID_PER_PORT];
 };
 
 /*