msm: camera: isp: Add camif raw path output format support
Add changes to enable different output formats on supported target. This change enables camif raw path to output data in multiple other formats along with legacy packed. Change-Id: Ie763455df2cffcb4fc9447a1bbcc8d9c7d577c6c Signed-off-by: Sagar Gore <sgore@codeaurora.org>
This commit is contained in:
parent
0763a08bad
commit
67f57cd267
3 changed files with 79 additions and 40 deletions
|
@ -721,7 +721,6 @@ struct vfe_device {
|
||||||
uint32_t isp_raw0_debug;
|
uint32_t isp_raw0_debug;
|
||||||
uint32_t isp_raw1_debug;
|
uint32_t isp_raw1_debug;
|
||||||
uint32_t isp_raw2_debug;
|
uint32_t isp_raw2_debug;
|
||||||
uint8_t is_camif_raw_crop_supported;
|
|
||||||
|
|
||||||
/* irq info */
|
/* irq info */
|
||||||
uint32_t irq0_mask;
|
uint32_t irq0_mask;
|
||||||
|
|
|
@ -433,8 +433,6 @@ static void msm_vfe40_init_hardware_reg(struct vfe_device *vfe_dev)
|
||||||
break;
|
break;
|
||||||
case VFE40_8937_VERSION:
|
case VFE40_8937_VERSION:
|
||||||
case VFE40_8953_VERSION:
|
case VFE40_8953_VERSION:
|
||||||
vfe_dev->is_camif_raw_crop_supported = 1;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
ISP_DBG("%s: No special QOS\n", __func__);
|
ISP_DBG("%s: No special QOS\n", __func__);
|
||||||
}
|
}
|
||||||
|
@ -1400,44 +1398,44 @@ static void msm_vfe40_cfg_camif(struct vfe_device *vfe_dev,
|
||||||
msm_camera_io_w((subsample_cfg->line_skip << 16) |
|
msm_camera_io_w((subsample_cfg->line_skip << 16) |
|
||||||
subsample_cfg->pixel_skip,
|
subsample_cfg->pixel_skip,
|
||||||
vfe_dev->vfe_base + 0x30C);
|
vfe_dev->vfe_base + 0x30C);
|
||||||
if (vfe_dev->is_camif_raw_crop_supported) {
|
if (subsample_cfg->first_pixel ||
|
||||||
/* Pdaf output will be sent in PLAIN16 format*/
|
subsample_cfg->last_pixel ||
|
||||||
val = msm_camera_io_r(vfe_dev->vfe_base + 0x54);
|
subsample_cfg->first_line ||
|
||||||
switch (subsample_cfg->output_format) {
|
subsample_cfg->last_line) {
|
||||||
case CAMIF_PLAIN_8:
|
msm_camera_io_w(
|
||||||
val |= 4 << 9;
|
subsample_cfg->first_pixel << 16 |
|
||||||
break;
|
subsample_cfg->last_pixel,
|
||||||
case CAMIF_PLAIN_16:
|
vfe_dev->vfe_base + 0x8A4);
|
||||||
val |= 5 << 9;
|
msm_camera_io_w(
|
||||||
break;
|
subsample_cfg->first_line << 16 |
|
||||||
case CAMIF_MIPI_RAW:
|
subsample_cfg->last_line,
|
||||||
val |= 1 << 9;
|
vfe_dev->vfe_base + 0x8A8);
|
||||||
break;
|
val = msm_camera_io_r(
|
||||||
case CAMIF_QCOM_RAW:
|
vfe_dev->vfe_base + 0x2F8);
|
||||||
default:
|
val |= 1 << 22;
|
||||||
break;
|
msm_camera_io_w(val,
|
||||||
}
|
vfe_dev->vfe_base + 0x2F8);
|
||||||
msm_camera_io_w(val, vfe_dev->vfe_base + 0x54);
|
}
|
||||||
if (subsample_cfg->first_pixel ||
|
|
||||||
subsample_cfg->last_pixel ||
|
|
||||||
subsample_cfg->first_line ||
|
|
||||||
subsample_cfg->last_line) {
|
|
||||||
msm_camera_io_w(
|
|
||||||
subsample_cfg->first_pixel << 16 |
|
|
||||||
subsample_cfg->last_pixel,
|
|
||||||
vfe_dev->vfe_base + 0x8A4);
|
|
||||||
msm_camera_io_w(
|
|
||||||
subsample_cfg->first_line << 16 |
|
|
||||||
subsample_cfg->last_line,
|
|
||||||
vfe_dev->vfe_base + 0x8A8);
|
|
||||||
val = msm_camera_io_r(
|
|
||||||
vfe_dev->vfe_base + 0x2F8);
|
|
||||||
val |= 1 << 22;
|
|
||||||
msm_camera_io_w(val,
|
|
||||||
vfe_dev->vfe_base + 0x2F8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ISP_DBG("%s:camif raw op fmt %d\n",
|
||||||
|
__func__, subsample_cfg->output_format);
|
||||||
|
/* Pdaf output will be sent in PLAIN16 format*/
|
||||||
|
val = msm_camera_io_r(vfe_dev->vfe_base + 0x54);
|
||||||
|
switch (subsample_cfg->output_format) {
|
||||||
|
case CAMIF_PLAIN_8:
|
||||||
|
val |= 4 << 9;
|
||||||
|
break;
|
||||||
|
case CAMIF_PLAIN_16:
|
||||||
|
val |= 5 << 9;
|
||||||
|
break;
|
||||||
|
case CAMIF_MIPI_RAW:
|
||||||
|
val |= 1 << 9;
|
||||||
|
break;
|
||||||
|
case CAMIF_QCOM_RAW:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
msm_camera_io_w(val, vfe_dev->vfe_base + 0x54);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1317,6 +1317,48 @@ static void msm_vfe47_cfg_camif(struct vfe_device *vfe_dev,
|
||||||
msm_camera_io_w(0xFFFFFFFF, vfe_dev->vfe_base + 0x49C);
|
msm_camera_io_w(0xFFFFFFFF, vfe_dev->vfe_base + 0x49C);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (subsample_cfg->first_pixel ||
|
||||||
|
subsample_cfg->last_pixel ||
|
||||||
|
subsample_cfg->first_line ||
|
||||||
|
subsample_cfg->last_line) {
|
||||||
|
msm_camera_io_w(
|
||||||
|
subsample_cfg->first_pixel << 16 |
|
||||||
|
subsample_cfg->last_pixel,
|
||||||
|
vfe_dev->vfe_base + 0xCE4);
|
||||||
|
msm_camera_io_w(
|
||||||
|
subsample_cfg->first_line << 16 |
|
||||||
|
subsample_cfg->last_line,
|
||||||
|
vfe_dev->vfe_base + 0xCE4);
|
||||||
|
val = msm_camera_io_r(
|
||||||
|
vfe_dev->vfe_base + 0x47C);
|
||||||
|
ISP_DBG("%s: camif raw crop enabled\n", __func__);
|
||||||
|
val |= 1 << 22;
|
||||||
|
msm_camera_io_w(val,
|
||||||
|
vfe_dev->vfe_base + 0x47C);
|
||||||
|
}
|
||||||
|
|
||||||
|
ISP_DBG("%s: camif raw op fmt %d\n",
|
||||||
|
__func__, subsample_cfg->output_format);
|
||||||
|
/* Pdaf output can be sent in below formats */
|
||||||
|
val = msm_camera_io_r(vfe_dev->vfe_base + 0x88);
|
||||||
|
switch (subsample_cfg->output_format) {
|
||||||
|
case CAMIF_PLAIN_8:
|
||||||
|
val |= PLAIN8 << 9;
|
||||||
|
break;
|
||||||
|
case CAMIF_PLAIN_16:
|
||||||
|
val |= PLAIN16 << 9;
|
||||||
|
break;
|
||||||
|
case CAMIF_MIPI_RAW:
|
||||||
|
val |= MIPI << 9;
|
||||||
|
break;
|
||||||
|
case CAMIF_QCOM_RAW:
|
||||||
|
val |= QCOM << 9;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
msm_camera_io_w(val, vfe_dev->vfe_base + 0x88);
|
||||||
|
|
||||||
val = msm_camera_io_r(vfe_dev->vfe_base + 0x46C);
|
val = msm_camera_io_r(vfe_dev->vfe_base + 0x46C);
|
||||||
val |= camif_cfg->camif_input;
|
val |= camif_cfg->camif_input;
|
||||||
msm_camera_io_w(val, vfe_dev->vfe_base + 0x46C);
|
msm_camera_io_w(val, vfe_dev->vfe_base + 0x46C);
|
||||||
|
|
Loading…
Add table
Reference in a new issue