|
@@ -979,90 +979,6 @@ static int cam_ife_mgr_process_base_info(
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int cam_ife_hw_mgr_acquire_res_bus_rd(
|
|
|
- struct cam_ife_hw_mgr_ctx *ife_ctx,
|
|
|
- struct cam_isp_in_port_generic_info *in_port)
|
|
|
-{
|
|
|
- int rc = -EINVAL;
|
|
|
- struct cam_vfe_acquire_args vfe_acquire;
|
|
|
- struct cam_isp_hw_mgr_res *ife_in_rd_res;
|
|
|
- struct cam_hw_intf *hw_intf;
|
|
|
- struct cam_isp_hw_mgr_res *ife_src_res;
|
|
|
- int i;
|
|
|
-
|
|
|
- CAM_DBG(CAM_ISP, "Enter");
|
|
|
-
|
|
|
- list_for_each_entry(ife_src_res, &ife_ctx->res_list_ife_src, list) {
|
|
|
- if (ife_src_res->res_id != CAM_ISP_HW_VFE_IN_RD)
|
|
|
- continue;
|
|
|
-
|
|
|
- rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list,
|
|
|
- &ife_in_rd_res);
|
|
|
- if (rc) {
|
|
|
- CAM_ERR(CAM_ISP, "No more free hw mgr resource");
|
|
|
- goto err;
|
|
|
- }
|
|
|
- cam_ife_hw_mgr_put_res(&ife_ctx->res_list_ife_in_rd,
|
|
|
- &ife_in_rd_res);
|
|
|
-
|
|
|
- vfe_acquire.rsrc_type = CAM_ISP_RESOURCE_VFE_BUS_RD;
|
|
|
- vfe_acquire.tasklet = ife_ctx->common.tasklet_info;
|
|
|
- vfe_acquire.vfe_out.cdm_ops = ife_ctx->cdm_ops;
|
|
|
- vfe_acquire.priv = ife_ctx;
|
|
|
- vfe_acquire.vfe_out.unique_id = ife_ctx->ctx_index;
|
|
|
- vfe_acquire.vfe_out.is_dual = ife_src_res->is_dual_isp;
|
|
|
- for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
|
|
|
- if (!ife_src_res->hw_res[i])
|
|
|
- continue;
|
|
|
-
|
|
|
- hw_intf = ife_src_res->hw_res[i]->hw_intf;
|
|
|
- if (i == CAM_ISP_HW_SPLIT_LEFT) {
|
|
|
- vfe_acquire.vfe_out.split_id =
|
|
|
- CAM_ISP_HW_SPLIT_LEFT;
|
|
|
- if (ife_src_res->is_dual_isp) {
|
|
|
- /*TBD */
|
|
|
- vfe_acquire.vfe_out.is_master = 1;
|
|
|
- vfe_acquire.vfe_out.dual_slave_core =
|
|
|
- ife_ctx->slave_hw_idx;
|
|
|
- } else {
|
|
|
- vfe_acquire.vfe_out.is_master = 0;
|
|
|
- vfe_acquire.vfe_out.dual_slave_core =
|
|
|
- 0;
|
|
|
- }
|
|
|
- } else {
|
|
|
- vfe_acquire.vfe_out.split_id =
|
|
|
- CAM_ISP_HW_SPLIT_RIGHT;
|
|
|
- vfe_acquire.vfe_out.is_master = 0;
|
|
|
- vfe_acquire.vfe_out.dual_slave_core =
|
|
|
- ife_ctx->master_hw_idx;
|
|
|
- }
|
|
|
- rc = hw_intf->hw_ops.reserve(hw_intf->hw_priv,
|
|
|
- &vfe_acquire,
|
|
|
- sizeof(struct cam_vfe_acquire_args));
|
|
|
- if (rc) {
|
|
|
- CAM_ERR(CAM_ISP,
|
|
|
- "Can not acquire out resource 0x%x",
|
|
|
- vfe_acquire.rsrc_type);
|
|
|
- goto err;
|
|
|
- }
|
|
|
-
|
|
|
- ife_in_rd_res->hw_res[i] =
|
|
|
- vfe_acquire.vfe_out.rsrc_node;
|
|
|
- CAM_DBG(CAM_ISP, "resource type :0x%x res id:0x%x",
|
|
|
- ife_in_rd_res->hw_res[i]->res_type,
|
|
|
- ife_in_rd_res->hw_res[i]->res_id);
|
|
|
-
|
|
|
- }
|
|
|
- ife_in_rd_res->is_dual_isp = in_port->usage_type;
|
|
|
- ife_in_rd_res->res_type = CAM_ISP_RESOURCE_VFE_BUS_RD;
|
|
|
- }
|
|
|
-
|
|
|
- return 0;
|
|
|
-err:
|
|
|
- CAM_DBG(CAM_ISP, "Exit rc(0x%x)", rc);
|
|
|
- return rc;
|
|
|
-}
|
|
|
-
|
|
|
static int cam_ife_hw_mgr_acquire_res_ife_out_rdi(
|
|
|
struct cam_ife_hw_mgr_ctx *ife_ctx,
|
|
|
struct cam_isp_hw_mgr_res *ife_src_res,
|
|
@@ -1297,125 +1213,6 @@ err:
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-static int cam_ife_hw_mgr_acquire_res_ife_rd_src(
|
|
|
- struct cam_ife_hw_mgr_ctx *ife_ctx,
|
|
|
- struct cam_isp_in_port_generic_info *in_port)
|
|
|
-{
|
|
|
- int rc = -1;
|
|
|
- struct cam_isp_hw_mgr_res *csid_res;
|
|
|
- struct cam_isp_hw_mgr_res *ife_src_res;
|
|
|
- struct cam_vfe_acquire_args vfe_acquire;
|
|
|
- struct cam_hw_intf *hw_intf;
|
|
|
- struct cam_ife_hw_mgr *ife_hw_mgr;
|
|
|
- int vfe_idx = -1, i = 0;
|
|
|
-
|
|
|
- ife_hw_mgr = ife_ctx->hw_mgr;
|
|
|
-
|
|
|
- CAM_DBG(CAM_ISP, "Enter");
|
|
|
- list_for_each_entry(csid_res, &ife_ctx->res_list_ife_csid, list) {
|
|
|
- if (csid_res->res_id != CAM_IFE_PIX_PATH_RES_RDI_0) {
|
|
|
- CAM_DBG(CAM_ISP, "not RDI0: %d", csid_res->res_id);
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list,
|
|
|
- &ife_src_res);
|
|
|
- if (rc) {
|
|
|
- CAM_ERR(CAM_ISP, "No more free hw mgr resource");
|
|
|
- goto err;
|
|
|
- }
|
|
|
- cam_ife_hw_mgr_put_res(&ife_ctx->res_list_ife_src,
|
|
|
- &ife_src_res);
|
|
|
-
|
|
|
- CAM_DBG(CAM_ISP, "csid_res_id %d", csid_res->res_id);
|
|
|
- vfe_acquire.rsrc_type = CAM_ISP_RESOURCE_VFE_IN;
|
|
|
- vfe_acquire.tasklet = ife_ctx->common.tasklet_info;
|
|
|
- vfe_acquire.vfe_in.cdm_ops = ife_ctx->cdm_ops;
|
|
|
- vfe_acquire.vfe_in.in_port = in_port;
|
|
|
- vfe_acquire.vfe_in.res_id = CAM_ISP_HW_VFE_IN_RD;
|
|
|
- vfe_acquire.vfe_in.sync_mode = CAM_ISP_HW_SYNC_NONE;
|
|
|
-
|
|
|
- ife_src_res->res_type = vfe_acquire.rsrc_type;
|
|
|
- ife_src_res->res_id = vfe_acquire.vfe_in.res_id;
|
|
|
- ife_src_res->is_dual_isp = csid_res->is_dual_isp;
|
|
|
-
|
|
|
- hw_intf =
|
|
|
- ife_hw_mgr->ife_devices[csid_res->hw_res[
|
|
|
- CAM_ISP_HW_SPLIT_LEFT]->hw_intf->hw_idx];
|
|
|
-
|
|
|
- vfe_idx = csid_res->hw_res[
|
|
|
- CAM_ISP_HW_SPLIT_LEFT]->hw_intf->hw_idx;
|
|
|
-
|
|
|
- /*
|
|
|
- * fill in more acquire information as needed
|
|
|
- */
|
|
|
- if (ife_src_res->is_dual_isp)
|
|
|
- vfe_acquire.vfe_in.sync_mode = CAM_ISP_HW_SYNC_MASTER;
|
|
|
-
|
|
|
- rc = hw_intf->hw_ops.reserve(hw_intf->hw_priv,
|
|
|
- &vfe_acquire,
|
|
|
- sizeof(struct cam_vfe_acquire_args));
|
|
|
- if (rc) {
|
|
|
- CAM_ERR(CAM_ISP,
|
|
|
- "Can not acquire IFE HW res %d",
|
|
|
- csid_res->res_id);
|
|
|
- goto err;
|
|
|
- }
|
|
|
- ife_src_res->hw_res[CAM_ISP_HW_SPLIT_LEFT] =
|
|
|
- vfe_acquire.vfe_in.rsrc_node;
|
|
|
- CAM_DBG(CAM_ISP,
|
|
|
- "acquire success IFE:%d res type :0x%x res id:0x%x",
|
|
|
- hw_intf->hw_idx,
|
|
|
- ife_src_res->hw_res[CAM_ISP_HW_SPLIT_LEFT]->res_type,
|
|
|
- ife_src_res->hw_res[CAM_ISP_HW_SPLIT_LEFT]->res_id);
|
|
|
-
|
|
|
- if (!ife_src_res->is_dual_isp)
|
|
|
- goto acq;
|
|
|
-
|
|
|
- for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
|
|
|
- if (i == CAM_ISP_HW_SPLIT_LEFT) {
|
|
|
- CAM_DBG(CAM_ISP, "vfe_idx %d is acquired",
|
|
|
- vfe_idx);
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- hw_intf = ife_hw_mgr->ife_devices[i];
|
|
|
-
|
|
|
- /* fill in more acquire information as needed */
|
|
|
- if (i == CAM_ISP_HW_SPLIT_RIGHT)
|
|
|
- vfe_acquire.vfe_in.sync_mode =
|
|
|
- CAM_ISP_HW_SYNC_SLAVE;
|
|
|
-
|
|
|
- rc = hw_intf->hw_ops.reserve(hw_intf->hw_priv,
|
|
|
- &vfe_acquire,
|
|
|
- sizeof(struct cam_vfe_acquire_args));
|
|
|
- if (rc) {
|
|
|
- CAM_ERR(CAM_ISP,
|
|
|
- "Can not acquire IFE HW res %d",
|
|
|
- csid_res->res_id);
|
|
|
- goto err;
|
|
|
- }
|
|
|
- ife_src_res->hw_res[i] = vfe_acquire.vfe_in.rsrc_node;
|
|
|
- CAM_DBG(CAM_ISP,
|
|
|
- "acquire success IFE:%d res type :0x%x res id:0x%x",
|
|
|
- hw_intf->hw_idx,
|
|
|
- ife_src_res->hw_res[i]->res_type,
|
|
|
- ife_src_res->hw_res[i]->res_id);
|
|
|
- }
|
|
|
-acq:
|
|
|
- /*
|
|
|
- * It should be one to one mapping between
|
|
|
- * csid resource and ife source resource
|
|
|
- */
|
|
|
- csid_res->num_children++;
|
|
|
- }
|
|
|
-
|
|
|
-err:
|
|
|
- /* release resource at the entry function */
|
|
|
- CAM_DBG(CAM_ISP, "Exit rc %d", rc);
|
|
|
- return rc;
|
|
|
-}
|
|
|
-
|
|
|
static int cam_convert_hw_idx_to_ife_hw_num(int hw_idx)
|
|
|
{
|
|
|
uint32_t hw_version, rc = 0;
|
|
@@ -1547,6 +1344,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_src(
|
|
|
vfe_acquire.tasklet = ife_ctx->common.tasklet_info;
|
|
|
vfe_acquire.vfe_in.cdm_ops = ife_ctx->cdm_ops;
|
|
|
vfe_acquire.vfe_in.in_port = in_port;
|
|
|
+ vfe_acquire.vfe_in.is_fe_enabled = ife_ctx->is_fe_enabled;
|
|
|
+ vfe_acquire.vfe_in.is_offline = ife_ctx->is_offline;
|
|
|
vfe_acquire.priv = ife_ctx;
|
|
|
vfe_acquire.event_cb = cam_ife_hw_mgr_event_handler;
|
|
|
|
|
@@ -1800,7 +1599,7 @@ static int cam_ife_mgr_acquire_cid_res(
|
|
|
|
|
|
/* Acquire Left if not already acquired */
|
|
|
/* For dual IFE cases, start acquiring the lower idx first */
|
|
|
- if (ife_ctx->is_fe_enable || in_port->usage_type)
|
|
|
+ if (ife_ctx->is_fe_enabled || in_port->usage_type)
|
|
|
rc = cam_ife_hw_mgr_acquire_csid_hw(ife_hw_mgr,
|
|
|
&csid_acquire, true);
|
|
|
else
|
|
@@ -2166,7 +1965,7 @@ static int cam_ife_hw_mgr_acquire_res_root(
|
|
|
ife_ctx->res_list_ife_in.res_id = in_port->res_type;
|
|
|
ife_ctx->res_list_ife_in.is_dual_isp = in_port->usage_type;
|
|
|
} else if ((ife_ctx->res_list_ife_in.res_id !=
|
|
|
- in_port->res_type) && (!ife_ctx->is_fe_enable)) {
|
|
|
+ in_port->res_type) && (!ife_ctx->is_fe_enabled)) {
|
|
|
CAM_ERR(CAM_ISP, "No Free resource for this context");
|
|
|
goto err;
|
|
|
} else {
|
|
@@ -2211,14 +2010,14 @@ static int cam_ife_mgr_check_and_update_fe_v0(
|
|
|
CAM_DBG(CAM_ISP, "in_port%d res_type %d", i,
|
|
|
in_port->res_type);
|
|
|
if (in_port->res_type == CAM_ISP_IFE_IN_RES_RD) {
|
|
|
- ife_ctx->is_fe_enable = true;
|
|
|
+ ife_ctx->is_fe_enabled = true;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
in_port = (struct cam_isp_in_port_info *)((uint8_t *)in_port +
|
|
|
in_port_length);
|
|
|
}
|
|
|
- CAM_DBG(CAM_ISP, "is_fe_enable %d", ife_ctx->is_fe_enable);
|
|
|
+ CAM_DBG(CAM_ISP, "is_fe_enabled %d", ife_ctx->is_fe_enabled);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -2256,14 +2055,17 @@ static int cam_ife_mgr_check_and_update_fe_v2(
|
|
|
CAM_DBG(CAM_ISP, "in_port%d res_type %d", i,
|
|
|
in_port->res_type);
|
|
|
if (in_port->res_type == CAM_ISP_IFE_IN_RES_RD) {
|
|
|
- ife_ctx->is_fe_enable = true;
|
|
|
+ ife_ctx->is_fe_enabled = true;
|
|
|
+ if (in_port->offline_mode)
|
|
|
+ ife_ctx->is_offline = true;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
in_port = (struct cam_isp_in_port_info_v2 *)
|
|
|
((uint8_t *)in_port + in_port_length);
|
|
|
}
|
|
|
- CAM_DBG(CAM_ISP, "is_fe_enable %d", ife_ctx->is_fe_enable);
|
|
|
+ CAM_DBG(CAM_ISP, "is_fe_enabled %d is_offline %d",
|
|
|
+ ife_ctx->is_fe_enabled, ife_ctx->is_offline);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -2316,22 +2118,21 @@ static int cam_ife_hw_mgr_preprocess_port(
|
|
|
|
|
|
ife_hw_mgr = ife_ctx->hw_mgr;
|
|
|
|
|
|
- if (in_port->res_type == CAM_ISP_IFE_IN_RES_RD) {
|
|
|
+ if (in_port->res_type == CAM_ISP_IFE_IN_RES_RD)
|
|
|
ife_rd_num++;
|
|
|
- } else {
|
|
|
- for (i = 0; i < in_port->num_out_res; i++) {
|
|
|
- out_port = &in_port->data[i];
|
|
|
- if (cam_ife_hw_mgr_is_rdi_res(out_port->res_type))
|
|
|
- rdi_num++;
|
|
|
- else if (out_port->res_type == CAM_ISP_IFE_OUT_RES_2PD)
|
|
|
- ppp_num++;
|
|
|
- else if (out_port->res_type == CAM_ISP_IFE_OUT_RES_LCR)
|
|
|
- lcr_num++;
|
|
|
- else {
|
|
|
- CAM_DBG(CAM_ISP, "out_res_type %d",
|
|
|
- out_port->res_type);
|
|
|
- ipp_num++;
|
|
|
- }
|
|
|
+
|
|
|
+ for (i = 0; i < in_port->num_out_res; i++) {
|
|
|
+ out_port = &in_port->data[i];
|
|
|
+ if (cam_ife_hw_mgr_is_rdi_res(out_port->res_type))
|
|
|
+ rdi_num++;
|
|
|
+ else if (out_port->res_type == CAM_ISP_IFE_OUT_RES_2PD)
|
|
|
+ ppp_num++;
|
|
|
+ else if (out_port->res_type == CAM_ISP_IFE_OUT_RES_LCR)
|
|
|
+ lcr_num++;
|
|
|
+ else {
|
|
|
+ CAM_DBG(CAM_ISP, "out_res_type %d",
|
|
|
+ out_port->res_type);
|
|
|
+ ipp_num++;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2347,6 +2148,290 @@ static int cam_ife_hw_mgr_preprocess_port(
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static int cam_ife_hw_mgr_acquire_offline_res_ife_bus_rd(
|
|
|
+ struct cam_ife_hw_mgr_ctx *ife_ctx,
|
|
|
+ struct cam_isp_in_port_generic_info *in_port)
|
|
|
+{
|
|
|
+ int rc = -EINVAL, j;
|
|
|
+ int i = CAM_ISP_HW_SPLIT_LEFT;
|
|
|
+ struct cam_vfe_acquire_args vfe_acquire;
|
|
|
+ struct cam_isp_hw_mgr_res *ife_bus_rd_res;
|
|
|
+ struct cam_hw_intf *hw_intf;
|
|
|
+ struct cam_ife_hw_mgr *ife_hw_mgr;
|
|
|
+
|
|
|
+ ife_hw_mgr = ife_ctx->hw_mgr;
|
|
|
+
|
|
|
+ rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &ife_bus_rd_res);
|
|
|
+ if (rc) {
|
|
|
+ CAM_ERR(CAM_ISP, "No more free hw mgr resource");
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+
|
|
|
+ vfe_acquire.rsrc_type = CAM_ISP_RESOURCE_VFE_BUS_RD;
|
|
|
+ vfe_acquire.tasklet = ife_ctx->common.tasklet_info;
|
|
|
+ vfe_acquire.priv = ife_ctx;
|
|
|
+ vfe_acquire.event_cb = cam_ife_hw_mgr_event_handler;
|
|
|
+
|
|
|
+ vfe_acquire.vfe_bus_rd.cdm_ops = ife_ctx->cdm_ops;
|
|
|
+ vfe_acquire.vfe_bus_rd.is_dual = (uint32_t)ife_ctx->is_dual;
|
|
|
+ vfe_acquire.vfe_bus_rd.is_offline = ife_ctx->is_offline;
|
|
|
+ vfe_acquire.vfe_bus_rd.res_id = CAM_ISP_HW_VFE_IN_RD;
|
|
|
+ vfe_acquire.vfe_bus_rd.unpacker_fmt = in_port->fe_unpacker_fmt;
|
|
|
+
|
|
|
+ for (j = 0; j < CAM_IFE_HW_NUM_MAX; j++) {
|
|
|
+ if (!ife_hw_mgr->ife_devices[j])
|
|
|
+ continue;
|
|
|
+
|
|
|
+ hw_intf = ife_hw_mgr->ife_devices[j];
|
|
|
+ rc = hw_intf->hw_ops.reserve(hw_intf->hw_priv,
|
|
|
+ &vfe_acquire, sizeof(struct cam_vfe_acquire_args));
|
|
|
+
|
|
|
+ if (!rc) {
|
|
|
+ ife_bus_rd_res->hw_res[i] =
|
|
|
+ vfe_acquire.vfe_bus_rd.rsrc_node;
|
|
|
+
|
|
|
+ CAM_DBG(CAM_ISP, "Acquired VFE:%d BUS RD for LEFT", j);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (j == CAM_IFE_HW_NUM_MAX || !vfe_acquire.vfe_bus_rd.rsrc_node) {
|
|
|
+ CAM_ERR(CAM_ISP, "Failed to acquire BUS RD for LEFT", i);
|
|
|
+ goto put_res;
|
|
|
+ }
|
|
|
+
|
|
|
+ ife_bus_rd_res->res_type = vfe_acquire.rsrc_type;
|
|
|
+ ife_bus_rd_res->res_id = vfe_acquire.vfe_in.res_id;
|
|
|
+ ife_bus_rd_res->is_dual_isp = (uint32_t)ife_ctx->is_dual;
|
|
|
+ cam_ife_hw_mgr_put_res(&ife_ctx->res_list_ife_in_rd, &ife_bus_rd_res);
|
|
|
+
|
|
|
+ if (ife_ctx->is_dual) {
|
|
|
+ for (j = 0; j < CAM_IFE_HW_NUM_MAX; j++) {
|
|
|
+ if (!ife_hw_mgr->ife_devices[j])
|
|
|
+ continue;
|
|
|
+
|
|
|
+ if (j == ife_bus_rd_res->hw_res[i]->hw_intf->hw_idx)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ hw_intf = ife_hw_mgr->ife_devices[j];
|
|
|
+ rc = hw_intf->hw_ops.reserve(hw_intf->hw_priv,
|
|
|
+ &vfe_acquire,
|
|
|
+ sizeof(struct cam_vfe_acquire_args));
|
|
|
+
|
|
|
+ if (!rc) {
|
|
|
+ ife_bus_rd_res->hw_res[++i] =
|
|
|
+ vfe_acquire.vfe_bus_rd.rsrc_node;
|
|
|
+
|
|
|
+ CAM_DBG(CAM_ISP,
|
|
|
+ "Acquired VFE:%d BUS RD for RIGHT", j);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (j == CAM_IFE_HW_NUM_MAX ||
|
|
|
+ !vfe_acquire.vfe_bus_rd.rsrc_node) {
|
|
|
+ CAM_ERR(CAM_ISP, "Failed to acquire BUS RD for RIGHT");
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+
|
|
|
+put_res:
|
|
|
+ cam_ife_hw_mgr_put_res(&ife_ctx->free_res_list, &ife_bus_rd_res);
|
|
|
+
|
|
|
+end:
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+static int cam_ife_hw_mgr_acquire_offline_res_ife_camif(
|
|
|
+ struct cam_ife_hw_mgr_ctx *ife_ctx,
|
|
|
+ struct cam_isp_in_port_generic_info *in_port,
|
|
|
+ bool acquire_lcr,
|
|
|
+ uint32_t *acquired_hw_id,
|
|
|
+ uint32_t *acquired_hw_path)
|
|
|
+{
|
|
|
+ int rc = -1;
|
|
|
+ int i = CAM_ISP_HW_SPLIT_LEFT;
|
|
|
+ struct cam_isp_hw_mgr_res *ife_src_res;
|
|
|
+ struct cam_isp_hw_mgr_res *ife_bus_rd_res;
|
|
|
+ struct cam_vfe_acquire_args vfe_acquire;
|
|
|
+ struct cam_hw_intf *hw_intf;
|
|
|
+ struct cam_ife_hw_mgr *ife_hw_mgr;
|
|
|
+
|
|
|
+ ife_hw_mgr = ife_ctx->hw_mgr;
|
|
|
+
|
|
|
+ ife_bus_rd_res = list_first_entry(&ife_ctx->res_list_ife_in_rd,
|
|
|
+ struct cam_isp_hw_mgr_res, list);
|
|
|
+
|
|
|
+ if (!ife_bus_rd_res) {
|
|
|
+ CAM_ERR(CAM_ISP, "BUS RD resource has not been acquired");
|
|
|
+ rc = -EINVAL;
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+
|
|
|
+ rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &ife_src_res);
|
|
|
+ if (rc) {
|
|
|
+ CAM_ERR(CAM_ISP, "No free resource");
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+
|
|
|
+ vfe_acquire.rsrc_type = CAM_ISP_RESOURCE_VFE_IN;
|
|
|
+ vfe_acquire.tasklet = ife_ctx->common.tasklet_info;
|
|
|
+ vfe_acquire.priv = ife_ctx;
|
|
|
+ vfe_acquire.event_cb = cam_ife_hw_mgr_event_handler;
|
|
|
+
|
|
|
+ vfe_acquire.vfe_in.cdm_ops = ife_ctx->cdm_ops;
|
|
|
+ vfe_acquire.vfe_in.in_port = in_port;
|
|
|
+ vfe_acquire.vfe_in.is_fe_enabled = ife_ctx->is_fe_enabled;
|
|
|
+ vfe_acquire.vfe_in.is_offline = ife_ctx->is_offline;
|
|
|
+
|
|
|
+ if (!acquire_lcr)
|
|
|
+ vfe_acquire.vfe_in.res_id = CAM_ISP_HW_VFE_IN_CAMIF;
|
|
|
+ else
|
|
|
+ vfe_acquire.vfe_in.res_id = CAM_ISP_HW_VFE_IN_LCR;
|
|
|
+
|
|
|
+ if (ife_ctx->is_dual)
|
|
|
+ vfe_acquire.vfe_in.sync_mode = CAM_ISP_HW_SYNC_MASTER;
|
|
|
+ else
|
|
|
+ vfe_acquire.vfe_in.sync_mode = CAM_ISP_HW_SYNC_NONE;
|
|
|
+
|
|
|
+ hw_intf = ife_hw_mgr->ife_devices[
|
|
|
+ ife_bus_rd_res->hw_res[i]->hw_intf->hw_idx];
|
|
|
+
|
|
|
+ rc = hw_intf->hw_ops.reserve(hw_intf->hw_priv, &vfe_acquire,
|
|
|
+ sizeof(struct cam_vfe_acquire_args));
|
|
|
+
|
|
|
+ if (rc) {
|
|
|
+ CAM_ERR(CAM_ISP, "Failed to acquire CAMIF for LEFT");
|
|
|
+ goto put_res;
|
|
|
+ }
|
|
|
+
|
|
|
+ ife_src_res->hw_res[i] = vfe_acquire.vfe_in.rsrc_node;
|
|
|
+
|
|
|
+ *acquired_hw_id |= cam_convert_hw_idx_to_ife_hw_num(
|
|
|
+ hw_intf->hw_idx);
|
|
|
+
|
|
|
+ acquired_hw_path[i] |= cam_convert_res_id_to_hw_path(
|
|
|
+ ife_src_res->hw_res[i]->res_id);
|
|
|
+
|
|
|
+ CAM_DBG(CAM_ISP, "Acquired VFE:%d CAMIF for LEFT",
|
|
|
+ ife_src_res->hw_res[i]->hw_intf->hw_idx);
|
|
|
+
|
|
|
+ ife_src_res->res_type = vfe_acquire.rsrc_type;
|
|
|
+ ife_src_res->res_id = vfe_acquire.vfe_in.res_id;
|
|
|
+ ife_src_res->is_dual_isp = (uint32_t)ife_ctx->is_dual;
|
|
|
+ cam_ife_hw_mgr_put_res(&ife_ctx->res_list_ife_src, &ife_src_res);
|
|
|
+
|
|
|
+ if (ife_ctx->is_dual) {
|
|
|
+ vfe_acquire.vfe_in.sync_mode = CAM_ISP_HW_SYNC_SLAVE;
|
|
|
+
|
|
|
+ hw_intf = ife_hw_mgr->ife_devices[
|
|
|
+ ife_bus_rd_res->hw_res[++i]->hw_intf->hw_idx];
|
|
|
+
|
|
|
+ rc = hw_intf->hw_ops.reserve(hw_intf->hw_priv, &vfe_acquire,
|
|
|
+ sizeof(struct cam_vfe_acquire_args));
|
|
|
+
|
|
|
+ if (rc) {
|
|
|
+ CAM_ERR(CAM_ISP, "Failed to acquire CAMIF for RIGHT");
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+
|
|
|
+ ife_src_res->hw_res[i] = vfe_acquire.vfe_in.rsrc_node;
|
|
|
+
|
|
|
+ *acquired_hw_id |= cam_convert_hw_idx_to_ife_hw_num(
|
|
|
+ hw_intf->hw_idx);
|
|
|
+
|
|
|
+ acquired_hw_path[i] |= cam_convert_res_id_to_hw_path(
|
|
|
+ ife_src_res->hw_res[i]->res_id);
|
|
|
+
|
|
|
+ CAM_DBG(CAM_ISP, "Acquired VFE:%d CAMIF for RIGHT",
|
|
|
+ ife_src_res->hw_res[i]->hw_intf->hw_idx);
|
|
|
+ }
|
|
|
+
|
|
|
+ ife_bus_rd_res->num_children++;
|
|
|
+
|
|
|
+ return rc;
|
|
|
+
|
|
|
+put_res:
|
|
|
+ cam_ife_hw_mgr_put_res(&ife_ctx->free_res_list, &ife_src_res);
|
|
|
+
|
|
|
+end:
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+static int cam_ife_mgr_acquire_hw_for_fe_ctx(
|
|
|
+ struct cam_ife_hw_mgr_ctx *ife_ctx,
|
|
|
+ struct cam_isp_in_port_generic_info *in_port,
|
|
|
+ uint32_t *num_pix_port,
|
|
|
+ uint32_t *acquired_hw_id,
|
|
|
+ uint32_t *acquired_hw_path)
|
|
|
+{
|
|
|
+ int rc = -1;
|
|
|
+ int ipp_count = 0;
|
|
|
+ int rdi_count = 0;
|
|
|
+ int ppp_count = 0;
|
|
|
+ int ife_rd_count = 0;
|
|
|
+ int lcr_count = 0;
|
|
|
+
|
|
|
+ ife_ctx->is_dual = (bool)in_port->usage_type;
|
|
|
+
|
|
|
+ cam_ife_hw_mgr_preprocess_port(ife_ctx, in_port, &ipp_count,
|
|
|
+ &rdi_count, &ppp_count, &ife_rd_count, &lcr_count);
|
|
|
+
|
|
|
+ if ((!ipp_count && !lcr_count) || !ife_rd_count) {
|
|
|
+ CAM_ERR(CAM_ISP,
|
|
|
+ "Invalid %d BUS RD %d PIX %d LCR ports for FE ctx");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (rdi_count || ppp_count) {
|
|
|
+ CAM_ERR(CAM_ISP,
|
|
|
+ "%d RDI %d PPP ports invalid for FE ctx",
|
|
|
+ rdi_count, ppp_count);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ rc = cam_ife_hw_mgr_acquire_offline_res_ife_bus_rd(ife_ctx, in_port);
|
|
|
+
|
|
|
+ if (rc) {
|
|
|
+ CAM_ERR(CAM_ISP, "Acquire IFE BUS RD resource Failed");
|
|
|
+ goto err;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ipp_count)
|
|
|
+ rc = cam_ife_hw_mgr_acquire_offline_res_ife_camif(ife_ctx,
|
|
|
+ in_port, false, acquired_hw_id, acquired_hw_path);
|
|
|
+
|
|
|
+ if (rc) {
|
|
|
+ CAM_ERR(CAM_ISP, "Acquire IFE IPP SRC resource Failed");
|
|
|
+ goto err;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (lcr_count)
|
|
|
+ rc = cam_ife_hw_mgr_acquire_offline_res_ife_camif(ife_ctx,
|
|
|
+ in_port, true, acquired_hw_id, acquired_hw_path);
|
|
|
+
|
|
|
+ if (rc) {
|
|
|
+ CAM_ERR(CAM_ISP, "Acquire IFE LCR SRC resource Failed");
|
|
|
+ goto err;
|
|
|
+ }
|
|
|
+
|
|
|
+ rc = cam_ife_hw_mgr_acquire_res_ife_out(ife_ctx, in_port);
|
|
|
+ if (rc) {
|
|
|
+ CAM_ERR(CAM_ISP, "Acquire IFE OUT resource Failed");
|
|
|
+ goto err;
|
|
|
+ }
|
|
|
+
|
|
|
+ *num_pix_port += ipp_count + lcr_count;
|
|
|
+
|
|
|
+ return 0;
|
|
|
+
|
|
|
+err:
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
static int cam_ife_mgr_acquire_hw_for_ctx(
|
|
|
struct cam_ife_hw_mgr_ctx *ife_ctx,
|
|
|
struct cam_isp_in_port_generic_info *in_port,
|
|
@@ -2373,10 +2458,14 @@ static int cam_ife_mgr_acquire_hw_for_ctx(
|
|
|
cam_ife_hw_mgr_preprocess_port(ife_ctx, in_port, &ipp_count,
|
|
|
&rdi_count, &ppp_count, &ife_rd_count, &lcr_count);
|
|
|
|
|
|
- if (!ipp_count && !rdi_count && !ppp_count && !ife_rd_count
|
|
|
- && !lcr_count) {
|
|
|
+ if (ife_rd_count) {
|
|
|
+ CAM_ERR(CAM_ISP, "Invalid BUS RD port for non-FE ctx");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!ipp_count && !rdi_count && !ppp_count && !lcr_count) {
|
|
|
CAM_ERR(CAM_ISP,
|
|
|
- "No PIX or RDI or PPP or IFE RD or LCR resource");
|
|
|
+ "No PIX or RDI or PPP or LCR resource");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
@@ -2421,15 +2510,7 @@ static int cam_ife_mgr_acquire_hw_for_ctx(
|
|
|
}
|
|
|
|
|
|
/* get ife src resource */
|
|
|
- if (ife_rd_count) {
|
|
|
- rc = cam_ife_hw_mgr_acquire_res_ife_rd_src(ife_ctx, in_port);
|
|
|
- rc = cam_ife_hw_mgr_acquire_res_bus_rd(ife_ctx, in_port);
|
|
|
-
|
|
|
- if (rc) {
|
|
|
- CAM_ERR(CAM_ISP, "Acquire IFE RD SRC resource Failed");
|
|
|
- goto err;
|
|
|
- }
|
|
|
- } else if (ipp_count || ppp_count || rdi_count) {
|
|
|
+ if (ipp_count || ppp_count || rdi_count) {
|
|
|
rc = cam_ife_hw_mgr_acquire_res_ife_src(ife_ctx,
|
|
|
in_port, false,
|
|
|
acquired_hw_id, acquired_hw_path);
|
|
@@ -2633,10 +2714,12 @@ static int cam_ife_mgr_acquire_get_unified_structure_v2(
|
|
|
|
|
|
if (port_info->num_valid_vc_dt == 0 ||
|
|
|
port_info->num_valid_vc_dt >= CAM_ISP_VC_DT_CFG) {
|
|
|
- CAM_ERR(CAM_ISP, "Invalid i/p arg invalid vc-dt: %d",
|
|
|
- in->num_valid_vc_dt);
|
|
|
- rc = -EINVAL;
|
|
|
- goto release_mem;
|
|
|
+ if (in->res_type != CAM_ISP_IFE_IN_RES_RD) {
|
|
|
+ CAM_ERR(CAM_ISP, "Invalid i/p arg invalid vc-dt: %d",
|
|
|
+ in->num_valid_vc_dt);
|
|
|
+ rc = -EINVAL;
|
|
|
+ goto release_mem;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
for (i = 0; i < port_info->num_valid_vc_dt; i++) {
|
|
@@ -2644,26 +2727,27 @@ static int cam_ife_mgr_acquire_get_unified_structure_v2(
|
|
|
port_info->dt[i] = in->dt[i];
|
|
|
}
|
|
|
|
|
|
- port_info->format = in->format;
|
|
|
- port_info->test_pattern = in->test_pattern;
|
|
|
- port_info->usage_type = in->usage_type;
|
|
|
- port_info->left_start = in->left_start;
|
|
|
- port_info->left_stop = in->left_stop;
|
|
|
- port_info->left_width = in->left_width;
|
|
|
- port_info->right_start = in->right_start;
|
|
|
- port_info->right_stop = in->right_stop;
|
|
|
- port_info->right_width = in->right_width;
|
|
|
- port_info->line_start = in->line_start;
|
|
|
- port_info->line_stop = in->line_stop;
|
|
|
- port_info->height = in->height;
|
|
|
- port_info->pixel_clk = in->pixel_clk;
|
|
|
- port_info->batch_size = in->batch_size;
|
|
|
- port_info->dsp_mode = in->dsp_mode;
|
|
|
- port_info->hbi_cnt = in->hbi_cnt;
|
|
|
- port_info->cust_node = in->cust_node;
|
|
|
- port_info->horizontal_bin = in->horizontal_bin;
|
|
|
- port_info->qcfa_bin = in->qcfa_bin;
|
|
|
- port_info->num_out_res = in->num_out_res;
|
|
|
+ port_info->format = in->format;
|
|
|
+ port_info->test_pattern = in->test_pattern;
|
|
|
+ port_info->usage_type = in->usage_type;
|
|
|
+ port_info->left_start = in->left_start;
|
|
|
+ port_info->left_stop = in->left_stop;
|
|
|
+ port_info->left_width = in->left_width;
|
|
|
+ port_info->right_start = in->right_start;
|
|
|
+ port_info->right_stop = in->right_stop;
|
|
|
+ port_info->right_width = in->right_width;
|
|
|
+ port_info->line_start = in->line_start;
|
|
|
+ port_info->line_stop = in->line_stop;
|
|
|
+ port_info->height = in->height;
|
|
|
+ port_info->pixel_clk = in->pixel_clk;
|
|
|
+ port_info->batch_size = in->batch_size;
|
|
|
+ port_info->dsp_mode = in->dsp_mode;
|
|
|
+ port_info->fe_unpacker_fmt = in->format;
|
|
|
+ port_info->hbi_cnt = in->hbi_cnt;
|
|
|
+ port_info->cust_node = in->cust_node;
|
|
|
+ port_info->horizontal_bin = in->horizontal_bin;
|
|
|
+ port_info->qcfa_bin = in->qcfa_bin;
|
|
|
+ port_info->num_out_res = in->num_out_res;
|
|
|
|
|
|
port_info->data = kcalloc(in->num_out_res,
|
|
|
sizeof(struct cam_isp_out_port_generic_info),
|
|
@@ -2822,10 +2906,17 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
|
|
|
goto free_mem;
|
|
|
}
|
|
|
|
|
|
- rc = cam_ife_mgr_acquire_hw_for_ctx(ife_ctx, in_port,
|
|
|
- &num_pix_port_per_in, &num_rdi_port_per_in,
|
|
|
- &acquire_args->acquired_hw_id[i],
|
|
|
- acquire_args->acquired_hw_path[i]);
|
|
|
+ if (ife_ctx->is_fe_enabled)
|
|
|
+ rc = cam_ife_mgr_acquire_hw_for_fe_ctx(
|
|
|
+ ife_ctx, in_port,
|
|
|
+ &num_pix_port_per_in,
|
|
|
+ &acquire_args->acquired_hw_id[i],
|
|
|
+ acquire_args->acquired_hw_path[i]);
|
|
|
+ else
|
|
|
+ rc = cam_ife_mgr_acquire_hw_for_ctx(ife_ctx, in_port,
|
|
|
+ &num_pix_port_per_in, &num_rdi_port_per_in,
|
|
|
+ &acquire_args->acquired_hw_id[i],
|
|
|
+ acquire_args->acquired_hw_path[i]);
|
|
|
|
|
|
total_pix_port += num_pix_port_per_in;
|
|
|
total_rdi_port += num_rdi_port_per_in;
|
|
@@ -2915,6 +3006,7 @@ void cam_ife_mgr_acquire_get_unified_dev_str(struct cam_isp_in_port_info *in,
|
|
|
gen_port_info->batch_size = in->batch_size;
|
|
|
gen_port_info->dsp_mode = in->dsp_mode;
|
|
|
gen_port_info->hbi_cnt = in->hbi_cnt;
|
|
|
+ gen_port_info->fe_unpacker_fmt = in->format;
|
|
|
gen_port_info->cust_node = 0;
|
|
|
gen_port_info->num_out_res = in->num_out_res;
|
|
|
|
|
@@ -3788,11 +3880,6 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args)
|
|
|
for (i = 0; i < CAM_IFE_HW_OUT_RES_MAX; i++)
|
|
|
cam_ife_hw_mgr_stop_hw_res(&ctx->res_list_ife_out[i]);
|
|
|
|
|
|
- /* IFE bus rd resources */
|
|
|
- list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_in_rd, list) {
|
|
|
- cam_ife_hw_mgr_stop_hw_res(hw_mgr_res);
|
|
|
- }
|
|
|
-
|
|
|
CAM_DBG(CAM_ISP, "Going to stop IFE Mux");
|
|
|
|
|
|
/* IFE mux in resources */
|
|
@@ -3800,6 +3887,11 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args)
|
|
|
cam_ife_hw_mgr_stop_hw_res(hw_mgr_res);
|
|
|
}
|
|
|
|
|
|
+ /* IFE bus rd resources */
|
|
|
+ list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_in_rd, list) {
|
|
|
+ cam_ife_hw_mgr_stop_hw_res(hw_mgr_res);
|
|
|
+ }
|
|
|
+
|
|
|
cam_tasklet_stop(ctx->common.tasklet_info);
|
|
|
|
|
|
cam_ife_mgr_pause_hw(ctx);
|
|
@@ -4090,18 +4182,6 @@ start_only:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- CAM_DBG(CAM_ISP, "START IFE BUS RD ... in ctx id:%d",
|
|
|
- ctx->ctx_index);
|
|
|
- /* Start the IFE mux in devices */
|
|
|
- list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_in_rd, list) {
|
|
|
- rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx);
|
|
|
- if (rc) {
|
|
|
- CAM_ERR(CAM_ISP, "Can not start IFE BUS RD (%d)",
|
|
|
- hw_mgr_res->res_id);
|
|
|
- goto err;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
if (primary_rdi_out_res < CAM_ISP_IFE_OUT_RES_MAX)
|
|
|
primary_rdi_src_res =
|
|
|
cam_convert_rdi_out_res_id_to_src(primary_rdi_out_res);
|
|
@@ -4114,15 +4194,25 @@ start_only:
|
|
|
hw_mgr_res->hw_res[0]->rdi_only_ctx =
|
|
|
ctx->is_rdi_only_context;
|
|
|
}
|
|
|
-
|
|
|
rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx);
|
|
|
if (rc) {
|
|
|
- CAM_ERR(CAM_ISP, "Can not start IFE MUX (%d)",
|
|
|
+ CAM_ERR(CAM_ISP, "Can not start IFE Mux (%d)",
|
|
|
hw_mgr_res->res_id);
|
|
|
goto err;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ CAM_DBG(CAM_ISP, "START IFE BUS RD ... in ctx id:%d", ctx->ctx_index);
|
|
|
+ /* Start IFE Bus RD devices */
|
|
|
+ list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_in_rd, list) {
|
|
|
+ rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx);
|
|
|
+ if (rc) {
|
|
|
+ CAM_ERR(CAM_ISP, "Can not start IFE BUS RD (%d)",
|
|
|
+ hw_mgr_res->res_id);
|
|
|
+ goto err;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
CAM_DBG(CAM_ISP, "START CSID HW ... in ctx id:%d",
|
|
|
ctx->ctx_index);
|
|
|
/* Start the IFE CSID HW devices */
|
|
@@ -5838,6 +5928,18 @@ static int cam_ife_mgr_prepare_hw_update(void *hw_mgr_priv,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /* add go_cmd for offline context */
|
|
|
+ if (prepare->num_out_map_entries && prepare->num_in_map_entries &&
|
|
|
+ ctx->is_offline) {
|
|
|
+ rc = cam_isp_add_go_cmd(prepare, &ctx->res_list_ife_in_rd,
|
|
|
+ ctx->base[i].idx, &kmd_buf);
|
|
|
+ if (rc)
|
|
|
+ CAM_ERR(CAM_ISP,
|
|
|
+ "Add GO_CMD faled i: %d, idx: %d, rc: %d",
|
|
|
+ i, ctx->base[i].idx, rc);
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
* reg update will be done later for the initial configure.
|
|
|
* need to plus one to the op_code and only take the lower
|
|
@@ -6075,7 +6177,10 @@ static int cam_ife_mgr_cmd(void *hw_mgr_priv, void *cmd_args)
|
|
|
isp_hw_cmd_args->u.sof_irq_enable);
|
|
|
break;
|
|
|
case CAM_ISP_HW_MGR_CMD_CTX_TYPE:
|
|
|
- if (ctx->is_fe_enable)
|
|
|
+ if (ctx->is_fe_enabled && ctx->is_offline)
|
|
|
+ isp_hw_cmd_args->u.ctx_type =
|
|
|
+ CAM_ISP_CTX_OFFLINE;
|
|
|
+ else if (ctx->is_fe_enabled && !ctx->is_offline)
|
|
|
isp_hw_cmd_args->u.ctx_type = CAM_ISP_CTX_FS2;
|
|
|
else if (ctx->is_rdi_only_context)
|
|
|
isp_hw_cmd_args->u.ctx_type = CAM_ISP_CTX_RDI;
|
|
@@ -6309,6 +6414,17 @@ end:
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
+static inline void cam_ife_hw_mgr_get_offline_sof_timestamp(
|
|
|
+ uint64_t *timestamp,
|
|
|
+ uint64_t *boot_time)
|
|
|
+{
|
|
|
+ struct timespec64 ts;
|
|
|
+
|
|
|
+ ktime_get_boottime_ts64(&ts);
|
|
|
+ *timestamp = (uint64_t)((ts.tv_sec * 1000000000) + ts.tv_nsec);
|
|
|
+ *boot_time = *timestamp;
|
|
|
+}
|
|
|
+
|
|
|
static int cam_ife_mgr_cmd_get_sof_timestamp(
|
|
|
struct cam_ife_hw_mgr_ctx *ife_ctx,
|
|
|
uint64_t *time_stamp,
|
|
@@ -6681,6 +6797,7 @@ static int cam_ife_hw_mgr_handle_hw_rup(
|
|
|
|
|
|
case CAM_ISP_HW_VFE_IN_PDLIB:
|
|
|
case CAM_ISP_HW_VFE_IN_LCR:
|
|
|
+ case CAM_ISP_HW_VFE_IN_RD:
|
|
|
break;
|
|
|
default:
|
|
|
CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d",
|
|
@@ -6810,6 +6927,8 @@ static int cam_ife_hw_mgr_handle_hw_sof(
|
|
|
struct cam_isp_hw_sof_event_data sof_done_event_data;
|
|
|
int rc = 0;
|
|
|
|
|
|
+ memset(&sof_done_event_data, 0, sizeof(sof_done_event_data));
|
|
|
+
|
|
|
ife_hw_irq_sof_cb =
|
|
|
ife_hw_mgr_ctx->common.event_cb[CAM_ISP_HW_EVENT_SOF];
|
|
|
|
|
@@ -6820,10 +6939,15 @@ static int cam_ife_hw_mgr_handle_hw_sof(
|
|
|
rc = cam_ife_hw_mgr_check_irq_for_dual_vfe(ife_hw_mgr_ctx,
|
|
|
CAM_ISP_HW_EVENT_SOF);
|
|
|
if (!rc) {
|
|
|
- cam_ife_mgr_cmd_get_sof_timestamp(
|
|
|
- ife_hw_mgr_ctx,
|
|
|
- &sof_done_event_data.timestamp,
|
|
|
- &sof_done_event_data.boot_time);
|
|
|
+ if (ife_hw_mgr_ctx->is_offline)
|
|
|
+ cam_ife_hw_mgr_get_offline_sof_timestamp(
|
|
|
+ &sof_done_event_data.timestamp,
|
|
|
+ &sof_done_event_data.boot_time);
|
|
|
+ else
|
|
|
+ cam_ife_mgr_cmd_get_sof_timestamp(
|
|
|
+ ife_hw_mgr_ctx,
|
|
|
+ &sof_done_event_data.timestamp,
|
|
|
+ &sof_done_event_data.boot_time);
|
|
|
|
|
|
/* if frame header is enabled reset qtimer ts */
|
|
|
if (ife_hw_mgr_ctx->use_frame_header_ts)
|