msm: camera: Add crop support in ISPIF
Ispif crops sensor input for dual VFE to use. Sensor will still output only one big frame, and ispif needs to split a whole frame into two part for dual ISP to use. Change-Id: I42ae48bc3b070625e91f3cc5003339ba8035d6b9 Signed-off-by: Peter Liu <pingchie@codeaurora.org> Signed-off-by: Mingcheng Zhu <mingchen@codeaurora.org>
This commit is contained in:
committed by
Iliyan Malchev
parent
304a5f84c0
commit
b209dd4e75
@@ -362,6 +362,36 @@ static void msm_ispif_sel_csid_core(struct ispif_device *ispif,
|
||||
ISPIF_VFE_m_INPUT_SEL(vfe_intf));
|
||||
}
|
||||
|
||||
static void msm_ispif_enable_crop(struct ispif_device *ispif,
|
||||
uint8_t intftype, uint8_t vfe_intf, uint16_t start_pixel,
|
||||
uint16_t end_pixel)
|
||||
{
|
||||
uint32_t data;
|
||||
BUG_ON(!ispif);
|
||||
|
||||
if (!msm_ispif_is_intf_valid(ispif->csid_version, vfe_intf)) {
|
||||
pr_err("%s: invalid interface type\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
data = msm_camera_io_r(ispif->base + ISPIF_VFE_m_CTRL_0(vfe_intf));
|
||||
data |= (1 << (intftype + 7));
|
||||
msm_camera_io_w(data,
|
||||
ispif->base + ISPIF_VFE_m_CTRL_0(vfe_intf));
|
||||
|
||||
if (intftype == PIX0)
|
||||
msm_camera_io_w_mb(start_pixel | (end_pixel << 16),
|
||||
ispif->base + ISPIF_VFE_m_PIX_INTF_n_CROP(vfe_intf, 0));
|
||||
else if (intftype == PIX1)
|
||||
msm_camera_io_w_mb(start_pixel | (end_pixel << 16),
|
||||
ispif->base + ISPIF_VFE_m_PIX_INTF_n_CROP(vfe_intf, 1));
|
||||
else {
|
||||
pr_err("%s: invalid intftype=%d\n", __func__, intftype);
|
||||
BUG_ON(1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void msm_ispif_enable_intf_cids(struct ispif_device *ispif,
|
||||
uint8_t intftype, uint16_t cid_mask, uint8_t vfe_intf, uint8_t enable)
|
||||
{
|
||||
@@ -519,6 +549,10 @@ static int msm_ispif_config(struct ispif_device *ispif,
|
||||
¶ms->entries[i]);
|
||||
msm_ispif_enable_intf_cids(ispif, intftype,
|
||||
cid_mask, vfe_intf, 1);
|
||||
if (params->entries[i].crop_enable)
|
||||
msm_ispif_enable_crop(ispif, intftype, vfe_intf,
|
||||
params->entries[i].crop_start_pixel,
|
||||
params->entries[i].crop_end_pixel);
|
||||
}
|
||||
|
||||
for (vfe_intf = 0; vfe_intf < 2; vfe_intf++) {
|
||||
|
||||
@@ -69,6 +69,9 @@ struct msm_ispif_params_entry {
|
||||
int num_cids;
|
||||
enum msm_ispif_cid cids[3];
|
||||
enum msm_ispif_csid csid;
|
||||
int crop_enable;
|
||||
uint16_t crop_start_pixel;
|
||||
uint16_t crop_end_pixel;
|
||||
};
|
||||
|
||||
struct msm_ispif_param_data {
|
||||
|
||||
Reference in New Issue
Block a user