msm: camera: isp: Add support of new out ports for VFE 780

Add support of new stats out ports in vfe driver for VFE 780.

CRs-Fixed: 2948116
Change-Id: I2d0a13fe90f49b66839ea90b5d9882fd7c6528be
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
This commit is contained in:
Chandan Kumar Jha
2021-06-08 13:27:39 +05:30
parent a5fbb956da
commit fd65327ebd
5 changed files with 43 additions and 42 deletions

View File

@@ -667,6 +667,10 @@ static const char *__cam_isp_resource_handle_id_to_type(
return "PREPROCESS_RAW"; return "PREPROCESS_RAW";
case CAM_ISP_IFE_OUT_RES_SPARSE_PD: case CAM_ISP_IFE_OUT_RES_SPARSE_PD:
return "SPARSE_PD"; return "SPARSE_PD";
case CAM_ISP_IFE_OUT_RES_STATS_CAF:
return "STATS_CAF";
case CAM_ISP_IFE_OUT_RES_STATS_BAYER_RS:
return "STATS_BAYER_RS";
default: default:
return "CAM_ISP_Invalid_Resource_Type"; return "CAM_ISP_Invalid_Resource_Type";
} }

View File

@@ -350,7 +350,7 @@ static struct cam_vfe_top_ver4_wr_client_desc vfe780_wr_client_desc[] = {
}, },
{ {
.wm_id = 16, .wm_id = 16,
.desc = "STATS_BAF", .desc = "STATS_CAF",
}, },
{ {
.wm_id = 17, .wm_id = 17,
@@ -358,7 +358,7 @@ static struct cam_vfe_top_ver4_wr_client_desc vfe780_wr_client_desc[] = {
}, },
{ {
.wm_id = 18, .wm_id = 18,
.desc = "STATS_RS", .desc = "STATS_BAYER_RS",
}, },
{ {
.wm_id = 19, .wm_id = 19,
@@ -366,15 +366,15 @@ static struct cam_vfe_top_ver4_wr_client_desc vfe780_wr_client_desc[] = {
}, },
{ {
.wm_id = 20, .wm_id = 20,
.desc = "PDAF_0", .desc = "PDAF_0_2PD",
}, },
{ {
.wm_id = 21, .wm_id = 21,
.desc = "PDAF_1", .desc = "PDAF_1_PREPROCESS_2PD",
}, },
{ {
.wm_id = 22, .wm_id = 22,
.desc = "PDAF_2", .desc = "PDAF_2_LCR",
}, },
{ {
.wm_id = 23, .wm_id = 23,
@@ -636,7 +636,7 @@ static struct cam_vfe_top_ver4_hw_info vfe780_top_hw_info = {
.path_port_map = { .path_port_map = {
{CAM_ISP_HW_VFE_IN_PDLIB, CAM_ISP_IFE_OUT_RES_2PD}, {CAM_ISP_HW_VFE_IN_PDLIB, CAM_ISP_IFE_OUT_RES_2PD},
{CAM_ISP_HW_VFE_IN_PDLIB, CAM_ISP_IFE_OUT_RES_PREPROCESS_2PD}, {CAM_ISP_HW_VFE_IN_PDLIB, CAM_ISP_IFE_OUT_RES_PREPROCESS_2PD},
{CAM_ISP_HW_VFE_IN_PDLIB, CAM_ISP_IFE_OUT_RES_PDAF_PARSED_DATA} {CAM_ISP_HW_VFE_IN_PDLIB, CAM_ISP_IFE_OUT_RES_LCR}
}, },
.num_top_errors = ARRAY_SIZE(vfe780_top_irq_err_desc), .num_top_errors = ARRAY_SIZE(vfe780_top_irq_err_desc),
.top_err_desc = vfe780_top_irq_err_desc, .top_err_desc = vfe780_top_irq_err_desc,
@@ -1207,7 +1207,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
.comp_group = CAM_VFE_BUS_VER3_COMP_GRP_6, .comp_group = CAM_VFE_BUS_VER3_COMP_GRP_6,
.ubwc_regs = NULL, .ubwc_regs = NULL,
}, },
/* BUS Client 16 STATS BAF */ /* BUS Client 16 STATS CAF */
{ {
.cfg = 0x00001E00, .cfg = 0x00001E00,
.image_addr = 0x00001E04, .image_addr = 0x00001E04,
@@ -1267,7 +1267,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
.comp_group = CAM_VFE_BUS_VER3_COMP_GRP_8, .comp_group = CAM_VFE_BUS_VER3_COMP_GRP_8,
.ubwc_regs = NULL, .ubwc_regs = NULL,
}, },
/* BUS Client 18 STATS RS */ /* BUS Client 18 STATS BAYER RS */
{ {
.cfg = 0x00002000, .cfg = 0x00002000,
.image_addr = 0x00002004, .image_addr = 0x00002004,
@@ -1327,7 +1327,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
.comp_group = CAM_VFE_BUS_VER3_COMP_GRP_10, .comp_group = CAM_VFE_BUS_VER3_COMP_GRP_10,
.ubwc_regs = NULL, .ubwc_regs = NULL,
}, },
/* BUS Client 20 PDAF_0 */ /* BUS Client 20 PDAF_0_2PD */
{ {
.cfg = 0x00002200, .cfg = 0x00002200,
.image_addr = 0x00002204, .image_addr = 0x00002204,
@@ -1357,7 +1357,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
.comp_group = CAM_VFE_BUS_VER3_COMP_GRP_11, .comp_group = CAM_VFE_BUS_VER3_COMP_GRP_11,
.ubwc_regs = NULL, .ubwc_regs = NULL,
}, },
/* BUS Client 21 PDAF V2.0 PD DATA PDAF_1 */ /* BUS Client 21 PDAF V2.0 PD DATA PDAF_1_PREPROCESS_2PD */
{ {
.cfg = 0x00002300, .cfg = 0x00002300,
.image_addr = 0x00002304, .image_addr = 0x00002304,
@@ -1387,7 +1387,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
.comp_group = CAM_VFE_BUS_VER3_COMP_GRP_11, .comp_group = CAM_VFE_BUS_VER3_COMP_GRP_11,
.ubwc_regs = NULL, .ubwc_regs = NULL,
}, },
/* BUS Client 22 PDAF V2.0 PDAF_2 */ /* BUS Client 22 PDAF V2.0 PDAF_2_LCR */
{ {
.cfg = 0x00002400, .cfg = 0x00002400,
.image_addr = 0x00002404, .image_addr = 0x00002404,
@@ -1676,7 +1676,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
20, 20,
}, },
.name = { .name = {
"2PD_SAD", "PDAF_0_2PD",
}, },
}, },
{ {
@@ -1695,7 +1695,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
}, },
}, },
{ {
.vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_STATS_BF, .vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_STATS_CAF,
.max_width = -1, .max_width = -1,
.max_height = -1, .max_height = -1,
.source_group = CAM_VFE_BUS_VER3_SRC_GRP_0, .source_group = CAM_VFE_BUS_VER3_SRC_GRP_0,
@@ -1737,7 +1737,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
}, },
}, },
{ {
.vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_STATS_RS, .vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_STATS_BAYER_RS,
.max_width = -1, .max_width = -1,
.max_height = -1, .max_height = -1,
.source_group = CAM_VFE_BUS_VER3_SRC_GRP_0, .source_group = CAM_VFE_BUS_VER3_SRC_GRP_0,
@@ -1822,7 +1822,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
21, 21,
}, },
.name = { .name = {
"PREPROCESS_2PD", "PDAF_1_PREPROCESS_2PD",
}, },
}, },
{ {
@@ -1840,7 +1840,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
}, },
}, },
{ {
.vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED, .vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_LCR,
.max_width = -1, .max_width = -1,
.max_height = -1, .max_height = -1,
.source_group = CAM_VFE_BUS_VER3_SRC_GRP_1, .source_group = CAM_VFE_BUS_VER3_SRC_GRP_1,
@@ -1850,7 +1850,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
22, 22,
}, },
.name = { .name = {
"PDAF_PARSED", "PDAF_2_LCR",
}, },
}, },
{ {
@@ -2022,7 +2022,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe780_bus_hw_info = {
.support_consumed_addr = true, .support_consumed_addr = true,
.comp_done_shift = 0, .comp_done_shift = 0,
.top_irq_shift = 1, .top_irq_shift = 1,
.max_out_res = CAM_ISP_IFE_OUT_RES_BASE + 34, .max_out_res = CAM_ISP_IFE_OUT_RES_BASE + 35,
.pack_align_shift = 5, .pack_align_shift = 5,
}; };

View File

@@ -314,6 +314,8 @@ static bool cam_vfe_bus_ver3_can_be_secure(uint32_t out_type)
case CAM_VFE_BUS_VER3_VFE_OUT_STATS_RS: case CAM_VFE_BUS_VER3_VFE_OUT_STATS_RS:
case CAM_VFE_BUS_VER3_VFE_OUT_STATS_CS: case CAM_VFE_BUS_VER3_VFE_OUT_STATS_CS:
case CAM_VFE_BUS_VER3_VFE_OUT_STATS_IHIST: case CAM_VFE_BUS_VER3_VFE_OUT_STATS_IHIST:
case CAM_VFE_BUS_VER3_VFE_OUT_STATS_CAF:
case CAM_VFE_BUS_VER3_VFE_OUT_STATS_BAYER_RS:
default: default:
return false; return false;
} }
@@ -408,7 +410,6 @@ static enum cam_vfe_bus_ver3_vfe_out_type
case CAM_ISP_IFE_OUT_RES_STATS_AEC_BE: case CAM_ISP_IFE_OUT_RES_STATS_AEC_BE:
vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_STATS_AEC_BE; vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_STATS_AEC_BE;
break; break;
case CAM_ISP_IFE_OUT_RES_LTM_STATS: case CAM_ISP_IFE_OUT_RES_LTM_STATS:
vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_LTM_STATS; vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_LTM_STATS;
break; break;
@@ -421,8 +422,11 @@ static enum cam_vfe_bus_ver3_vfe_out_type
case CAM_ISP_IFE_LITE_OUT_RES_PREPROCESS_RAW: case CAM_ISP_IFE_LITE_OUT_RES_PREPROCESS_RAW:
vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_PREPROCESS_RAW; vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_PREPROCESS_RAW;
break; break;
case CAM_ISP_IFE_OUT_RES_PDAF_PARSED_DATA: case CAM_ISP_IFE_OUT_RES_STATS_CAF:
vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED; vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_STATS_CAF;
break;
case CAM_ISP_IFE_OUT_RES_STATS_BAYER_RS:
vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_STATS_BAYER_RS;
break; break;
default: default:
CAM_WARN(CAM_ISP, "Invalid isp res id: %d , assigning max", CAM_WARN(CAM_ISP, "Invalid isp res id: %d , assigning max",
@@ -537,8 +541,11 @@ static int cam_vfe_bus_ver3_get_comp_vfe_out_res_id_list(
if (comp_mask & (BIT(CAM_VFE_BUS_VER3_VFE_OUT_SPARSE_PD))) if (comp_mask & (BIT(CAM_VFE_BUS_VER3_VFE_OUT_SPARSE_PD)))
out_list[count++] = CAM_ISP_IFE_OUT_RES_SPARSE_PD; out_list[count++] = CAM_ISP_IFE_OUT_RES_SPARSE_PD;
if (comp_mask & (BIT(CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED))) if (comp_mask & (BIT(CAM_VFE_BUS_VER3_VFE_OUT_STATS_CAF)))
out_list[count++] = CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED; out_list[count++] = CAM_ISP_IFE_OUT_RES_STATS_CAF;
if (comp_mask & (BIT(CAM_VFE_BUS_VER3_VFE_OUT_STATS_BAYER_RS)))
out_list[count++] = CAM_ISP_IFE_OUT_RES_STATS_BAYER_RS;
*num_out = count; *num_out = count;
return 0; return 0;
@@ -1097,12 +1104,14 @@ static int cam_vfe_bus_ver3_acquire_wm(
} }
rsrc_data->en_cfg = 0x1; rsrc_data->en_cfg = 0x1;
} else if (vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_STATS_BF) { } else if ((vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_STATS_BF) ||
(vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_STATS_CAF)) {
rsrc_data->en_cfg = (0x1 << 16) | 0x1; rsrc_data->en_cfg = (0x1 << 16) | 0x1;
} else if ((vfe_out_res_id >= CAM_VFE_BUS_VER3_VFE_OUT_STATS_HDR_BE) && } else if (((vfe_out_res_id >= CAM_VFE_BUS_VER3_VFE_OUT_STATS_HDR_BE) &&
(vfe_out_res_id <= CAM_VFE_BUS_VER3_VFE_OUT_STATS_IHIST)) { (vfe_out_res_id <= CAM_VFE_BUS_VER3_VFE_OUT_STATS_IHIST)) ||
(vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_STATS_BAYER_RS)) {
rsrc_data->width = 0; rsrc_data->width = 0;
rsrc_data->height = 0; rsrc_data->height = 0;
@@ -1242,20 +1251,6 @@ static int cam_vfe_bus_ver3_acquire_wm(
return -EINVAL; return -EINVAL;
} }
} else if (vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED) {
switch (rsrc_data->format) {
case CAM_FORMAT_PLAIN16_16:
rsrc_data->stride = ALIGNUP(rsrc_data->width * 2, 8);
rsrc_data->en_cfg = 0x1;
/* LSB aligned */
rsrc_data->pack_fmt |= (1 <<
ver3_bus_priv->common_data.pack_align_shift);
break;
default:
CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d",
rsrc_data->format, vfe_out_res_id);
return -EINVAL;
}
} else { } else {
CAM_ERR(CAM_ISP, "Invalid out_type:%d requested", CAM_ERR(CAM_ISP, "Invalid out_type:%d requested",
vfe_out_res_id); vfe_out_res_id);

View File

@@ -85,7 +85,8 @@ enum cam_vfe_bus_ver3_vfe_out_type {
CAM_VFE_BUS_VER3_VFE_OUT_STATS_GTM_BHIST, CAM_VFE_BUS_VER3_VFE_OUT_STATS_GTM_BHIST,
CAM_VFE_BUS_VER3_VFE_OUT_STATS_BG, CAM_VFE_BUS_VER3_VFE_OUT_STATS_BG,
CAM_VFE_BUS_VER3_VFE_OUT_PREPROCESS_RAW, CAM_VFE_BUS_VER3_VFE_OUT_PREPROCESS_RAW,
CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED, CAM_VFE_BUS_VER3_VFE_OUT_STATS_CAF,
CAM_VFE_BUS_VER3_VFE_OUT_STATS_BAYER_RS,
CAM_VFE_BUS_VER3_VFE_OUT_MAX, CAM_VFE_BUS_VER3_VFE_OUT_MAX,
}; };

View File

@@ -42,7 +42,8 @@
#define CAM_ISP_IFE_OUT_RES_STATS_GTM_BHIST (CAM_ISP_IFE_OUT_RES_BASE + 30) #define CAM_ISP_IFE_OUT_RES_STATS_GTM_BHIST (CAM_ISP_IFE_OUT_RES_BASE + 30)
#define CAM_ISP_IFE_LITE_OUT_RES_STATS_BG (CAM_ISP_IFE_OUT_RES_BASE + 31) #define CAM_ISP_IFE_LITE_OUT_RES_STATS_BG (CAM_ISP_IFE_OUT_RES_BASE + 31)
#define CAM_ISP_IFE_LITE_OUT_RES_PREPROCESS_RAW (CAM_ISP_IFE_OUT_RES_BASE + 32) #define CAM_ISP_IFE_LITE_OUT_RES_PREPROCESS_RAW (CAM_ISP_IFE_OUT_RES_BASE + 32)
#define CAM_ISP_IFE_OUT_RES_PDAF_PARSED_DATA (CAM_ISP_IFE_OUT_RES_BASE + 33) #define CAM_ISP_IFE_OUT_RES_STATS_CAF (CAM_ISP_IFE_OUT_RES_BASE + 33)
#define CAM_ISP_IFE_OUT_RES_STATS_BAYER_RS (CAM_ISP_IFE_OUT_RES_BASE + 34)
/* IFE input port resource type (global unique) */ /* IFE input port resource type (global unique) */
#define CAM_ISP_IFE_IN_RES_BASE 0x4000 #define CAM_ISP_IFE_IN_RES_BASE 0x4000