diff options
Diffstat (limited to 'drivers/media/platform/qcom/camss/camss-vfe.c')
-rw-r--r-- | drivers/media/platform/qcom/camss/camss-vfe.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c index ed6a557de65d..a8c542fa647d 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -37,9 +37,9 @@ /* VFE halt timeout */ #define VFE_HALT_TIMEOUT_MS 100 /* Max number of frame drop updates per frame */ -#define VFE_FRAME_DROP_UPDATES 5 -/* Frame drop value. NOTE: VAL + UPDATES should not exceed 31 */ -#define VFE_FRAME_DROP_VAL 20 +#define VFE_FRAME_DROP_UPDATES 2 +/* Frame drop value. VAL + UPDATES - 1 should not exceed 31 */ +#define VFE_FRAME_DROP_VAL 30 #define VFE_NEXT_SOF_MS 500 @@ -659,7 +659,9 @@ static int vfe_enable_output(struct vfe_line *line) struct vfe_device *vfe = to_vfe(line); struct vfe_output *output = &line->output; const struct vfe_hw_ops *ops = vfe->ops; + struct media_entity *sensor; unsigned long flags; + unsigned int frame_skip = 0; unsigned int i; u16 ub_size; @@ -667,6 +669,17 @@ static int vfe_enable_output(struct vfe_line *line) if (!ub_size) return -EINVAL; + sensor = camss_find_sensor(&line->subdev.entity); + if (sensor) { + struct v4l2_subdev *subdev = + media_entity_to_v4l2_subdev(sensor); + + v4l2_subdev_call(subdev, sensor, g_skip_frames, &frame_skip); + /* Max frame skip is 29 frames */ + if (frame_skip > VFE_FRAME_DROP_VAL - 1) + frame_skip = VFE_FRAME_DROP_VAL - 1; + } + spin_lock_irqsave(&vfe->output_lock, flags); ops->reg_update_clear(vfe, line->id); @@ -695,10 +708,10 @@ static int vfe_enable_output(struct vfe_line *line) switch (output->state) { case VFE_OUTPUT_SINGLE: - vfe_output_frame_drop(vfe, output, 1); + vfe_output_frame_drop(vfe, output, 1 << frame_skip); break; case VFE_OUTPUT_CONTINUOUS: - vfe_output_frame_drop(vfe, output, 3); + vfe_output_frame_drop(vfe, output, 3 << frame_skip); break; default: vfe_output_frame_drop(vfe, output, 0); |