|
@@ -82,7 +82,7 @@ static int cam_ife_csid_is_ipp_ppp_format_supported(
|
|
|
|
|
|
static int cam_ife_csid_get_format_rdi(
|
|
static int cam_ife_csid_get_format_rdi(
|
|
uint32_t in_format, uint32_t out_format, uint32_t *decode_fmt,
|
|
uint32_t in_format, uint32_t out_format, uint32_t *decode_fmt,
|
|
- uint32_t *plain_fmt, uint32_t *packing_fmt, bool rpp)
|
|
|
|
|
|
+ uint32_t *plain_fmt, uint32_t *packing_fmt, bool rpp, uint32_t *in_bpp)
|
|
{
|
|
{
|
|
int rc = 0;
|
|
int rc = 0;
|
|
|
|
|
|
@@ -104,6 +104,7 @@ static int cam_ife_csid_get_format_rdi(
|
|
rc = -EINVAL;
|
|
rc = -EINVAL;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ *in_bpp = 6;
|
|
break;
|
|
break;
|
|
case CAM_FORMAT_MIPI_RAW_8:
|
|
case CAM_FORMAT_MIPI_RAW_8:
|
|
switch (out_format) {
|
|
switch (out_format) {
|
|
@@ -123,6 +124,7 @@ static int cam_ife_csid_get_format_rdi(
|
|
rc = -EINVAL;
|
|
rc = -EINVAL;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ *in_bpp = 8;
|
|
break;
|
|
break;
|
|
case CAM_FORMAT_MIPI_RAW_10:
|
|
case CAM_FORMAT_MIPI_RAW_10:
|
|
switch (out_format) {
|
|
switch (out_format) {
|
|
@@ -142,6 +144,7 @@ static int cam_ife_csid_get_format_rdi(
|
|
rc = -EINVAL;
|
|
rc = -EINVAL;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ *in_bpp = 10;
|
|
break;
|
|
break;
|
|
case CAM_FORMAT_MIPI_RAW_12:
|
|
case CAM_FORMAT_MIPI_RAW_12:
|
|
switch (out_format) {
|
|
switch (out_format) {
|
|
@@ -160,6 +163,7 @@ static int cam_ife_csid_get_format_rdi(
|
|
rc = -EINVAL;
|
|
rc = -EINVAL;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ *in_bpp = 12;
|
|
break;
|
|
break;
|
|
case CAM_FORMAT_MIPI_RAW_14:
|
|
case CAM_FORMAT_MIPI_RAW_14:
|
|
switch (out_format) {
|
|
switch (out_format) {
|
|
@@ -178,6 +182,7 @@ static int cam_ife_csid_get_format_rdi(
|
|
rc = -EINVAL;
|
|
rc = -EINVAL;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ *in_bpp = 14;
|
|
break;
|
|
break;
|
|
case CAM_FORMAT_MIPI_RAW_16:
|
|
case CAM_FORMAT_MIPI_RAW_16:
|
|
switch (out_format) {
|
|
switch (out_format) {
|
|
@@ -196,6 +201,7 @@ static int cam_ife_csid_get_format_rdi(
|
|
rc = -EINVAL;
|
|
rc = -EINVAL;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ *in_bpp = 16;
|
|
break;
|
|
break;
|
|
case CAM_FORMAT_MIPI_RAW_20:
|
|
case CAM_FORMAT_MIPI_RAW_20:
|
|
switch (out_format) {
|
|
switch (out_format) {
|
|
@@ -214,6 +220,7 @@ static int cam_ife_csid_get_format_rdi(
|
|
rc = -EINVAL;
|
|
rc = -EINVAL;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ *in_bpp = 20;
|
|
break;
|
|
break;
|
|
case CAM_FORMAT_DPCM_10_6_10:
|
|
case CAM_FORMAT_DPCM_10_6_10:
|
|
*decode_fmt = 0x7;
|
|
*decode_fmt = 0x7;
|
|
@@ -1330,6 +1337,7 @@ err:
|
|
static int cam_ife_csid_disable_hw(struct cam_ife_csid_hw *csid_hw)
|
|
static int cam_ife_csid_disable_hw(struct cam_ife_csid_hw *csid_hw)
|
|
{
|
|
{
|
|
int rc = -EINVAL;
|
|
int rc = -EINVAL;
|
|
|
|
+ uint32_t i;
|
|
struct cam_hw_soc_info *soc_info;
|
|
struct cam_hw_soc_info *soc_info;
|
|
const struct cam_ife_csid_reg_offset *csid_reg;
|
|
const struct cam_ife_csid_reg_offset *csid_reg;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
@@ -1370,6 +1378,12 @@ static int cam_ife_csid_disable_hw(struct cam_ife_csid_hw *csid_hw)
|
|
spin_lock_irqsave(&csid_hw->lock_state, flags);
|
|
spin_lock_irqsave(&csid_hw->lock_state, flags);
|
|
csid_hw->device_enabled = 0;
|
|
csid_hw->device_enabled = 0;
|
|
spin_unlock_irqrestore(&csid_hw->lock_state, flags);
|
|
spin_unlock_irqrestore(&csid_hw->lock_state, flags);
|
|
|
|
+
|
|
|
|
+ csid_hw->ipp_path_config.measure_enabled = 0;
|
|
|
|
+ csid_hw->ppp_path_config.measure_enabled = 0;
|
|
|
|
+ for (i = 0; i <= CAM_IFE_PIX_PATH_RES_RDI_3; i++)
|
|
|
|
+ csid_hw->rdi_path_config[i].measure_enabled = 0;
|
|
|
|
+
|
|
csid_hw->hw_info->hw_state = CAM_HW_STATE_POWER_DOWN;
|
|
csid_hw->hw_info->hw_state = CAM_HW_STATE_POWER_DOWN;
|
|
csid_hw->error_irq_count = 0;
|
|
csid_hw->error_irq_count = 0;
|
|
csid_hw->prev_boot_timestamp = 0;
|
|
csid_hw->prev_boot_timestamp = 0;
|
|
@@ -1742,6 +1756,7 @@ static int cam_ife_csid_init_config_pxl_path(
|
|
bool is_ipp;
|
|
bool is_ipp;
|
|
uint32_t decode_format = 0, plain_format = 0, val = 0;
|
|
uint32_t decode_format = 0, plain_format = 0, val = 0;
|
|
uint32_t camera_hw_version;
|
|
uint32_t camera_hw_version;
|
|
|
|
+ struct cam_isp_sensor_dimension *path_config;
|
|
|
|
|
|
path_data = (struct cam_ife_csid_path_cfg *) res->res_priv;
|
|
path_data = (struct cam_ife_csid_path_cfg *) res->res_priv;
|
|
csid_reg = csid_hw->csid_info->csid_reg;
|
|
csid_reg = csid_hw->csid_info->csid_reg;
|
|
@@ -1750,9 +1765,11 @@ static int cam_ife_csid_init_config_pxl_path(
|
|
if (res->res_id == CAM_IFE_PIX_PATH_RES_IPP) {
|
|
if (res->res_id == CAM_IFE_PIX_PATH_RES_IPP) {
|
|
is_ipp = true;
|
|
is_ipp = true;
|
|
pxl_reg = csid_reg->ipp_reg;
|
|
pxl_reg = csid_reg->ipp_reg;
|
|
|
|
+ path_config = &(csid_hw->ipp_path_config);
|
|
} else {
|
|
} else {
|
|
is_ipp = false;
|
|
is_ipp = false;
|
|
pxl_reg = csid_reg->ppp_reg;
|
|
pxl_reg = csid_reg->ppp_reg;
|
|
|
|
+ path_config = &(csid_hw->ppp_path_config);
|
|
}
|
|
}
|
|
|
|
|
|
if (!pxl_reg) {
|
|
if (!pxl_reg) {
|
|
@@ -1868,6 +1885,25 @@ static int cam_ife_csid_init_config_pxl_path(
|
|
pxl_reg->csid_pxl_irq_subsample_period_addr);
|
|
pxl_reg->csid_pxl_irq_subsample_period_addr);
|
|
cam_io_w_mb(0, soc_info->reg_map[0].mem_base +
|
|
cam_io_w_mb(0, soc_info->reg_map[0].mem_base +
|
|
pxl_reg->csid_pxl_irq_subsample_pattern_addr);
|
|
pxl_reg->csid_pxl_irq_subsample_pattern_addr);
|
|
|
|
+
|
|
|
|
+ /* configure pixel format measure */
|
|
|
|
+ if (path_config->measure_enabled) {
|
|
|
|
+ val = (((path_config->height &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_mask_val) <<
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_shift_val) |
|
|
|
|
+ (path_config->width &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_width_mask_val));
|
|
|
|
+ CAM_DBG(CAM_ISP, "CSID:%d format measure cfg1 value : 0x%x",
|
|
|
|
+ csid_hw->hw_intf->hw_idx, val);
|
|
|
|
+
|
|
|
|
+ cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
|
|
+ pxl_reg->csid_pxl_format_measure_cfg1_addr);
|
|
|
|
+
|
|
|
|
+ /* enable pixel and line counter */
|
|
|
|
+ cam_io_w_mb(3, soc_info->reg_map[0].mem_base +
|
|
|
|
+ pxl_reg->csid_pxl_format_measure_cfg0_addr);
|
|
|
|
+ }
|
|
|
|
+
|
|
/* set pxl drop pattern to 0 and period to 1 */
|
|
/* set pxl drop pattern to 0 and period to 1 */
|
|
cam_io_w_mb(0, soc_info->reg_map[0].mem_base +
|
|
cam_io_w_mb(0, soc_info->reg_map[0].mem_base +
|
|
pxl_reg->csid_pxl_pix_drop_pattern_addr);
|
|
pxl_reg->csid_pxl_pix_drop_pattern_addr);
|
|
@@ -2017,6 +2053,7 @@ static int cam_ife_csid_enable_pxl_path(
|
|
const struct cam_ife_csid_pxl_reg_offset *pxl_reg = NULL;
|
|
const struct cam_ife_csid_pxl_reg_offset *pxl_reg = NULL;
|
|
bool is_ipp;
|
|
bool is_ipp;
|
|
uint32_t val = 0;
|
|
uint32_t val = 0;
|
|
|
|
+ struct cam_isp_sensor_dimension *path_config;
|
|
|
|
|
|
path_data = (struct cam_ife_csid_path_cfg *) res->res_priv;
|
|
path_data = (struct cam_ife_csid_path_cfg *) res->res_priv;
|
|
csid_reg = csid_hw->csid_info->csid_reg;
|
|
csid_reg = csid_hw->csid_info->csid_reg;
|
|
@@ -2025,9 +2062,11 @@ static int cam_ife_csid_enable_pxl_path(
|
|
if (res->res_id == CAM_IFE_PIX_PATH_RES_IPP) {
|
|
if (res->res_id == CAM_IFE_PIX_PATH_RES_IPP) {
|
|
is_ipp = true;
|
|
is_ipp = true;
|
|
pxl_reg = csid_reg->ipp_reg;
|
|
pxl_reg = csid_reg->ipp_reg;
|
|
|
|
+ path_config = &(csid_hw->ipp_path_config);
|
|
} else {
|
|
} else {
|
|
is_ipp = false;
|
|
is_ipp = false;
|
|
pxl_reg = csid_reg->ppp_reg;
|
|
pxl_reg = csid_reg->ppp_reg;
|
|
|
|
+ path_config = &(csid_hw->ppp_path_config);
|
|
}
|
|
}
|
|
|
|
|
|
if (res->res_state != CAM_ISP_RESOURCE_STATE_INIT_HW) {
|
|
if (res->res_state != CAM_ISP_RESOURCE_STATE_INIT_HW) {
|
|
@@ -2096,6 +2135,10 @@ static int cam_ife_csid_enable_pxl_path(
|
|
if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_EOF_IRQ)
|
|
if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_EOF_IRQ)
|
|
val |= CSID_PATH_INFO_INPUT_EOF;
|
|
val |= CSID_PATH_INFO_INPUT_EOF;
|
|
|
|
|
|
|
|
+ if (path_config->measure_enabled)
|
|
|
|
+ val |= (CSID_PATH_ERROR_PIX_COUNT |
|
|
|
|
+ CSID_PATH_ERROR_LINE_COUNT);
|
|
|
|
+
|
|
cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
pxl_reg->csid_pxl_irq_mask_addr);
|
|
pxl_reg->csid_pxl_irq_mask_addr);
|
|
|
|
|
|
@@ -2209,7 +2252,8 @@ static int cam_ife_csid_init_config_rdi_path(
|
|
const struct cam_ife_csid_reg_offset *csid_reg;
|
|
const struct cam_ife_csid_reg_offset *csid_reg;
|
|
struct cam_hw_soc_info *soc_info;
|
|
struct cam_hw_soc_info *soc_info;
|
|
uint32_t path_format = 0, plain_fmt = 0, val = 0, id;
|
|
uint32_t path_format = 0, plain_fmt = 0, val = 0, id;
|
|
- uint32_t format_measure_addr, camera_hw_version, packing_fmt = 0;
|
|
|
|
|
|
+ uint32_t format_measure_addr, camera_hw_version;
|
|
|
|
+ uint32_t packing_fmt = 0, in_bpp = 0;
|
|
|
|
|
|
path_data = (struct cam_ife_csid_path_cfg *) res->res_priv;
|
|
path_data = (struct cam_ife_csid_path_cfg *) res->res_priv;
|
|
csid_reg = csid_hw->csid_info->csid_reg;
|
|
csid_reg = csid_hw->csid_info->csid_reg;
|
|
@@ -2224,7 +2268,7 @@ static int cam_ife_csid_init_config_rdi_path(
|
|
|
|
|
|
rc = cam_ife_csid_get_format_rdi(path_data->in_format,
|
|
rc = cam_ife_csid_get_format_rdi(path_data->in_format,
|
|
path_data->out_format, &path_format, &plain_fmt, &packing_fmt,
|
|
path_data->out_format, &path_format, &plain_fmt, &packing_fmt,
|
|
- path_data->crop_enable || path_data->drop_enable);
|
|
|
|
|
|
+ path_data->crop_enable || path_data->drop_enable, &in_bpp);
|
|
if (rc)
|
|
if (rc)
|
|
return rc;
|
|
return rc;
|
|
|
|
|
|
@@ -2306,6 +2350,35 @@ static int cam_ife_csid_init_config_rdi_path(
|
|
csid_reg->rdi_reg[id]->csid_rdi_err_recovery_cfg0_addr);
|
|
csid_reg->rdi_reg[id]->csid_rdi_err_recovery_cfg0_addr);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* configure pixel format measure */
|
|
|
|
+ if (csid_hw->rdi_path_config[id].measure_enabled) {
|
|
|
|
+ val = ((csid_hw->rdi_path_config[id].height &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_mask_val) <<
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_shift_val);
|
|
|
|
+
|
|
|
|
+ if (path_format == 0xF)
|
|
|
|
+ val |= (__KERNEL_DIV_ROUND_UP(
|
|
|
|
+ (csid_hw->rdi_path_config[id].width *
|
|
|
|
+ in_bpp), 8) &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_width_mask_val);
|
|
|
|
+ else
|
|
|
|
+ val |= (csid_hw->rdi_path_config[id].width &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_width_mask_val);
|
|
|
|
+
|
|
|
|
+ CAM_DBG(CAM_ISP, "CSID:%d format measure cfg1 value : 0x%x",
|
|
|
|
+ csid_hw->hw_intf->hw_idx, val);
|
|
|
|
+ CAM_DBG(CAM_ISP, "format measure width : 0x%x height : 0x%x",
|
|
|
|
+ csid_hw->rdi_path_config[id].width,
|
|
|
|
+ csid_hw->rdi_path_config[id].height);
|
|
|
|
+
|
|
|
|
+ cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
|
|
+ csid_reg->rdi_reg[id]->csid_rdi_format_measure_cfg1_addr);
|
|
|
|
+
|
|
|
|
+ /* enable pixel and line counter */
|
|
|
|
+ cam_io_w_mb(3, soc_info->reg_map[0].mem_base +
|
|
|
|
+ csid_reg->rdi_reg[id]->csid_rdi_format_measure_cfg0_addr);
|
|
|
|
+ }
|
|
|
|
+
|
|
/* set frame drop pattern to 0 and period to 1 */
|
|
/* set frame drop pattern to 0 and period to 1 */
|
|
cam_io_w_mb(1, soc_info->reg_map[0].mem_base +
|
|
cam_io_w_mb(1, soc_info->reg_map[0].mem_base +
|
|
csid_reg->rdi_reg[id]->csid_rdi_frm_drop_period_addr);
|
|
csid_reg->rdi_reg[id]->csid_rdi_frm_drop_period_addr);
|
|
@@ -2403,7 +2476,7 @@ static int cam_ife_csid_init_config_udi_path(
|
|
const struct cam_ife_csid_reg_offset *csid_reg;
|
|
const struct cam_ife_csid_reg_offset *csid_reg;
|
|
struct cam_hw_soc_info *soc_info;
|
|
struct cam_hw_soc_info *soc_info;
|
|
uint32_t path_format = 0, plain_fmt = 0, val = 0, val1, id;
|
|
uint32_t path_format = 0, plain_fmt = 0, val = 0, val1, id;
|
|
- uint32_t format_measure_addr, packing_fmt = 0;
|
|
|
|
|
|
+ uint32_t format_measure_addr, packing_fmt = 0, in_bpp = 0;
|
|
|
|
|
|
path_data = (struct cam_ife_csid_path_cfg *)res->res_priv;
|
|
path_data = (struct cam_ife_csid_path_cfg *)res->res_priv;
|
|
csid_reg = csid_hw->csid_info->csid_reg;
|
|
csid_reg = csid_hw->csid_info->csid_reg;
|
|
@@ -2418,7 +2491,7 @@ static int cam_ife_csid_init_config_udi_path(
|
|
|
|
|
|
rc = cam_ife_csid_get_format_rdi(path_data->in_format,
|
|
rc = cam_ife_csid_get_format_rdi(path_data->in_format,
|
|
path_data->out_format, &path_format, &plain_fmt, &packing_fmt,
|
|
path_data->out_format, &path_format, &plain_fmt, &packing_fmt,
|
|
- path_data->crop_enable || path_data->drop_enable);
|
|
|
|
|
|
+ path_data->crop_enable || path_data->drop_enable, &in_bpp);
|
|
if (rc) {
|
|
if (rc) {
|
|
CAM_ERR(CAM_ISP,
|
|
CAM_ERR(CAM_ISP,
|
|
"Failed to get format in_format: %u out_format: %u rc: %d",
|
|
"Failed to get format in_format: %u out_format: %u rc: %d",
|
|
@@ -2682,9 +2755,14 @@ static int cam_ife_csid_enable_rdi_path(
|
|
|
|
|
|
if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_SOF_IRQ)
|
|
if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_SOF_IRQ)
|
|
val |= CSID_PATH_INFO_INPUT_SOF;
|
|
val |= CSID_PATH_INFO_INPUT_SOF;
|
|
|
|
+
|
|
if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_EOF_IRQ)
|
|
if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_EOF_IRQ)
|
|
val |= CSID_PATH_INFO_INPUT_EOF;
|
|
val |= CSID_PATH_INFO_INPUT_EOF;
|
|
|
|
|
|
|
|
+ if (csid_hw->rdi_path_config[id].measure_enabled)
|
|
|
|
+ val |= (CSID_PATH_ERROR_PIX_COUNT |
|
|
|
|
+ CSID_PATH_ERROR_LINE_COUNT);
|
|
|
|
+
|
|
cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
|
|
csid_reg->rdi_reg[id]->csid_rdi_irq_mask_addr);
|
|
csid_reg->rdi_reg[id]->csid_rdi_irq_mask_addr);
|
|
|
|
|
|
@@ -3308,6 +3386,13 @@ int cam_ife_csid_release(void *hw_priv,
|
|
break;
|
|
break;
|
|
case CAM_ISP_RESOURCE_PIX_PATH:
|
|
case CAM_ISP_RESOURCE_PIX_PATH:
|
|
res->res_state = CAM_ISP_RESOURCE_STATE_AVAILABLE;
|
|
res->res_state = CAM_ISP_RESOURCE_STATE_AVAILABLE;
|
|
|
|
+ if (res->res_id == CAM_IFE_PIX_PATH_RES_IPP)
|
|
|
|
+ csid_hw->ipp_path_config.measure_enabled = 0;
|
|
|
|
+ else if (res->res_id == CAM_IFE_PIX_PATH_RES_PPP)
|
|
|
|
+ csid_hw->ppp_path_config.measure_enabled = 0;
|
|
|
|
+ else
|
|
|
|
+ csid_hw->rdi_path_config[res->res_id].measure_enabled
|
|
|
|
+ = 0;
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
CAM_ERR(CAM_ISP, "CSID:%d Invalid res type:%d res id%d",
|
|
CAM_ERR(CAM_ISP, "CSID:%d Invalid res type:%d res id%d",
|
|
@@ -3858,6 +3943,58 @@ static int cam_ife_csid_set_csid_clock(
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int cam_ife_csid_set_sensor_dimension(
|
|
|
|
+ struct cam_ife_csid_hw *csid_hw, void *cmd_args)
|
|
|
|
+{
|
|
|
|
+ struct cam_ife_sensor_dimension_update_args *dimension_update = NULL;
|
|
|
|
+ uint32_t i;
|
|
|
|
+
|
|
|
|
+ if (!csid_hw)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ dimension_update =
|
|
|
|
+ (struct cam_ife_sensor_dimension_update_args *)cmd_args;
|
|
|
|
+ csid_hw->ipp_path_config.measure_enabled =
|
|
|
|
+ dimension_update->ipp_path.measure_enabled;
|
|
|
|
+ if (dimension_update->ipp_path.measure_enabled) {
|
|
|
|
+ csid_hw->ipp_path_config.width =
|
|
|
|
+ dimension_update->ipp_path.width;
|
|
|
|
+ csid_hw->ipp_path_config.height =
|
|
|
|
+ dimension_update->ipp_path.height;
|
|
|
|
+ CAM_DBG(CAM_ISP, "CSID ipp path width %d height %d",
|
|
|
|
+ csid_hw->ipp_path_config.width,
|
|
|
|
+ csid_hw->ipp_path_config.height);
|
|
|
|
+ }
|
|
|
|
+ csid_hw->ppp_path_config.measure_enabled =
|
|
|
|
+ dimension_update->ppp_path.measure_enabled;
|
|
|
|
+ if (dimension_update->ppp_path.measure_enabled) {
|
|
|
|
+ csid_hw->ppp_path_config.width =
|
|
|
|
+ dimension_update->ppp_path.width;
|
|
|
|
+ csid_hw->ppp_path_config.height =
|
|
|
|
+ dimension_update->ppp_path.height;
|
|
|
|
+ CAM_DBG(CAM_ISP, "CSID ppp path width %d height %d",
|
|
|
|
+ csid_hw->ppp_path_config.width,
|
|
|
|
+ csid_hw->ppp_path_config.height);
|
|
|
|
+ }
|
|
|
|
+ for (i = 0; i <= CAM_IFE_PIX_PATH_RES_RDI_3; i++) {
|
|
|
|
+ csid_hw->rdi_path_config[i].measure_enabled
|
|
|
|
+ = dimension_update->rdi_path[i].measure_enabled;
|
|
|
|
+ if (csid_hw->rdi_path_config[i].measure_enabled) {
|
|
|
|
+ csid_hw->rdi_path_config[i].width =
|
|
|
|
+ dimension_update->rdi_path[i].width;
|
|
|
|
+ csid_hw->rdi_path_config[i].height =
|
|
|
|
+ dimension_update->rdi_path[i].height;
|
|
|
|
+ if (csid_hw->rdi_path_config[i].height == 1)
|
|
|
|
+ csid_hw->rdi_path_config[i].measure_enabled = 0;
|
|
|
|
+ CAM_DBG(CAM_ISP,
|
|
|
|
+ "CSID rdi path[%d] width %d height %d",
|
|
|
|
+ i, csid_hw->rdi_path_config[i].width,
|
|
|
|
+ csid_hw->rdi_path_config[i].height);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
static int cam_ife_csid_set_csid_qcfa(
|
|
static int cam_ife_csid_set_csid_qcfa(
|
|
struct cam_ife_csid_hw *csid_hw, void *cmd_args)
|
|
struct cam_ife_csid_hw *csid_hw, void *cmd_args)
|
|
{
|
|
{
|
|
@@ -3998,6 +4135,9 @@ static int cam_ife_csid_process_cmd(void *hw_priv,
|
|
case CAM_ISP_HW_CMD_DUMP_HW:
|
|
case CAM_ISP_HW_CMD_DUMP_HW:
|
|
rc = cam_ife_csid_dump_hw(csid_hw, cmd_args);
|
|
rc = cam_ife_csid_dump_hw(csid_hw, cmd_args);
|
|
break;
|
|
break;
|
|
|
|
+ case CAM_IFE_CSID_SET_SENSOR_DIMENSION_CFG:
|
|
|
|
+ rc = cam_ife_csid_set_sensor_dimension(csid_hw, cmd_args);
|
|
|
|
+ break;
|
|
default:
|
|
default:
|
|
CAM_ERR(CAM_ISP, "CSID:%d unsupported cmd:%d",
|
|
CAM_ERR(CAM_ISP, "CSID:%d unsupported cmd:%d",
|
|
csid_hw->hw_intf->hw_idx, cmd_type);
|
|
csid_hw->hw_intf->hw_idx, cmd_type);
|
|
@@ -4018,7 +4158,7 @@ irqreturn_t cam_ife_csid_irq(int irq_num, void *data)
|
|
uint32_t i, irq_status_top, irq_status_rx, irq_status_ipp = 0;
|
|
uint32_t i, irq_status_top, irq_status_rx, irq_status_ipp = 0;
|
|
uint32_t irq_status_rdi[CAM_IFE_CSID_RDI_MAX] = {0, 0, 0, 0};
|
|
uint32_t irq_status_rdi[CAM_IFE_CSID_RDI_MAX] = {0, 0, 0, 0};
|
|
uint32_t irq_status_udi[CAM_IFE_CSID_UDI_MAX] = {0, 0, 0};
|
|
uint32_t irq_status_udi[CAM_IFE_CSID_UDI_MAX] = {0, 0, 0};
|
|
- uint32_t val, irq_status_ppp = 0;
|
|
|
|
|
|
+ uint32_t val, val2, irq_status_ppp = 0;
|
|
bool fatal_err_detected = false;
|
|
bool fatal_err_detected = false;
|
|
uint32_t sof_irq_debug_en = 0;
|
|
uint32_t sof_irq_debug_en = 0;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
@@ -4345,6 +4485,25 @@ irqreturn_t cam_ife_csid_irq(int irq_num, void *data)
|
|
soc_info->reg_map[0].mem_base +
|
|
soc_info->reg_map[0].mem_base +
|
|
csid_reg->ipp_reg->csid_pxl_ctrl_addr);
|
|
csid_reg->ipp_reg->csid_pxl_ctrl_addr);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if ((irq_status_ipp & CSID_PATH_ERROR_PIX_COUNT) ||
|
|
|
|
+ (irq_status_ipp & CSID_PATH_ERROR_LINE_COUNT)) {
|
|
|
|
+ val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
|
|
|
+ csid_reg->ipp_reg->csid_pxl_format_measure0_addr);
|
|
|
|
+
|
|
|
|
+ CAM_ERR(CAM_ISP,
|
|
|
|
+ "CSID:%d irq_status_ipp:0x%x",
|
|
|
|
+ csid_hw->hw_intf->hw_idx, irq_status_ipp);
|
|
|
|
+ CAM_ERR(CAM_ISP,
|
|
|
|
+ "Expected:: h: 0x%x w: 0x%x actual:: h: 0x%x w: 0x%x",
|
|
|
|
+ csid_hw->ipp_path_config.height,
|
|
|
|
+ csid_hw->ipp_path_config.width,
|
|
|
|
+ ((val >>
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_shift_val) &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_mask_val),
|
|
|
|
+ val &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_width_mask_val);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/*read PPP errors */
|
|
/*read PPP errors */
|
|
@@ -4388,6 +4547,25 @@ irqreturn_t cam_ife_csid_irq(int irq_num, void *data)
|
|
soc_info->reg_map[0].mem_base +
|
|
soc_info->reg_map[0].mem_base +
|
|
csid_reg->ppp_reg->csid_pxl_ctrl_addr);
|
|
csid_reg->ppp_reg->csid_pxl_ctrl_addr);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if ((irq_status_ppp & CSID_PATH_ERROR_PIX_COUNT) ||
|
|
|
|
+ (irq_status_ppp & CSID_PATH_ERROR_LINE_COUNT)) {
|
|
|
|
+ val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
|
|
|
+ csid_reg->ppp_reg->csid_pxl_format_measure0_addr);
|
|
|
|
+
|
|
|
|
+ CAM_ERR(CAM_ISP,
|
|
|
|
+ "CSID:%d irq_status_ppp:0x%x",
|
|
|
|
+ csid_hw->hw_intf->hw_idx, irq_status_ppp);
|
|
|
|
+ CAM_ERR(CAM_ISP,
|
|
|
|
+ "Expected:: h: 0x%x w: 0x%x actual:: h: 0x%x w: 0x%x",
|
|
|
|
+ csid_hw->ppp_path_config.height,
|
|
|
|
+ csid_hw->ppp_path_config.width,
|
|
|
|
+ ((val >>
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_shift_val) &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_mask_val),
|
|
|
|
+ val &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_width_mask_val);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
for (i = 0; i < csid_reg->cmn_reg->num_rdis; i++) {
|
|
for (i = 0; i < csid_reg->cmn_reg->num_rdis; i++) {
|
|
@@ -4428,6 +4606,30 @@ irqreturn_t cam_ife_csid_irq(int irq_num, void *data)
|
|
soc_info->reg_map[0].mem_base +
|
|
soc_info->reg_map[0].mem_base +
|
|
csid_reg->rdi_reg[i]->csid_rdi_ctrl_addr);
|
|
csid_reg->rdi_reg[i]->csid_rdi_ctrl_addr);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if ((irq_status_rdi[i] & CSID_PATH_ERROR_PIX_COUNT) ||
|
|
|
|
+ (irq_status_rdi[i] & CSID_PATH_ERROR_LINE_COUNT)) {
|
|
|
|
+ val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
|
|
|
+ csid_reg->rdi_reg[i]->csid_rdi_format_measure0_addr);
|
|
|
|
+ val2 = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
|
|
|
+ csid_reg->rdi_reg[i]->csid_rdi_format_measure_cfg1_addr
|
|
|
|
+ );
|
|
|
|
+ CAM_ERR(CAM_ISP,
|
|
|
|
+ "CSID:%d irq_status_rdi[%d]:0x%x",
|
|
|
|
+ csid_hw->hw_intf->hw_idx, i, irq_status_rdi[i]);
|
|
|
|
+ CAM_ERR(CAM_ISP,
|
|
|
|
+ "Expected:: h: 0x%x w: 0x%x actual:: h: 0x%x w: 0x%x",
|
|
|
|
+ ((val2 >>
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_shift_val) &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_mask_val),
|
|
|
|
+ val2 &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_width_mask_val,
|
|
|
|
+ ((val >>
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_shift_val) &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_height_mask_val),
|
|
|
|
+ val &
|
|
|
|
+ csid_reg->cmn_reg->format_measure_width_mask_val);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
for (i = 0; i < csid_reg->cmn_reg->num_udis; i++) {
|
|
for (i = 0; i < csid_reg->cmn_reg->num_udis; i++) {
|
|
@@ -4641,6 +4843,10 @@ int cam_ife_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf,
|
|
|
|
|
|
ife_csid_hw->csid_debug = 0;
|
|
ife_csid_hw->csid_debug = 0;
|
|
ife_csid_hw->error_irq_count = 0;
|
|
ife_csid_hw->error_irq_count = 0;
|
|
|
|
+ ife_csid_hw->ipp_path_config.measure_enabled = 0;
|
|
|
|
+ ife_csid_hw->ppp_path_config.measure_enabled = 0;
|
|
|
|
+ for (i = 0; i <= CAM_IFE_PIX_PATH_RES_RDI_3; i++)
|
|
|
|
+ ife_csid_hw->rdi_path_config[i].measure_enabled = 0;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
err:
|
|
err:
|