Merge "msm: camera: isp: Update last applied scratch configuration for sfe" into camera-kernel.lnx.6.0
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
927b715d57
@@ -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
|
||||||
|
@@ -112,14 +112,14 @@ struct cam_ife_sfe_scratch_buf_info {
|
|||||||
/**
|
/**
|
||||||
* struct cam_sfe_scratch_buf_cfg - Scratch buf info
|
* struct cam_sfe_scratch_buf_cfg - Scratch buf info
|
||||||
*
|
*
|
||||||
* @num_configs : Total Number of scratch buffers provided
|
* @num_configs : Total Number of scratch buffers provided
|
||||||
* @curr_num_exp: Current num of exposures
|
* @updated_num_exp : Current num of exposures
|
||||||
* @buf_info : Info on each of the buffers
|
* @buf_info : Info on each of the buffers
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct cam_sfe_scratch_buf_cfg {
|
struct cam_sfe_scratch_buf_cfg {
|
||||||
uint32_t num_config;
|
uint32_t num_config;
|
||||||
uint32_t curr_num_exp;
|
uint32_t updated_num_exp;
|
||||||
struct cam_ife_sfe_scratch_buf_info buf_info[
|
struct cam_ife_sfe_scratch_buf_info buf_info[
|
||||||
CAM_SFE_FE_RDI_NUM_MAX];
|
CAM_SFE_FE_RDI_NUM_MAX];
|
||||||
};
|
};
|
||||||
@@ -263,6 +263,7 @@ struct cam_ife_cdm_user_data {
|
|||||||
* @recovery_id: Unique ID of the current valid scheduled recovery
|
* @recovery_id: Unique ID of the current valid scheduled recovery
|
||||||
* @current_mup: Current MUP val, scratch will then apply the same as previously
|
* @current_mup: Current MUP val, scratch will then apply the same as previously
|
||||||
* applied request
|
* applied request
|
||||||
|
* @curr_num_exp: Current num of exposures
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct cam_ife_hw_mgr_ctx {
|
struct cam_ife_hw_mgr_ctx {
|
||||||
@@ -319,6 +320,7 @@ struct cam_ife_hw_mgr_ctx {
|
|||||||
uint32_t bw_config_version;
|
uint32_t bw_config_version;
|
||||||
atomic_t recovery_id;
|
atomic_t recovery_id;
|
||||||
uint32_t current_mup;
|
uint32_t current_mup;
|
||||||
|
uint32_t curr_num_exp;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -231,9 +231,10 @@ struct cam_isp_bw_clk_config_info {
|
|||||||
* @bw_clk_config: BW and clock config info
|
* @bw_clk_config: BW and clock config info
|
||||||
* @reg_dump_buf_desc: cmd buffer descriptors for reg dump
|
* @reg_dump_buf_desc: cmd buffer descriptors for reg dump
|
||||||
* @num_reg_dump_buf: Count of descriptors in reg_dump_buf_desc
|
* @num_reg_dump_buf: Count of descriptors in reg_dump_buf_desc
|
||||||
* @packet CSL packet from user mode driver
|
* @packet: CSL packet from user mode driver
|
||||||
* @mup_val: MUP value if configured
|
* @mup_val: MUP value if configured
|
||||||
* @mup_en Flag if dynamic sensor switch is enabled
|
* @num_exp: Num of exposures
|
||||||
|
* @mup_en: Flag if dynamic sensor switch is enabled
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct cam_isp_prepare_hw_update_data {
|
struct cam_isp_prepare_hw_update_data {
|
||||||
@@ -248,6 +249,7 @@ struct cam_isp_prepare_hw_update_data {
|
|||||||
uint32_t num_reg_dump_buf;
|
uint32_t num_reg_dump_buf;
|
||||||
struct cam_packet *packet;
|
struct cam_packet *packet;
|
||||||
uint32_t mup_val;
|
uint32_t mup_val;
|
||||||
|
uint32_t num_exp;
|
||||||
bool mup_en;
|
bool mup_en;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user