Loading drivers/cam_isp/cam_isp_context.c +90 −140 Original line number Diff line number Diff line Loading @@ -314,52 +314,46 @@ static int cam_isp_ctx_dump_req( size_t *offset, bool dump_to_buff) { int i, j, rc = 0; int i, rc = 0; size_t len = 0; uint32_t *buf_addr; uint32_t *buf_start, *buf_end; size_t remain_len = 0; struct cam_cdm_cmd_buf_dump_info dump_info; uint32_t num_cfg; struct cam_hw_update_entry *cfg; for (j = 0; j < CAM_IFE_HW_NUM_MAX; j++) { num_cfg = req_isp->cfg_info[j].num_hw_entries; cfg = req_isp->cfg_info[j].hw_entries; for (i = 0; i < num_cfg; i++) { for (i = 0; i < req_isp->num_cfg; i++) { rc = cam_packet_util_get_cmd_mem_addr( cfg[i].handle, &buf_addr, &len); req_isp->cfg[i].handle, &buf_addr, &len); if (rc) { CAM_ERR_RATE_LIMIT(CAM_ISP, "Failed to get_cmd_mem_addr, rc=%d", rc); } else { if (cfg[i].offset >= ((uint32_t)len)) { if (req_isp->cfg[i].offset >= ((uint32_t)len)) { CAM_ERR(CAM_ISP, "Invalid offset exp %u actual %u", cfg[i].offset, (uint32_t)len); req_isp->cfg[i].offset, (uint32_t)len); return -EINVAL; } remain_len = len - cfg[i].offset; remain_len = len - req_isp->cfg[i].offset; if (req_isp->cfg_info[j].hw_entries[i].len > if (req_isp->cfg[i].len > ((uint32_t)remain_len)) { CAM_ERR(CAM_ISP, "Invalid len exp %u remain_len %u", cfg[i].len, req_isp->cfg[i].len, (uint32_t)remain_len); return -EINVAL; } buf_start = (uint32_t *)((uint8_t *) buf_addr + cfg[i].offset); req_isp->cfg[i].offset); buf_end = (uint32_t *)((uint8_t *) buf_start + cfg[i].len - 1); req_isp->cfg[i].len - 1); if (dump_to_buff) { if (!cpu_addr || !offset || !buf_len) { CAM_ERR(CAM_ISP, "Invalid args"); CAM_ERR(CAM_ISP, "Invalid args"); break; } dump_info.src_start = buf_start; Loading @@ -373,12 +367,9 @@ static int cam_isp_ctx_dump_req( if (rc) return rc; } else cam_cdm_util_dump_cmd_buf(buf_start, buf_end); } cam_cdm_util_dump_cmd_buf(buf_start, buf_end); } } return rc; } Loading Loading @@ -429,17 +420,13 @@ static int __cam_isp_ctx_enqueue_request_in_order( static int __cam_isp_ctx_enqueue_init_request( struct cam_context *ctx, struct cam_ctx_request *req) { int rc = 0, i = 0; int rc = 0; struct cam_ctx_request *req_old; struct cam_isp_ctx_req *req_isp_old; struct cam_isp_ctx_req *req_isp_new; struct cam_isp_prepare_hw_update_data *req_update_old; struct cam_isp_prepare_hw_update_data *req_update_new; struct cam_isp_prepare_hw_update_data *hw_update_data; struct cam_hw_update_entry *cfg_old; struct cam_hw_update_entry *cfg_new; uint32_t num_cfg_old; uint32_t num_cfg_new; spin_lock_bh(&ctx->lock); if (list_empty(&ctx->pending_req_list)) { Loading @@ -455,12 +442,12 @@ static int __cam_isp_ctx_enqueue_init_request( req_isp_new = (struct cam_isp_ctx_req *) req->req_priv; if (req_isp_old->hw_update_data.packet_opcode_type == CAM_ISP_PACKET_INIT_DEV) { if ((req_isp_old->total_num_cfg + req_isp_new->total_num_cfg) >= if ((req_isp_old->num_cfg + req_isp_new->num_cfg) >= CAM_ISP_CTX_CFG_MAX) { CAM_WARN(CAM_ISP, "Can not merge INIT pkt total_num_cfgs = %d", (req_isp_old->total_num_cfg + req_isp_new->total_num_cfg)); "Can not merge INIT pkt num_cfgs = %d", (req_isp_old->num_cfg + req_isp_new->num_cfg)); rc = -ENOMEM; } Loading @@ -485,19 +472,11 @@ static int __cam_isp_ctx_enqueue_init_request( req_isp_old->num_fence_map_in = req_isp_new->num_fence_map_in; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { cfg_old = req_isp_old->cfg_info[i].hw_entries; cfg_new = req_isp_new->cfg_info[i].hw_entries; num_cfg_old = req_isp_old->cfg_info[i].num_hw_entries; num_cfg_new = req_isp_new->cfg_info[i].num_hw_entries; memcpy(&cfg_old[num_cfg_old], cfg_new, sizeof(cfg_new[0]) * num_cfg_new); req_isp_old->cfg_info[i].num_hw_entries += num_cfg_new; } memcpy(&req_isp_old->cfg[req_isp_old->num_cfg], req_isp_new->cfg, sizeof(req_isp_new->cfg[0]) * req_isp_new->num_cfg); req_isp_old->num_cfg += req_isp_new->num_cfg; memcpy(&req_old->pf_data, &req->pf_data, sizeof(struct cam_hw_mgr_dump_pf_data)); Loading Loading @@ -1088,12 +1067,12 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state( static int __cam_isp_ctx_apply_req_offline( void *priv, void *data) { int rc = 0, i = 0; int rc = 0; struct cam_context *ctx = NULL; struct cam_isp_context *ctx_isp = priv; struct cam_ctx_request *req; struct cam_isp_ctx_req *req_isp; struct cam_isp_hw_config_args cfg; struct cam_hw_config_args cfg; if (!ctx_isp) { CAM_ERR(CAM_ISP, "Invalid ctx_isp:%pK", ctx); Loading Loading @@ -1129,12 +1108,8 @@ static int __cam_isp_ctx_apply_req_offline( cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; cfg.request_id = req->request_id; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { cfg.hw_update_info[i].num_hw_entries = req_isp->cfg_info[i].num_hw_entries; cfg.hw_update_info[i].hw_entries = req_isp->cfg_info[i].hw_entries; } cfg.hw_update_entries = req_isp->cfg; cfg.num_hw_update_entries = req_isp->num_cfg; cfg.priv = &req_isp->hw_update_data; cfg.init_packet = 0; Loading Loading @@ -2511,13 +2486,13 @@ static int __cam_isp_ctx_apply_req_in_activated_state( struct cam_context *ctx, struct cam_req_mgr_apply_request *apply, enum cam_isp_ctx_activated_substate next_state) { int rc = 0, i; int rc = 0; struct cam_ctx_request *req; struct cam_ctx_request *active_req = NULL; struct cam_isp_ctx_req *req_isp; struct cam_isp_ctx_req *active_req_isp; struct cam_isp_context *ctx_isp = NULL; struct cam_isp_hw_config_args isp_cfg; struct cam_hw_config_args cfg = {0}; if (list_empty(&ctx->pending_req_list)) { CAM_ERR(CAM_ISP, "No available request for Apply id %lld", Loading Loading @@ -2603,22 +2578,16 @@ static int __cam_isp_ctx_apply_req_in_activated_state( } req_isp->bubble_report = apply->report_if_bubble; memset(&isp_cfg, 0, sizeof(isp_cfg)); isp_cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; isp_cfg.request_id = req->request_id; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { isp_cfg.hw_update_info[i].num_hw_entries = req_isp->cfg_info[i].num_hw_entries; isp_cfg.hw_update_info[i].hw_entries = req_isp->cfg_info[i].hw_entries; } isp_cfg.priv = &req_isp->hw_update_data; isp_cfg.init_packet = 0; isp_cfg.reapply = req_isp->reapply; cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; cfg.request_id = req->request_id; cfg.hw_update_entries = req_isp->cfg; cfg.num_hw_update_entries = req_isp->num_cfg; cfg.priv = &req_isp->hw_update_data; cfg.init_packet = 0; cfg.reapply = req_isp->reapply; rc = ctx->hw_mgr_intf->hw_config(ctx->hw_mgr_intf->hw_mgr_priv, &isp_cfg); &cfg); if (rc) { CAM_ERR_RATE_LIMIT(CAM_ISP, "Can not apply the configuration"); } else { Loading Loading @@ -3838,7 +3807,7 @@ static int __cam_isp_ctx_config_dev_in_top_state( struct cam_packet *packet; size_t len = 0; size_t remain_len = 0; struct cam_isp_hw_update_args isp_cfg; struct cam_hw_prepare_update_args cfg = {0}; struct cam_req_mgr_add_request add_req; struct cam_isp_context *ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; Loading Loading @@ -3918,44 +3887,31 @@ static int __cam_isp_ctx_config_dev_in_top_state( goto free_req; } /* preprocess the configuration */ memset(&isp_cfg, 0, sizeof(isp_cfg)); isp_cfg.packet = packet; isp_cfg.remain_len = remain_len; isp_cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; isp_cfg.max_hw_update_entries = CAM_ISP_CTX_CFG_MAX; isp_cfg.max_out_map_entries = CAM_ISP_CTX_RES_MAX; isp_cfg.max_in_map_entries = CAM_ISP_CTX_RES_MAX; isp_cfg.out_map_entries = req_isp->fence_map_out; isp_cfg.in_map_entries = req_isp->fence_map_in; isp_cfg.priv = &req_isp->hw_update_data; isp_cfg.pf_data = &(req->pf_data); for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) isp_cfg.hw_update_info[i].hw_entries = req_isp->cfg_info[i].hw_entries; cfg.packet = packet; cfg.remain_len = remain_len; cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; cfg.max_hw_update_entries = CAM_ISP_CTX_CFG_MAX; cfg.hw_update_entries = req_isp->cfg; cfg.max_out_map_entries = CAM_ISP_CTX_RES_MAX; cfg.max_in_map_entries = CAM_ISP_CTX_RES_MAX; cfg.out_map_entries = req_isp->fence_map_out; cfg.in_map_entries = req_isp->fence_map_in; cfg.priv = &req_isp->hw_update_data; cfg.pf_data = &(req->pf_data); CAM_DBG(CAM_ISP, "try to prepare config packet......"); rc = ctx->hw_mgr_intf->hw_prepare_update( ctx->hw_mgr_intf->hw_mgr_priv, &isp_cfg); ctx->hw_mgr_intf->hw_mgr_priv, &cfg); if (rc != 0) { CAM_ERR(CAM_ISP, "Prepare config packet failed in HW layer"); rc = -EFAULT; goto free_req; } req_isp->total_num_cfg = 0; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { req_isp->cfg_info[i].num_hw_entries = isp_cfg.hw_update_info[i].num_hw_entries; req_isp->total_num_cfg += req_isp->cfg_info[i].num_hw_entries; } req_isp->num_fence_map_out = isp_cfg.num_out_map_entries; req_isp->num_fence_map_in = isp_cfg.num_in_map_entries; req_isp->num_cfg = cfg.num_hw_update_entries; req_isp->num_fence_map_out = cfg.num_out_map_entries; req_isp->num_fence_map_in = cfg.num_in_map_entries; req_isp->num_acked = 0; req_isp->bubble_detected = false; Loading @@ -3969,7 +3925,7 @@ static int __cam_isp_ctx_config_dev_in_top_state( } CAM_DBG(CAM_ISP, "num_entry: %d, num fence out: %d, num fence in: %d", req_isp->total_num_cfg, req_isp->num_fence_map_out, req_isp->num_cfg, req_isp->num_fence_map_out, req_isp->num_fence_map_in); req->request_id = packet->header.request_id; Loading Loading @@ -4704,14 +4660,8 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx, start_isp.hw_config.ctxt_to_hw_map = ctx_isp->hw_ctx; start_isp.hw_config.request_id = req->request_id; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { start_isp.hw_config.hw_update_info[i].hw_entries = req_isp->cfg_info[i].hw_entries; start_isp.hw_config.hw_update_info[i].num_hw_entries = req_isp->cfg_info[i].num_hw_entries; } start_isp.hw_config.hw_update_entries = req_isp->cfg; start_isp.hw_config.num_hw_update_entries = req_isp->num_cfg; start_isp.hw_config.priv = &req_isp->hw_update_data; start_isp.hw_config.init_packet = 1; start_isp.hw_config.reapply = 0; Loading drivers/cam_isp/cam_isp_context.h +4 −4 Original line number Diff line number Diff line Loading @@ -135,8 +135,8 @@ struct cam_isp_ctx_irq_ops { * struct cam_isp_ctx_req - ISP context request object * * @base: Common request object ponter * @cfg_info: ISP hardware configuration array * @total_num_cfg: Number of ISP hardware configuration entries * @cfg: ISP hardware configuration array * @num_cfg: Number of ISP hardware configuration entries * @fence_map_out: Output fence mapping array * @num_fence_map_out: Number of the output fence map * @fence_map_in: Input fence mapping array Loading @@ -153,8 +153,8 @@ struct cam_isp_ctx_irq_ops { */ struct cam_isp_ctx_req { struct cam_ctx_request *base; struct cam_isp_hw_update_info cfg_info[CAM_IFE_HW_NUM_MAX]; uint32_t total_num_cfg; struct cam_hw_update_entry cfg[CAM_ISP_CTX_CFG_MAX]; uint32_t num_cfg; struct cam_hw_fence_map_entry fence_map_out [CAM_ISP_CTX_RES_MAX]; uint32_t num_fence_map_out; Loading drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +234 −515 File changed.Preview size limit exceeded, changes collapsed. Show changes drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.h +2 −12 Original line number Diff line number Diff line Loading @@ -15,14 +15,6 @@ #include "cam_tasklet_util.h" #include "cam_cdm_intf_api.h" /* enum cam_ife_res_master_slave - HW resource master/slave */ enum cam_ife_res_master_slave { CAM_IFE_RES_NONE, CAM_IFE_RES_MASTER, CAM_IFE_RES_SLAVE, CAM_IFE_RES_MAX, }; /* IFE resource constants */ #define CAM_IFE_HW_IN_RES_MAX (CAM_ISP_IFE_IN_RES_MAX & 0xFF) #define CAM_IFE_HW_OUT_RES_MAX (CAM_ISP_IFE_OUT_RES_MAX & 0xFF) Loading Loading @@ -134,7 +126,7 @@ struct cam_ife_hw_mgr_ctx { uint32_t irq_status1_mask[CAM_IFE_HW_NUM_MAX]; struct cam_isp_ctx_base_info base[CAM_IFE_HW_NUM_MAX]; uint32_t num_base; uint32_t cdm_handle[CAM_IFE_HW_NUM_MAX]; uint32_t cdm_handle; struct cam_cdm_utils_ops *cdm_ops; struct cam_cdm_bl_request *cdm_cmd; Loading @@ -144,9 +136,7 @@ struct cam_ife_hw_mgr_ctx { atomic_t overflow_pending; atomic_t cdm_done; uint32_t is_rdi_only_context; struct completion config_done_complete[ CAM_IFE_HW_NUM_MAX]; enum cam_ife_res_master_slave master_slave[CAM_IFE_HW_NUM_MAX]; struct completion config_done_complete; uint32_t hw_version; struct cam_cmd_buf_desc reg_dump_buf_desc[ CAM_REG_DUMP_MAX_BUF_ENTRIES]; Loading drivers/cam_isp/isp_hw_mgr/cam_isp_hw_mgr.h +0 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,6 @@ #include "cam_isp_hw_mgr_intf.h" #include "cam_tasklet_util.h" #include "cam_isp_hw.h" #include "cam_cdm_intf_api.h" #define CAM_ISP_HW_NUM_MAX 7 Loading Loading @@ -91,6 +90,5 @@ struct cam_isp_hw_mgr_res { struct cam_isp_ctx_base_info { uint32_t idx; enum cam_isp_hw_split_id split_id; enum cam_cdm_id cdm_id; }; #endif /* _CAM_ISP_HW_MGR_H_ */ Loading
drivers/cam_isp/cam_isp_context.c +90 −140 Original line number Diff line number Diff line Loading @@ -314,52 +314,46 @@ static int cam_isp_ctx_dump_req( size_t *offset, bool dump_to_buff) { int i, j, rc = 0; int i, rc = 0; size_t len = 0; uint32_t *buf_addr; uint32_t *buf_start, *buf_end; size_t remain_len = 0; struct cam_cdm_cmd_buf_dump_info dump_info; uint32_t num_cfg; struct cam_hw_update_entry *cfg; for (j = 0; j < CAM_IFE_HW_NUM_MAX; j++) { num_cfg = req_isp->cfg_info[j].num_hw_entries; cfg = req_isp->cfg_info[j].hw_entries; for (i = 0; i < num_cfg; i++) { for (i = 0; i < req_isp->num_cfg; i++) { rc = cam_packet_util_get_cmd_mem_addr( cfg[i].handle, &buf_addr, &len); req_isp->cfg[i].handle, &buf_addr, &len); if (rc) { CAM_ERR_RATE_LIMIT(CAM_ISP, "Failed to get_cmd_mem_addr, rc=%d", rc); } else { if (cfg[i].offset >= ((uint32_t)len)) { if (req_isp->cfg[i].offset >= ((uint32_t)len)) { CAM_ERR(CAM_ISP, "Invalid offset exp %u actual %u", cfg[i].offset, (uint32_t)len); req_isp->cfg[i].offset, (uint32_t)len); return -EINVAL; } remain_len = len - cfg[i].offset; remain_len = len - req_isp->cfg[i].offset; if (req_isp->cfg_info[j].hw_entries[i].len > if (req_isp->cfg[i].len > ((uint32_t)remain_len)) { CAM_ERR(CAM_ISP, "Invalid len exp %u remain_len %u", cfg[i].len, req_isp->cfg[i].len, (uint32_t)remain_len); return -EINVAL; } buf_start = (uint32_t *)((uint8_t *) buf_addr + cfg[i].offset); req_isp->cfg[i].offset); buf_end = (uint32_t *)((uint8_t *) buf_start + cfg[i].len - 1); req_isp->cfg[i].len - 1); if (dump_to_buff) { if (!cpu_addr || !offset || !buf_len) { CAM_ERR(CAM_ISP, "Invalid args"); CAM_ERR(CAM_ISP, "Invalid args"); break; } dump_info.src_start = buf_start; Loading @@ -373,12 +367,9 @@ static int cam_isp_ctx_dump_req( if (rc) return rc; } else cam_cdm_util_dump_cmd_buf(buf_start, buf_end); } cam_cdm_util_dump_cmd_buf(buf_start, buf_end); } } return rc; } Loading Loading @@ -429,17 +420,13 @@ static int __cam_isp_ctx_enqueue_request_in_order( static int __cam_isp_ctx_enqueue_init_request( struct cam_context *ctx, struct cam_ctx_request *req) { int rc = 0, i = 0; int rc = 0; struct cam_ctx_request *req_old; struct cam_isp_ctx_req *req_isp_old; struct cam_isp_ctx_req *req_isp_new; struct cam_isp_prepare_hw_update_data *req_update_old; struct cam_isp_prepare_hw_update_data *req_update_new; struct cam_isp_prepare_hw_update_data *hw_update_data; struct cam_hw_update_entry *cfg_old; struct cam_hw_update_entry *cfg_new; uint32_t num_cfg_old; uint32_t num_cfg_new; spin_lock_bh(&ctx->lock); if (list_empty(&ctx->pending_req_list)) { Loading @@ -455,12 +442,12 @@ static int __cam_isp_ctx_enqueue_init_request( req_isp_new = (struct cam_isp_ctx_req *) req->req_priv; if (req_isp_old->hw_update_data.packet_opcode_type == CAM_ISP_PACKET_INIT_DEV) { if ((req_isp_old->total_num_cfg + req_isp_new->total_num_cfg) >= if ((req_isp_old->num_cfg + req_isp_new->num_cfg) >= CAM_ISP_CTX_CFG_MAX) { CAM_WARN(CAM_ISP, "Can not merge INIT pkt total_num_cfgs = %d", (req_isp_old->total_num_cfg + req_isp_new->total_num_cfg)); "Can not merge INIT pkt num_cfgs = %d", (req_isp_old->num_cfg + req_isp_new->num_cfg)); rc = -ENOMEM; } Loading @@ -485,19 +472,11 @@ static int __cam_isp_ctx_enqueue_init_request( req_isp_old->num_fence_map_in = req_isp_new->num_fence_map_in; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { cfg_old = req_isp_old->cfg_info[i].hw_entries; cfg_new = req_isp_new->cfg_info[i].hw_entries; num_cfg_old = req_isp_old->cfg_info[i].num_hw_entries; num_cfg_new = req_isp_new->cfg_info[i].num_hw_entries; memcpy(&cfg_old[num_cfg_old], cfg_new, sizeof(cfg_new[0]) * num_cfg_new); req_isp_old->cfg_info[i].num_hw_entries += num_cfg_new; } memcpy(&req_isp_old->cfg[req_isp_old->num_cfg], req_isp_new->cfg, sizeof(req_isp_new->cfg[0]) * req_isp_new->num_cfg); req_isp_old->num_cfg += req_isp_new->num_cfg; memcpy(&req_old->pf_data, &req->pf_data, sizeof(struct cam_hw_mgr_dump_pf_data)); Loading Loading @@ -1088,12 +1067,12 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state( static int __cam_isp_ctx_apply_req_offline( void *priv, void *data) { int rc = 0, i = 0; int rc = 0; struct cam_context *ctx = NULL; struct cam_isp_context *ctx_isp = priv; struct cam_ctx_request *req; struct cam_isp_ctx_req *req_isp; struct cam_isp_hw_config_args cfg; struct cam_hw_config_args cfg; if (!ctx_isp) { CAM_ERR(CAM_ISP, "Invalid ctx_isp:%pK", ctx); Loading Loading @@ -1129,12 +1108,8 @@ static int __cam_isp_ctx_apply_req_offline( cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; cfg.request_id = req->request_id; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { cfg.hw_update_info[i].num_hw_entries = req_isp->cfg_info[i].num_hw_entries; cfg.hw_update_info[i].hw_entries = req_isp->cfg_info[i].hw_entries; } cfg.hw_update_entries = req_isp->cfg; cfg.num_hw_update_entries = req_isp->num_cfg; cfg.priv = &req_isp->hw_update_data; cfg.init_packet = 0; Loading Loading @@ -2511,13 +2486,13 @@ static int __cam_isp_ctx_apply_req_in_activated_state( struct cam_context *ctx, struct cam_req_mgr_apply_request *apply, enum cam_isp_ctx_activated_substate next_state) { int rc = 0, i; int rc = 0; struct cam_ctx_request *req; struct cam_ctx_request *active_req = NULL; struct cam_isp_ctx_req *req_isp; struct cam_isp_ctx_req *active_req_isp; struct cam_isp_context *ctx_isp = NULL; struct cam_isp_hw_config_args isp_cfg; struct cam_hw_config_args cfg = {0}; if (list_empty(&ctx->pending_req_list)) { CAM_ERR(CAM_ISP, "No available request for Apply id %lld", Loading Loading @@ -2603,22 +2578,16 @@ static int __cam_isp_ctx_apply_req_in_activated_state( } req_isp->bubble_report = apply->report_if_bubble; memset(&isp_cfg, 0, sizeof(isp_cfg)); isp_cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; isp_cfg.request_id = req->request_id; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { isp_cfg.hw_update_info[i].num_hw_entries = req_isp->cfg_info[i].num_hw_entries; isp_cfg.hw_update_info[i].hw_entries = req_isp->cfg_info[i].hw_entries; } isp_cfg.priv = &req_isp->hw_update_data; isp_cfg.init_packet = 0; isp_cfg.reapply = req_isp->reapply; cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; cfg.request_id = req->request_id; cfg.hw_update_entries = req_isp->cfg; cfg.num_hw_update_entries = req_isp->num_cfg; cfg.priv = &req_isp->hw_update_data; cfg.init_packet = 0; cfg.reapply = req_isp->reapply; rc = ctx->hw_mgr_intf->hw_config(ctx->hw_mgr_intf->hw_mgr_priv, &isp_cfg); &cfg); if (rc) { CAM_ERR_RATE_LIMIT(CAM_ISP, "Can not apply the configuration"); } else { Loading Loading @@ -3838,7 +3807,7 @@ static int __cam_isp_ctx_config_dev_in_top_state( struct cam_packet *packet; size_t len = 0; size_t remain_len = 0; struct cam_isp_hw_update_args isp_cfg; struct cam_hw_prepare_update_args cfg = {0}; struct cam_req_mgr_add_request add_req; struct cam_isp_context *ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; Loading Loading @@ -3918,44 +3887,31 @@ static int __cam_isp_ctx_config_dev_in_top_state( goto free_req; } /* preprocess the configuration */ memset(&isp_cfg, 0, sizeof(isp_cfg)); isp_cfg.packet = packet; isp_cfg.remain_len = remain_len; isp_cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; isp_cfg.max_hw_update_entries = CAM_ISP_CTX_CFG_MAX; isp_cfg.max_out_map_entries = CAM_ISP_CTX_RES_MAX; isp_cfg.max_in_map_entries = CAM_ISP_CTX_RES_MAX; isp_cfg.out_map_entries = req_isp->fence_map_out; isp_cfg.in_map_entries = req_isp->fence_map_in; isp_cfg.priv = &req_isp->hw_update_data; isp_cfg.pf_data = &(req->pf_data); for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) isp_cfg.hw_update_info[i].hw_entries = req_isp->cfg_info[i].hw_entries; cfg.packet = packet; cfg.remain_len = remain_len; cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; cfg.max_hw_update_entries = CAM_ISP_CTX_CFG_MAX; cfg.hw_update_entries = req_isp->cfg; cfg.max_out_map_entries = CAM_ISP_CTX_RES_MAX; cfg.max_in_map_entries = CAM_ISP_CTX_RES_MAX; cfg.out_map_entries = req_isp->fence_map_out; cfg.in_map_entries = req_isp->fence_map_in; cfg.priv = &req_isp->hw_update_data; cfg.pf_data = &(req->pf_data); CAM_DBG(CAM_ISP, "try to prepare config packet......"); rc = ctx->hw_mgr_intf->hw_prepare_update( ctx->hw_mgr_intf->hw_mgr_priv, &isp_cfg); ctx->hw_mgr_intf->hw_mgr_priv, &cfg); if (rc != 0) { CAM_ERR(CAM_ISP, "Prepare config packet failed in HW layer"); rc = -EFAULT; goto free_req; } req_isp->total_num_cfg = 0; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { req_isp->cfg_info[i].num_hw_entries = isp_cfg.hw_update_info[i].num_hw_entries; req_isp->total_num_cfg += req_isp->cfg_info[i].num_hw_entries; } req_isp->num_fence_map_out = isp_cfg.num_out_map_entries; req_isp->num_fence_map_in = isp_cfg.num_in_map_entries; req_isp->num_cfg = cfg.num_hw_update_entries; req_isp->num_fence_map_out = cfg.num_out_map_entries; req_isp->num_fence_map_in = cfg.num_in_map_entries; req_isp->num_acked = 0; req_isp->bubble_detected = false; Loading @@ -3969,7 +3925,7 @@ static int __cam_isp_ctx_config_dev_in_top_state( } CAM_DBG(CAM_ISP, "num_entry: %d, num fence out: %d, num fence in: %d", req_isp->total_num_cfg, req_isp->num_fence_map_out, req_isp->num_cfg, req_isp->num_fence_map_out, req_isp->num_fence_map_in); req->request_id = packet->header.request_id; Loading Loading @@ -4704,14 +4660,8 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx, start_isp.hw_config.ctxt_to_hw_map = ctx_isp->hw_ctx; start_isp.hw_config.request_id = req->request_id; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { start_isp.hw_config.hw_update_info[i].hw_entries = req_isp->cfg_info[i].hw_entries; start_isp.hw_config.hw_update_info[i].num_hw_entries = req_isp->cfg_info[i].num_hw_entries; } start_isp.hw_config.hw_update_entries = req_isp->cfg; start_isp.hw_config.num_hw_update_entries = req_isp->num_cfg; start_isp.hw_config.priv = &req_isp->hw_update_data; start_isp.hw_config.init_packet = 1; start_isp.hw_config.reapply = 0; Loading
drivers/cam_isp/cam_isp_context.h +4 −4 Original line number Diff line number Diff line Loading @@ -135,8 +135,8 @@ struct cam_isp_ctx_irq_ops { * struct cam_isp_ctx_req - ISP context request object * * @base: Common request object ponter * @cfg_info: ISP hardware configuration array * @total_num_cfg: Number of ISP hardware configuration entries * @cfg: ISP hardware configuration array * @num_cfg: Number of ISP hardware configuration entries * @fence_map_out: Output fence mapping array * @num_fence_map_out: Number of the output fence map * @fence_map_in: Input fence mapping array Loading @@ -153,8 +153,8 @@ struct cam_isp_ctx_irq_ops { */ struct cam_isp_ctx_req { struct cam_ctx_request *base; struct cam_isp_hw_update_info cfg_info[CAM_IFE_HW_NUM_MAX]; uint32_t total_num_cfg; struct cam_hw_update_entry cfg[CAM_ISP_CTX_CFG_MAX]; uint32_t num_cfg; struct cam_hw_fence_map_entry fence_map_out [CAM_ISP_CTX_RES_MAX]; uint32_t num_fence_map_out; Loading
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +234 −515 File changed.Preview size limit exceeded, changes collapsed. Show changes
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.h +2 −12 Original line number Diff line number Diff line Loading @@ -15,14 +15,6 @@ #include "cam_tasklet_util.h" #include "cam_cdm_intf_api.h" /* enum cam_ife_res_master_slave - HW resource master/slave */ enum cam_ife_res_master_slave { CAM_IFE_RES_NONE, CAM_IFE_RES_MASTER, CAM_IFE_RES_SLAVE, CAM_IFE_RES_MAX, }; /* IFE resource constants */ #define CAM_IFE_HW_IN_RES_MAX (CAM_ISP_IFE_IN_RES_MAX & 0xFF) #define CAM_IFE_HW_OUT_RES_MAX (CAM_ISP_IFE_OUT_RES_MAX & 0xFF) Loading Loading @@ -134,7 +126,7 @@ struct cam_ife_hw_mgr_ctx { uint32_t irq_status1_mask[CAM_IFE_HW_NUM_MAX]; struct cam_isp_ctx_base_info base[CAM_IFE_HW_NUM_MAX]; uint32_t num_base; uint32_t cdm_handle[CAM_IFE_HW_NUM_MAX]; uint32_t cdm_handle; struct cam_cdm_utils_ops *cdm_ops; struct cam_cdm_bl_request *cdm_cmd; Loading @@ -144,9 +136,7 @@ struct cam_ife_hw_mgr_ctx { atomic_t overflow_pending; atomic_t cdm_done; uint32_t is_rdi_only_context; struct completion config_done_complete[ CAM_IFE_HW_NUM_MAX]; enum cam_ife_res_master_slave master_slave[CAM_IFE_HW_NUM_MAX]; struct completion config_done_complete; uint32_t hw_version; struct cam_cmd_buf_desc reg_dump_buf_desc[ CAM_REG_DUMP_MAX_BUF_ENTRIES]; Loading
drivers/cam_isp/isp_hw_mgr/cam_isp_hw_mgr.h +0 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,6 @@ #include "cam_isp_hw_mgr_intf.h" #include "cam_tasklet_util.h" #include "cam_isp_hw.h" #include "cam_cdm_intf_api.h" #define CAM_ISP_HW_NUM_MAX 7 Loading Loading @@ -91,6 +90,5 @@ struct cam_isp_hw_mgr_res { struct cam_isp_ctx_base_info { uint32_t idx; enum cam_isp_hw_split_id split_id; enum cam_cdm_id cdm_id; }; #endif /* _CAM_ISP_HW_MGR_H_ */