|
@@ -742,6 +742,12 @@ static void cam_ife_hw_mgr_dump_all_ctx(void)
|
|
|
struct cam_ife_hw_mgr_ctx *ctx_temp;
|
|
|
|
|
|
mutex_lock(&g_ife_hw_mgr.ctx_mutex);
|
|
|
+ if (list_empty(&g_ife_hw_mgr.used_ctx_list)) {
|
|
|
+ CAM_INFO(CAM_ISP, "Currently no ctx in use");
|
|
|
+ mutex_unlock(&g_ife_hw_mgr.ctx_mutex);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
list_for_each_entry_safe(ctx, ctx_temp,
|
|
|
&g_ife_hw_mgr.used_ctx_list, list) {
|
|
|
CAM_INFO_RATE_LIMIT(CAM_ISP,
|
|
@@ -799,17 +805,15 @@ static void cam_ife_hw_mgr_print_acquire_info(
|
|
|
int hw_idx[CAM_ISP_HW_SPLIT_MAX] = {-1, -1};
|
|
|
int i = 0;
|
|
|
|
|
|
- hw_mgr_res = list_first_entry(&hw_mgr_ctx->res_list_ife_csid,
|
|
|
- struct cam_isp_hw_mgr_res, list);
|
|
|
-
|
|
|
- if (hw_mgr_ctx->is_offline)
|
|
|
+ if (!list_empty(&hw_mgr_ctx->res_list_ife_src)) {
|
|
|
hw_mgr_res = list_first_entry(&hw_mgr_ctx->res_list_ife_src,
|
|
|
struct cam_isp_hw_mgr_res, list);
|
|
|
|
|
|
- for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
|
|
|
- hw_res = hw_mgr_res->hw_res[i];
|
|
|
- if (hw_res && hw_res->hw_intf)
|
|
|
- hw_idx[i] = hw_res->hw_intf->hw_idx;
|
|
|
+ for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
|
|
|
+ hw_res = hw_mgr_res->hw_res[i];
|
|
|
+ if (hw_res && hw_res->hw_intf)
|
|
|
+ hw_idx[i] = hw_res->hw_intf->hw_idx;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (acquire_failed)
|
|
@@ -824,12 +828,12 @@ static void cam_ife_hw_mgr_print_acquire_info(
|
|
|
return;
|
|
|
|
|
|
fail:
|
|
|
- CAM_ERR(CAM_ISP, "Acquire HW failed for ctx:%u", hw_mgr_ctx->ctx_index);
|
|
|
- CAM_INFO(CAM_ISP,
|
|
|
- "Acquire fail for ctx:%u %s IFE[%d %d] with [%u pix] [%u pd] [%u rdi] ports",
|
|
|
- hw_mgr_ctx->ctx_index, (hw_mgr_ctx->is_dual) ? "dual" : "single",
|
|
|
- hw_idx[CAM_ISP_HW_SPLIT_LEFT], hw_idx[CAM_ISP_HW_SPLIT_RIGHT],
|
|
|
- num_pix_port, num_pd_port, num_rdi_port);
|
|
|
+ CAM_ERR(CAM_ISP,
|
|
|
+ "Failed to acquire %s-IFE with [%u pix] [%u pd] [%u rdi] ports for ctx:%u",
|
|
|
+ (hw_mgr_ctx->is_dual) ? "dual" : "single",
|
|
|
+ num_pix_port, num_pd_port, num_rdi_port, hw_mgr_ctx->ctx_index);
|
|
|
+ CAM_INFO(CAM_ISP, "Previously acquired IFEs[%d %d]",
|
|
|
+ hw_idx[CAM_ISP_HW_SPLIT_LEFT], hw_idx[CAM_ISP_HW_SPLIT_RIGHT]);
|
|
|
|
|
|
list_for_each_entry_safe(hw_mgr_res, hw_mgr_res_temp,
|
|
|
&hw_mgr_ctx->res_list_ife_src, list) {
|
|
@@ -1706,6 +1710,7 @@ static int cam_ife_hw_mgr_acquire_csid_hw(
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
+ CAM_DBG(CAM_ISP, "Acquire CSID HW lower_idx: %d", is_start_lower_idx);
|
|
|
if (is_start_lower_idx) {
|
|
|
for (i = 0; i < CAM_IFE_CSID_HW_NUM_MAX; i++) {
|
|
|
if (!ife_hw_mgr->csid_devices[i])
|
|
@@ -1767,6 +1772,7 @@ static int cam_ife_mgr_acquire_cid_res(
|
|
|
csid_acquire.res_type = CAM_ISP_RESOURCE_CID;
|
|
|
csid_acquire.in_port = in_port;
|
|
|
csid_acquire.res_id = path_res_id;
|
|
|
+ csid_acquire.node_res = NULL;
|
|
|
|
|
|
if (ife_ctx->is_rdi_only_context)
|
|
|
csid_acquire.can_use_lite = true;
|
|
@@ -1840,8 +1846,12 @@ static int cam_ife_mgr_acquire_cid_res(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /* Acquire right if not already acquired */
|
|
|
- /* For dual IFE cases, master will be lower idx */
|
|
|
+ /* Acquire Left if not already acquired */
|
|
|
+ /* For dual IFE cases, start acquiring the lower idx first */
|
|
|
+ CAM_DBG(CAM_ISP, "acquire new rsrc fe: %d usage_type %d dsp %d rsrc %p",
|
|
|
+ ife_ctx->is_fe_enabled, in_port->usage_type,
|
|
|
+ ife_ctx->dsp_enabled, csid_acquire.node_res);
|
|
|
+
|
|
|
if (ife_ctx->is_fe_enabled ||
|
|
|
ife_ctx->dsp_enabled)
|
|
|
rc = cam_ife_hw_mgr_acquire_csid_hw(ife_hw_mgr,
|
|
@@ -1851,7 +1861,8 @@ static int cam_ife_mgr_acquire_cid_res(
|
|
|
&csid_acquire, false);
|
|
|
|
|
|
if (rc || !csid_acquire.node_res) {
|
|
|
- CAM_ERR(CAM_ISP, "No %d paths available", path_res_id);
|
|
|
+ CAM_ERR(CAM_ISP, "No %d paths available rc %d rsrc %p",
|
|
|
+ path_res_id, rc, csid_acquire.node_res);
|
|
|
goto put_res;
|
|
|
}
|
|
|
|
|
@@ -2718,6 +2729,7 @@ static int cam_ife_mgr_acquire_hw_for_ctx(
|
|
|
|
|
|
is_dual_isp = in_port->usage_type;
|
|
|
ife_ctx->dsp_enabled = (bool)in_port->dsp_mode;
|
|
|
+ ife_ctx->is_dual = (bool)in_port->usage_type;
|
|
|
|
|
|
/* get root node resource */
|
|
|
rc = cam_ife_hw_mgr_acquire_res_root(ife_ctx, in_port);
|
|
@@ -3132,6 +3144,7 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
|
|
|
CAM_ERR(CAM_ISP, "Failed in parsing: %d", rc);
|
|
|
goto free_mem;
|
|
|
}
|
|
|
+ CAM_DBG(CAM_ISP, "in_res_type %x", in_port->res_type);
|
|
|
|
|
|
cam_ife_hw_mgr_preprocess_port(ife_ctx, &in_port[i]);
|
|
|
total_pix_port += in_port[i].ipp_count +
|
|
@@ -3149,7 +3162,6 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
|
|
|
|
|
|
/* acquire HW resources */
|
|
|
for (i = 0; i < acquire_hw_info->num_inputs; i++) {
|
|
|
-
|
|
|
CAM_DBG(CAM_ISP, "in_res_type %x", in_port[i].res_type);
|
|
|
|
|
|
if ((in_port[i].cust_node) && (!ife_ctx->custom_enabled)) {
|
|
@@ -3185,8 +3197,11 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
|
|
|
|
|
|
if (rc) {
|
|
|
cam_ife_hw_mgr_print_acquire_info(ife_ctx,
|
|
|
- total_pix_port, total_pd_port,
|
|
|
- total_rdi_port, rc);
|
|
|
+ (in_port[i].ipp_count +
|
|
|
+ in_port[i].ife_rd_count +
|
|
|
+ in_port[i].lcr_count),
|
|
|
+ in_port[i].ppp_count,
|
|
|
+ in_port[i].rdi_count, rc);
|
|
|
goto free_res;
|
|
|
}
|
|
|
|