The params isr is called when a frame is out of the isp. The parameters are applied immediately since the isr updates the shadow registers. Therefore the params are first applied on the next frame. We want the vb.sequence to be the frame that the params are applied to. So we set vb.sequence to be the isp's frame_sequence + 1 Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@xxxxxxxxxxxxx> --- drivers/staging/media/rkisp1/rkisp1-params.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-params.c b/drivers/staging/media/rkisp1/rkisp1-params.c index 134b5c9a94c1..4b4391c0a2a0 100644 --- a/drivers/staging/media/rkisp1/rkisp1-params.c +++ b/drivers/staging/media/rkisp1/rkisp1-params.c @@ -1220,7 +1220,14 @@ void rkisp1_params_apply_params_cfg(struct rkisp1_params *params, unsigned int f void rkisp1_params_isr(struct rkisp1_device *rkisp1) { - unsigned int frame_sequence = atomic_read(&rkisp1->isp.frame_sequence); + /* + * The params isr is called when a frame is out of the isp. The parameters + * are applied immediately since the isr updates the shadow registers. + * Therefore the params are first applied on the next frame. + * We want the vb.sequence to be the frame that the params are applied to. + * So we set vb.sequence to be the isp's frame_sequence + 1 + */ + unsigned int frame_sequence = atomic_read(&rkisp1->isp.frame_sequence) + 1; struct rkisp1_params *params = &rkisp1->params; spin_lock(¶ms->config_lock); -- 2.17.1