msm: camera: isp: Move epd support from blob to acquire time

This change moves epd support from blob to acquire.

CRs-Fixed: 2830502
Change-Id: I9794e5fe0fcad1c38c095a8d5b346f840d125da3
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
Цей коміт міститься в:
Chandan Kumar Jha
2020-12-15 18:49:42 +05:30
джерело b8a0954d26
коміт 1975888f48
8 змінених файлів з 13 додано та 122 видалено

Переглянути файл

@@ -4282,6 +4282,8 @@ static int cam_ife_mgr_acquire_get_unified_structure_v2(
CAM_ISP_CAN_USE_LITE_MODE;
in_port->sfe_binned_epoch_cfg = (in->feature_flag &
CAM_ISP_SFE_BINNED_EPOCH_CFG_ENABLE);
in_port->epd_supported = (in->feature_flag &
CAM_ISP_EPD_SUPPORT);
in_port->data = kcalloc(in->num_out_res,
sizeof(struct cam_isp_out_port_generic_info),
@@ -7488,52 +7490,6 @@ static int cam_isp_blob_vfe_out_update(
return rc;
}
static int cam_isp_blob_csid_config_update(
uint32_t blob_type,
struct cam_isp_generic_blob_info *blob_info,
struct cam_isp_csid_epd_config *epd_config,
struct cam_hw_prepare_update_args *prepare)
{
struct cam_ife_hw_mgr_ctx *ctx = NULL;
struct cam_isp_hw_mgr_res *hw_mgr_res;
struct cam_hw_intf *hw_intf;
struct cam_ife_csid_epd_update_args epd_update_args;
int rc = -EINVAL;
uint32_t i = 0;
ctx = prepare->ctxt_to_hw_map;
list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_csid, list) {
for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
if (!hw_mgr_res->hw_res[i])
continue;
hw_intf = hw_mgr_res->hw_res[i]->hw_intf;
if (hw_intf && hw_intf->hw_ops.process_cmd) {
epd_update_args.epd_supported =
epd_config->is_epd_supported;
rc = hw_intf->hw_ops.process_cmd(
hw_intf->hw_priv,
CAM_IFE_CSID_SET_CONFIG,
&epd_update_args,
sizeof(
struct cam_ife_csid_epd_update_args)
);
if (rc)
CAM_ERR(CAM_ISP,
"Failed to epd config:%d",
epd_config->is_epd_supported);
} else {
CAM_WARN(CAM_ISP, "NULL hw_intf!");
}
}
}
return rc;
}
static int cam_isp_blob_sensor_blanking_config(
uint32_t blob_type,
struct cam_isp_generic_blob_info *blob_info,
@@ -8048,23 +8004,6 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,
CAM_ERR(CAM_ISP, "VFE out update failed rc: %d", rc);
}
break;
case CAM_ISP_GENERIC_BLOB_TYPE_CSID_CONFIG: {
struct cam_isp_csid_epd_config *epd_config;
if (blob_size < sizeof(struct cam_isp_csid_epd_config)) {
CAM_ERR(CAM_ISP,
"Invalid epd config blob size %u expected %u",
blob_size,
sizeof(struct cam_isp_csid_epd_config));
return -EINVAL;
}
epd_config = (struct cam_isp_csid_epd_config *)blob_data;
rc = cam_isp_blob_csid_config_update(blob_type, blob_info,
epd_config, prepare);
if (rc)
CAM_ERR(CAM_ISP, "CSID Config failed rc: %d", rc);
}
break;
case CAM_ISP_GENERIC_BLOB_TYPE_SENSOR_BLANKING_CONFIG: {
struct cam_isp_sensor_blanking_config *sensor_blanking_config;
@@ -8478,7 +8417,6 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data,
case CAM_ISP_GENERIC_BLOB_TYPE_IFE_CORE_CONFIG:
case CAM_ISP_GENERIC_BLOB_TYPE_VFE_OUT_CONFIG:
case CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG_V2:
case CAM_ISP_GENERIC_BLOB_TYPE_CSID_CONFIG:
case CAM_ISP_GENERIC_BLOB_TYPE_SENSOR_DIMENSION_CONFIG:
case CAM_ISP_GENERIC_BLOB_TYPE_CSID_QCFA_CONFIG:
case CAM_ISP_GENERIC_BLOB_TYPE_SENSOR_BLANKING_CONFIG:

Переглянути файл

@@ -524,24 +524,6 @@ int cam_ife_csid_check_in_port_args(
return 0;
}
int cam_ife_csid_set_epd_config(struct cam_ife_csid_hw_flags *flags,
void *cmd_args, uint32_t hw_idx)
{
struct cam_ife_csid_epd_update_args *epd_update = NULL;
if ((!flags) || (!cmd_args))
return -EINVAL;
epd_update =
(struct cam_ife_csid_epd_update_args *)cmd_args;
flags->epd_supported = epd_update->epd_supported;
CAM_DBG(CAM_ISP, "CSID[%u] EPD supported %d", hw_idx,
flags->epd_supported);
return 0;
}
int cam_ife_csid_get_rt_irq_idx(
uint32_t irq_reg, uint32_t num_ipp,
uint32_t num_ppp, uint32_t num_rdi)

Переглянути файл

@@ -257,7 +257,6 @@ struct cam_ife_csid_debug_info {
/*
* struct cam_ife_csid_hw_flags: place holder for flags
*
* @epd_supported: flag to indicate if epd supported
* @device_enabled: flag to indicate if device enabled
* @binning_enabled: flag to indicate if binning enabled
* @sof_irq_triggered: flag to indicate if sof irq triggered
@@ -269,7 +268,6 @@ struct cam_ife_csid_debug_info {
* @offline_mode: flag to indicate if csid in offline mode
*/
struct cam_ife_csid_hw_flags {
bool epd_supported;
bool device_enabled;
bool binning_enabled;
bool sof_irq_triggered;
@@ -307,6 +305,7 @@ struct cam_ife_csid_cid_data {
* @tpg_num_sel: TPG num sel
* @dynamic_senso_switch_en: Flag if dynamic sensor switch is enabled
* @mup: Mode Update bit. 0 for odd vc, 1 for even VC
* @epd_supported: Flag to check if epd supported
*/
struct cam_ife_csid_rx_cfg {
uint32_t phy_sel;
@@ -317,6 +316,7 @@ struct cam_ife_csid_rx_cfg {
uint32_t tpg_num_sel;
uint32_t dynamic_sensor_switch_en;
uint32_t mup;
uint32_t epd_supported;
};
int cam_ife_csid_is_pix_res_format_supported(
@@ -350,9 +350,6 @@ int cam_ife_csid_check_in_port_args(
struct cam_csid_hw_reserve_resource_args *reserve,
uint32_t hw_idx);
int cam_ife_csid_set_epd_config(struct cam_ife_csid_hw_flags *flags,
void *cmd_args, uint32_t hw_idx);
int cam_ife_csid_is_vc_full_width(struct cam_ife_csid_cid_data *cid_data);
int cam_ife_csid_get_rt_irq_idx(

Переглянути файл

@@ -1452,6 +1452,8 @@ static int cam_ife_csid_hw_ver1_rx_cfg(
csid_hw->rx_cfg.lane_num =
reserve->in_port->lane_num;
csid_hw->res_type = reserve->in_port->res_type;
csid_hw->rx_cfg.epd_supported =
reserve->in_port->epd_supported;
switch (reserve->in_port->res_type) {
case CAM_ISP_IFE_IN_RES_TPG:
@@ -2122,7 +2124,7 @@ static int cam_ife_csid_ver1_enable_csi2(struct cam_ife_csid_ver1_hw *csid_hw)
/*EPD supported sensors do not send EOT, error will be generated
* if this irq is enabled
*/
if (csid_hw->flags.epd_supported)
if (csid_hw->rx_cfg.epd_supported)
val &= ~IFE_CSID_VER1_RX_CPHY_EOT_RECEPTION;
cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
@@ -3715,10 +3717,6 @@ static int cam_ife_csid_ver1_process_cmd(void *hw_priv,
case CAM_ISP_HW_CMD_CSID_CLOCK_DUMP:
rc = cam_ife_csid_ver1_dump_csid_clock(csid_hw, cmd_args);
break;
case CAM_IFE_CSID_SET_CONFIG:
rc = cam_ife_csid_set_epd_config(&csid_hw->flags, cmd_args,
csid_hw->hw_intf->hw_idx);
break;
case CAM_IFE_CSID_SET_SENSOR_DIMENSION_CFG:
rc = cam_ife_csid_ver1_set_sensor_dimension(csid_hw,
cmd_args);

Переглянути файл

@@ -1407,6 +1407,8 @@ static int cam_ife_csid_hw_ver2_config_rx(
csid_hw->res_type = reserve->in_port->res_type;
csid_hw->rx_cfg.dynamic_sensor_switch_en =
reserve->in_port->dynamic_sensor_switch_en;
csid_hw->rx_cfg.epd_supported =
reserve->in_port->epd_supported;
switch (reserve->in_port->res_type) {
case CAM_ISP_IFE_IN_RES_TPG:
@@ -2665,6 +2667,8 @@ static int cam_ife_csid_ver2_enable_csi2(struct cam_ife_csid_ver2_hw *csid_hw)
val |= 1 << csi2_reg->ecc_correction_shift_en;
val |= (rx_cfg->dynamic_sensor_switch_en
<< csi2_reg->dyn_sensor_switch_shift_en);
val |= (rx_cfg->epd_supported
<< csi2_reg->epd_mode_shift_en);
vc_full_width = cam_ife_csid_is_vc_full_width(csid_hw->cid_data);
@@ -2705,12 +2709,6 @@ static int cam_ife_csid_ver2_enable_csi2(struct cam_ife_csid_ver2_hw *csid_hw)
val = csi2_reg->fatal_err_mask | csi2_reg->part_fatal_err_mask |
csi2_reg->non_fatal_err_mask;
/*EPD supported sensors do not send EOT, error will be generated
* if this irq is enabled
*/
if (csid_hw->flags.epd_supported)
val = val & ~IFE_CSID_VER2_RX_CPHY_EOT_RECEPTION;
irq_mask[CAM_IFE_CSID_IRQ_REG_RX] = val;
csid_hw->err_irq_handle[CAM_IFE_CSID_IRQ_REG_RX] =
@@ -3744,10 +3742,6 @@ static int cam_ife_csid_ver2_process_cmd(void *hw_priv,
case CAM_ISP_HW_CMD_DUMP_HW:
//rc = cam_ife_csid_ver2_dump_hw(csid_hw, cmd_args);
break;
case CAM_IFE_CSID_SET_CONFIG:
rc = cam_ife_csid_set_epd_config(&csid_hw->flags, cmd_args,
csid_hw->hw_intf->hw_idx);
break;
case CAM_IFE_CSID_TOP_CONFIG:
rc = cam_ife_csid_ver2_top_cfg(csid_hw, cmd_args);
break;

Переглянути файл

@@ -136,6 +136,7 @@ struct cam_isp_in_port_generic_info {
uint32_t dynamic_sensor_switch_en;
uint32_t can_use_lite;
uint32_t sfe_binned_epoch_cfg;
uint32_t epd_supported;
struct cam_isp_out_port_generic_info *data;
};
@@ -311,15 +312,6 @@ struct cam_ife_csid_qcfa_update_args {
uint32_t qcfa_binning;
};
/*
* struct cam_ife_csid_epd_update_args:
*
* @epd_supported: flag to check epd supported or not
*/
struct cam_ife_csid_epd_update_args {
uint32_t epd_supported;
};
/*
* struct cam_ife_sensor_dim_update_args:
*

Переглянути файл

@@ -140,7 +140,6 @@ enum cam_isp_hw_cmd_type {
CAM_IFE_CSID_CMD_GET_TIME_STAMP,
CAM_IFE_CSID_SET_CSID_DEBUG,
CAM_IFE_CSID_SOF_IRQ_DEBUG,
CAM_IFE_CSID_SET_CONFIG,
CAM_IFE_CSID_SET_SENSOR_DIMENSION_CFG,
CAM_IFE_CSID_LOG_ACQUIRE_DATA,
CAM_IFE_CSID_TOP_CONFIG,

Переглянути файл

@@ -115,7 +115,6 @@
#define CAM_ISP_GENERIC_BLOB_TYPE_IFE_CORE_CONFIG 7
#define CAM_ISP_GENERIC_BLOB_TYPE_VFE_OUT_CONFIG 8
#define CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG_V2 9
#define CAM_ISP_GENERIC_BLOB_TYPE_CSID_CONFIG 10
#define CAM_ISP_GENERIC_BLOB_TYPE_SENSOR_DIMENSION_CONFIG 11
#define CAM_ISP_GENERIC_BLOB_TYPE_CSID_QCFA_CONFIG 12
#define CAM_ISP_GENERIC_BLOB_TYPE_SENSOR_BLANKING_CONFIG 13
@@ -170,6 +169,7 @@
#define CAM_ISP_CAN_USE_LITE_MODE BIT(1)
#define CAM_ISP_DYNAMIC_SENOR_SWITCH_EN BIT(2)
#define CAM_ISP_SFE_BINNED_EPOCH_CFG_ENABLE BIT(3)
#define CAM_ISP_EPD_SUPPORT BIT(4)
/* ISP core cfg flag params */
#define CAM_ISP_PARAM_CORE_CFG_HDR_MUX_SEL BIT(0)
@@ -862,15 +862,6 @@ struct cam_isp_vfe_out_config {
struct cam_isp_vfe_wm_config wm_config[1];
};
/**
* struct cam_isp_csid_epd_config - Support for EPD Packet config
*
* @is_epd_sensor : flag to check if epd supported
*/
struct cam_isp_csid_epd_config {
__u32 is_epd_supported;
};
/**
* struct cam_isp_mode_switch_info - Dynamic mode switch info
*