|
@@ -5941,8 +5941,10 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
|
|
"config done Success for req_id=%llu ctx_index %d",
|
|
"config done Success for req_id=%llu ctx_index %d",
|
|
cfg->request_id, ctx->ctx_index);
|
|
cfg->request_id, ctx->ctx_index);
|
|
/* Update last applied MUP */
|
|
/* Update last applied MUP */
|
|
- if (hw_update_data->mup_en)
|
|
|
|
|
|
+ if (hw_update_data->mup_en) {
|
|
ctx->current_mup = hw_update_data->mup_val;
|
|
ctx->current_mup = hw_update_data->mup_val;
|
|
|
|
+ ctx->curr_num_exp = hw_update_data->num_exp;
|
|
|
|
+ }
|
|
hw_update_data->mup_en = false;
|
|
hw_update_data->mup_en = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -7671,7 +7673,7 @@ static int cam_isp_blob_sfe_update_fetch_core_cfg(
|
|
if ((ctx->ctx_config &
|
|
if ((ctx->ctx_config &
|
|
CAM_IFE_CTX_CFG_DYNAMIC_SWITCH_ON) &&
|
|
CAM_IFE_CTX_CFG_DYNAMIC_SWITCH_ON) &&
|
|
((res_id - CAM_ISP_SFE_IN_RD_0) >=
|
|
((res_id - CAM_ISP_SFE_IN_RD_0) >=
|
|
- ctx->sfe_info.scratch_config->curr_num_exp))
|
|
|
|
|
|
+ ctx->sfe_info.scratch_config->updated_num_exp))
|
|
enable = false;
|
|
enable = false;
|
|
else
|
|
else
|
|
enable = true;
|
|
enable = true;
|
|
@@ -7684,7 +7686,7 @@ static int cam_isp_blob_sfe_update_fetch_core_cfg(
|
|
"SFE:%u RM: %u res_id: 0x%x enable: %u num_exp: %u",
|
|
"SFE:%u RM: %u res_id: 0x%x enable: %u num_exp: %u",
|
|
blob_info->base_info->idx,
|
|
blob_info->base_info->idx,
|
|
(res_id - CAM_ISP_SFE_IN_RD_0), res_id, enable,
|
|
(res_id - CAM_ISP_SFE_IN_RD_0), res_id, enable,
|
|
- ctx->sfe_info.scratch_config->curr_num_exp);
|
|
|
|
|
|
+ ctx->sfe_info.scratch_config->updated_num_exp);
|
|
|
|
|
|
rc = cam_isp_add_cmd_buf_update(
|
|
rc = cam_isp_add_cmd_buf_update(
|
|
hw_mgr_res, blob_type,
|
|
hw_mgr_res, blob_type,
|
|
@@ -9906,7 +9908,8 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data,
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case CAM_ISP_GENERIC_BLOB_TYPE_DYNAMIC_MODE_SWITCH: {
|
|
case CAM_ISP_GENERIC_BLOB_TYPE_DYNAMIC_MODE_SWITCH: {
|
|
- struct cam_isp_mode_switch_info *mup_config;
|
|
|
|
|
|
+ struct cam_isp_mode_switch_info *mup_config;
|
|
|
|
+ struct cam_isp_prepare_hw_update_data *prepare_hw_data;
|
|
|
|
|
|
if (blob_size < sizeof(struct cam_isp_mode_switch_info)) {
|
|
if (blob_size < sizeof(struct cam_isp_mode_switch_info)) {
|
|
CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu",
|
|
CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu",
|
|
@@ -9915,10 +9918,13 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data,
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ prepare_hw_data = (struct cam_isp_prepare_hw_update_data *)
|
|
|
|
+ prepare->priv;
|
|
mup_config = (struct cam_isp_mode_switch_info *)blob_data;
|
|
mup_config = (struct cam_isp_mode_switch_info *)blob_data;
|
|
if (ife_mgr_ctx->flags.is_sfe_shdr) {
|
|
if (ife_mgr_ctx->flags.is_sfe_shdr) {
|
|
- ife_mgr_ctx->sfe_info.scratch_config->curr_num_exp =
|
|
|
|
|
|
+ ife_mgr_ctx->sfe_info.scratch_config->updated_num_exp =
|
|
mup_config->num_expoures;
|
|
mup_config->num_expoures;
|
|
|
|
+ prepare_hw_data->num_exp = mup_config->num_expoures;
|
|
|
|
|
|
rc = cam_isp_blob_sfe_update_fetch_core_cfg(
|
|
rc = cam_isp_blob_sfe_update_fetch_core_cfg(
|
|
blob_type, blob_info, prepare);
|
|
blob_type, blob_info, prepare);
|
|
@@ -10043,16 +10049,24 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data,
|
|
}
|
|
}
|
|
|
|
|
|
static inline bool cam_isp_sfe_validate_for_scratch_buf_config(
|
|
static inline bool cam_isp_sfe_validate_for_scratch_buf_config(
|
|
- uint32_t res_idx, struct cam_ife_hw_mgr_ctx *ctx)
|
|
|
|
|
|
+ uint32_t res_idx, struct cam_ife_hw_mgr_ctx *ctx,
|
|
|
|
+ bool default_settings)
|
|
{
|
|
{
|
|
|
|
+ uint32_t curr_num_exp;
|
|
|
|
+
|
|
/* check for num exposures for static mode but using RDI1-2 without RD1-2 */
|
|
/* check for num exposures for static mode but using RDI1-2 without RD1-2 */
|
|
if (res_idx >= ctx->sfe_info.num_fetches)
|
|
if (res_idx >= ctx->sfe_info.num_fetches)
|
|
return true;
|
|
return true;
|
|
|
|
|
|
|
|
+ if (default_settings)
|
|
|
|
+ curr_num_exp = ctx->curr_num_exp;
|
|
|
|
+ else
|
|
|
|
+ curr_num_exp = ctx->sfe_info.scratch_config->updated_num_exp;
|
|
|
|
+
|
|
/* check for num exposures for dynamic mode */
|
|
/* check for num exposures for dynamic mode */
|
|
if ((ctx->ctx_config &
|
|
if ((ctx->ctx_config &
|
|
CAM_IFE_CTX_CFG_DYNAMIC_SWITCH_ON) &&
|
|
CAM_IFE_CTX_CFG_DYNAMIC_SWITCH_ON) &&
|
|
- (res_idx >= ctx->sfe_info.scratch_config->curr_num_exp))
|
|
|
|
|
|
+ (res_idx >= curr_num_exp))
|
|
return true;
|
|
return true;
|
|
|
|
|
|
return false;
|
|
return false;
|
|
@@ -10171,7 +10185,7 @@ static int cam_isp_sfe_add_scratch_buffer_cfg(
|
|
res_id = hw_mgr_res->hw_res[j]->res_id;
|
|
res_id = hw_mgr_res->hw_res[j]->res_id;
|
|
|
|
|
|
if (cam_isp_sfe_validate_for_scratch_buf_config(
|
|
if (cam_isp_sfe_validate_for_scratch_buf_config(
|
|
- (res_id - CAM_ISP_SFE_OUT_RES_RDI_0), ctx))
|
|
|
|
|
|
+ (res_id - CAM_ISP_SFE_OUT_RES_RDI_0), ctx, false))
|
|
continue;
|
|
continue;
|
|
|
|
|
|
/* check if buffer provided for this RDI is from userspace */
|
|
/* check if buffer provided for this RDI is from userspace */
|
|
@@ -10233,7 +10247,7 @@ static int cam_isp_sfe_add_scratch_buffer_cfg(
|
|
res_id = hw_mgr_res->hw_res[j]->res_id;
|
|
res_id = hw_mgr_res->hw_res[j]->res_id;
|
|
|
|
|
|
if (cam_isp_sfe_validate_for_scratch_buf_config(
|
|
if (cam_isp_sfe_validate_for_scratch_buf_config(
|
|
- (res_id - CAM_ISP_SFE_IN_RD_0), ctx))
|
|
|
|
|
|
+ (res_id - CAM_ISP_SFE_IN_RD_0), ctx, false))
|
|
continue;
|
|
continue;
|
|
|
|
|
|
/* check if buffer provided for this RM is from userspace */
|
|
/* check if buffer provided for this RM is from userspace */
|
|
@@ -11295,7 +11309,7 @@ static int cam_ife_mgr_prog_default_settings(
|
|
res_id = hw_mgr_res->hw_res[j]->res_id;
|
|
res_id = hw_mgr_res->hw_res[j]->res_id;
|
|
|
|
|
|
if (cam_isp_sfe_validate_for_scratch_buf_config(
|
|
if (cam_isp_sfe_validate_for_scratch_buf_config(
|
|
- (res_id - CAM_ISP_SFE_OUT_RES_RDI_0), ctx))
|
|
|
|
|
|
+ (res_id - CAM_ISP_SFE_OUT_RES_RDI_0), ctx, true))
|
|
continue;
|
|
continue;
|
|
|
|
|
|
buf_info = &ctx->sfe_info.scratch_config->buf_info[
|
|
buf_info = &ctx->sfe_info.scratch_config->buf_info[
|
|
@@ -11333,7 +11347,7 @@ static int cam_ife_mgr_prog_default_settings(
|
|
res_id = hw_mgr_res->hw_res[j]->res_id;
|
|
res_id = hw_mgr_res->hw_res[j]->res_id;
|
|
|
|
|
|
if (cam_isp_sfe_validate_for_scratch_buf_config(
|
|
if (cam_isp_sfe_validate_for_scratch_buf_config(
|
|
- (res_id - CAM_ISP_SFE_IN_RD_0), ctx))
|
|
|
|
|
|
+ (res_id - CAM_ISP_SFE_IN_RD_0), ctx, false))
|
|
continue;
|
|
continue;
|
|
|
|
|
|
buf_info = &ctx->sfe_info.scratch_config->buf_info
|
|
buf_info = &ctx->sfe_info.scratch_config->buf_info
|