msm: camera: isp: Fixing KW errors

Fixes KW errors for ISP.

CRs-Fixed: 2830502
Change-Id: I60f01a0da2d47bb8d0c249a73962a571ba9bee0a
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
This commit is contained in:
Chandan Kumar Jha
2020-12-31 18:40:26 +05:30
parent 32c4409c9b
commit 9d1980a8e2
2 changed files with 22 additions and 12 deletions

View File

@@ -1987,7 +1987,7 @@ static int cam_ife_hw_mgr_acquire_res_sfe_src(
struct cam_sfe_acquire_args sfe_acquire; struct cam_sfe_acquire_args sfe_acquire;
struct cam_isp_hw_mgr_res *csid_res; struct cam_isp_hw_mgr_res *csid_res;
struct cam_isp_hw_mgr_res *sfe_src_res; struct cam_isp_hw_mgr_res *sfe_src_res;
struct cam_hw_intf *hw_intf; struct cam_hw_intf *hw_intf = NULL;
struct cam_ife_hw_mgr *ife_hw_mgr; struct cam_ife_hw_mgr *ife_hw_mgr;
ife_hw_mgr = ife_ctx->hw_mgr; ife_hw_mgr = ife_ctx->hw_mgr;
@@ -2082,7 +2082,8 @@ static int cam_ife_hw_mgr_acquire_res_sfe_src(
break; break;
} }
if (rc || !sfe_acquire.sfe_in.rsrc_node) { if (i == CAM_SFE_HW_NUM_MAX || rc ||
!sfe_acquire.sfe_in.rsrc_node) {
CAM_ERR(CAM_ISP, CAM_ERR(CAM_ISP,
"Failed to acquire SFE for res_id: 0x%x", "Failed to acquire SFE for res_id: 0x%x",
sfe_acquire.sfe_in.res_id); sfe_acquire.sfe_in.res_id);
@@ -2091,6 +2092,7 @@ static int cam_ife_hw_mgr_acquire_res_sfe_src(
sfe_src_res->hw_res[CAM_ISP_HW_SPLIT_LEFT] = sfe_src_res->hw_res[CAM_ISP_HW_SPLIT_LEFT] =
sfe_acquire.sfe_in.rsrc_node; sfe_acquire.sfe_in.rsrc_node;
CAM_DBG(CAM_ISP, CAM_DBG(CAM_ISP,
"acquire success LEFT SFE: %u res_type: %u res_id: %u", "acquire success LEFT SFE: %u res_type: %u res_id: %u",
hw_intf->hw_idx, hw_intf->hw_idx,
@@ -2404,7 +2406,7 @@ static int cam_ife_hw_mgr_acquire_ife_src_for_sfe(
int rc = -1, i; int rc = -1, i;
struct cam_vfe_acquire_args vfe_acquire; struct cam_vfe_acquire_args vfe_acquire;
struct cam_isp_hw_mgr_res *ife_src_res; struct cam_isp_hw_mgr_res *ife_src_res;
struct cam_hw_intf *hw_intf; struct cam_hw_intf *hw_intf = NULL;
struct cam_ife_hw_mgr *ife_hw_mgr; struct cam_ife_hw_mgr *ife_hw_mgr;
ife_hw_mgr = ife_ctx->hw_mgr; ife_hw_mgr = ife_ctx->hw_mgr;
@@ -2502,7 +2504,8 @@ static int cam_ife_hw_mgr_acquire_ife_src_for_sfe(
break; break;
} }
if (rc || !vfe_acquire.vfe_in.rsrc_node) { if (i == CAM_IFE_HW_NUM_MAX || rc ||
!vfe_acquire.vfe_in.rsrc_node) {
CAM_ERR(CAM_ISP, "Unable to acquire right IFE res: %u", CAM_ERR(CAM_ISP, "Unable to acquire right IFE res: %u",
vfe_acquire.vfe_in.res_id); vfe_acquire.vfe_in.res_id);
rc = -EAGAIN; rc = -EAGAIN;
@@ -3345,7 +3348,7 @@ static int cam_ife_hw_mgr_acquire_offline_res_ife_camif(
int rc = -1; int rc = -1;
int i; int i;
struct cam_vfe_acquire_args vfe_acquire; struct cam_vfe_acquire_args vfe_acquire;
struct cam_hw_intf *hw_intf; struct cam_hw_intf *hw_intf = NULL;
struct cam_isp_hw_mgr_res *ife_src_res; struct cam_isp_hw_mgr_res *ife_src_res;
struct cam_isp_hw_mgr_res *isp_bus_rd_res; struct cam_isp_hw_mgr_res *isp_bus_rd_res;
struct cam_ife_hw_mgr *ife_hw_mgr; struct cam_ife_hw_mgr *ife_hw_mgr;
@@ -3400,7 +3403,8 @@ static int cam_ife_hw_mgr_acquire_offline_res_ife_camif(
break; break;
} }
if (rc || !vfe_acquire.vfe_in.rsrc_node) { if (i == CAM_IFE_HW_NUM_MAX || rc ||
!vfe_acquire.vfe_in.rsrc_node) {
CAM_ERR(CAM_ISP, "Failed to acquire IFE LEFT rc: %d", CAM_ERR(CAM_ISP, "Failed to acquire IFE LEFT rc: %d",
rc); rc);
goto put_res; goto put_res;
@@ -3456,7 +3460,7 @@ static int cam_ife_hw_mgr_acquire_offline_res_ife_camif(
ife_src_res->hw_res[1]->res_id); ife_src_res->hw_res[1]->res_id);
CAM_DBG(CAM_ISP, "Acquired VFE:%d CAMIF for RIGHT", CAM_DBG(CAM_ISP, "Acquired VFE:%d CAMIF for RIGHT",
ife_src_res->hw_res[i]->hw_intf->hw_idx); ife_src_res->hw_res[1]->hw_intf->hw_idx);
} }
return rc; return rc;
@@ -5670,6 +5674,7 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args)
primary_rdi_src_res = CAM_ISP_HW_VFE_IN_MAX; primary_rdi_src_res = CAM_ISP_HW_VFE_IN_MAX;
primary_rdi_out_res = g_ife_hw_mgr.max_vfe_out_res_type; primary_rdi_out_res = g_ife_hw_mgr.max_vfe_out_res_type;
primary_rdi_csid_res = CAM_IFE_PIX_PATH_RES_MAX;
if (!hw_mgr_priv || !start_isp) { if (!hw_mgr_priv || !start_isp) {
CAM_ERR(CAM_ISP, "Invalid arguments"); CAM_ERR(CAM_ISP, "Invalid arguments");
@@ -6618,7 +6623,7 @@ static int cam_isp_blob_hfr_update(
rc = cam_isp_add_cmd_buf_update( rc = cam_isp_add_cmd_buf_update(
hw_mgr_res, blob_type, hw_mgr_res, blob_type,
blob_type_hw_cmd_map[blob_type], CAM_ISP_HW_CMD_GET_HFR_UPDATE,
blob_info->base_info->idx, blob_info->base_info->idx,
(void *)cmd_buf_addr, (void *)cmd_buf_addr,
kmd_buf_remain_size, kmd_buf_remain_size,
@@ -8347,7 +8352,7 @@ static int cam_isp_sfe_add_scratch_buffer_cfg(
struct list_head *res_list_in_rd, struct list_head *res_list_in_rd,
struct cam_ife_hw_mgr_ctx *ctx) struct cam_ife_hw_mgr_ctx *ctx)
{ {
int i, j, res_id, rc; int i, j, res_id, rc = 0;
uint32_t used_bytes = 0, remain_size = 0; uint32_t used_bytes = 0, remain_size = 0;
uint32_t io_cfg_used_bytes, num_ent; uint32_t io_cfg_used_bytes, num_ent;
uint32_t *cpu_addr = NULL; uint32_t *cpu_addr = NULL;
@@ -10302,8 +10307,7 @@ static int cam_ife_hw_mgr_event_handler(
return -EINVAL; return -EINVAL;
if (!priv) if (!priv)
if (evt_id != CAM_ISP_HW_EVENT_ERROR) return -EINVAL;
return -EINVAL;
ctx = (struct cam_ife_hw_mgr_ctx *)priv; ctx = (struct cam_ife_hw_mgr_ctx *)priv;
CAM_DBG(CAM_ISP, "Event ID 0x%x", evt_id); CAM_DBG(CAM_ISP, "Event ID 0x%x", evt_id);

View File

@@ -1894,7 +1894,13 @@ static int cam_ife_csid_ver2_init_config_pxl_path(
path_reg = csid_reg->ipp_reg; path_reg = csid_reg->ipp_reg;
else if (res->res_id == CAM_IFE_PIX_PATH_RES_PPP) else if (res->res_id == CAM_IFE_PIX_PATH_RES_PPP)
path_reg = csid_reg->ppp_reg; path_reg = csid_reg->ppp_reg;
else {
CAM_ERR(CAM_ISP,
"CSID:%d path res type:%d res_id:%d res state %d",
csid_hw->hw_intf->hw_idx,
res->res_type, res->res_id, res->res_state);
return -EINVAL;
}
cmn_reg = csid_reg->cmn_reg; cmn_reg = csid_reg->cmn_reg;
path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv;