Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b59b100c authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] sta2x11: use monotonic timestamp



V4L2 drivers should use MONOTONIC timestamps instead of gettimeofday, which is
affected by daylight savings time.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent c9bc9f50
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -813,7 +813,7 @@ static irqreturn_t vip_irq(int irq, struct sta2x11_vip *vip)
		/* Disable acquisition */
		/* Disable acquisition */
		reg_write(vip, DVP_CTL, reg_read(vip, DVP_CTL) & ~DVP_CTL_ENA);
		reg_write(vip, DVP_CTL, reg_read(vip, DVP_CTL) & ~DVP_CTL_ENA);
		/* Remove the active buffer from the list */
		/* Remove the active buffer from the list */
		do_gettimeofday(&vip->active->vb.v4l2_buf.timestamp);
		v4l2_get_timestamp(&vip->active->vb.v4l2_buf.timestamp);
		vip->active->vb.v4l2_buf.sequence = vip->sequence++;
		vip->active->vb.v4l2_buf.sequence = vip->sequence++;
		vb2_buffer_done(&vip->active->vb, VB2_BUF_STATE_DONE);
		vb2_buffer_done(&vip->active->vb, VB2_BUF_STATE_DONE);
	}
	}
@@ -864,6 +864,7 @@ static int sta2x11_vip_init_buffer(struct sta2x11_vip *vip)
	vip->vb_vidq.buf_struct_size = sizeof(struct vip_buffer);
	vip->vb_vidq.buf_struct_size = sizeof(struct vip_buffer);
	vip->vb_vidq.ops = &vip_video_qops;
	vip->vb_vidq.ops = &vip_video_qops;
	vip->vb_vidq.mem_ops = &vb2_dma_contig_memops;
	vip->vb_vidq.mem_ops = &vb2_dma_contig_memops;
	vip->vb_vidq.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
	err = vb2_queue_init(&vip->vb_vidq);
	err = vb2_queue_init(&vip->vb_vidq);
	if (err)
	if (err)
		return err;
		return err;