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

media: videobuf: use u64 for the timestamp internally



Just like vb2 does, use u64 internally to store the timestamps
of the buffers. Only convert to timeval when interfacing with
userspace.

Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 63635b54
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ void saa7146_buffer_finish(struct saa7146_dev *dev,
	}

	q->curr->vb.state = state;
	v4l2_get_timestamp(&q->curr->vb.ts);
	q->curr->vb.ts = ktime_get_ns();
	wake_up(&q->curr->vb.done);

	q->curr = NULL;
+3 −5
Original line number Diff line number Diff line
@@ -3600,9 +3600,7 @@ static void
bttv_irq_wakeup_video(struct bttv *btv, struct bttv_buffer_set *wakeup,
		      struct bttv_buffer_set *curr, unsigned int state)
{
	struct timeval ts;

	v4l2_get_timestamp(&ts);
	u64 ts = ktime_get_ns();

	if (wakeup->top == wakeup->bottom) {
		if (NULL != wakeup->top && curr->top != wakeup->top) {
@@ -3643,7 +3641,7 @@ bttv_irq_wakeup_vbi(struct bttv *btv, struct bttv_buffer *wakeup,
	if (NULL == wakeup)
		return;

	v4l2_get_timestamp(&wakeup->vb.ts);
	wakeup->vb.ts = ktime_get_ns();
	wakeup->vb.field_count = btv->field_count;
	wakeup->vb.state = state;
	wake_up(&wakeup->vb.done);
@@ -3713,7 +3711,7 @@ bttv_irq_wakeup_top(struct bttv *btv)
	btv->curr.top = NULL;
	bttv_risc_hook(btv, RISC_SLOT_O_FIELD, NULL, 0);

	v4l2_get_timestamp(&wakeup->vb.ts);
	wakeup->vb.ts = ktime_get_ns();
	wakeup->vb.field_count = btv->field_count;
	wakeup->vb.state = VIDEOBUF_DONE;
	wake_up(&wakeup->vb.done);
+1 −1
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ static void cx18_mdl_send_to_videobuf(struct cx18_stream *s,
	}

	if (dispatch) {
		v4l2_get_timestamp(&vb_buf->vb.ts);
		vb_buf->vb.ts = ktime_get_ns();
		list_del(&vb_buf->vb.queue);
		vb_buf->vb.state = VIDEOBUF_DONE;
		wake_up(&vb_buf->vb.done);
+1 −1
Original line number Diff line number Diff line
@@ -518,7 +518,7 @@ static void vpfe_schedule_bottom_field(struct vpfe_device *vpfe_dev)

static void vpfe_process_buffer_complete(struct vpfe_device *vpfe_dev)
{
	v4l2_get_timestamp(&vpfe_dev->cur_frm->ts);
	vpfe_dev->cur_frm->ts = ktime_get_ns();
	vpfe_dev->cur_frm->state = VIDEOBUF_DONE;
	vpfe_dev->cur_frm->size = vpfe_dev->fmt.fmt.pix.sizeimage;
	wake_up_interruptible(&vpfe_dev->cur_frm->done);
+1 −1
Original line number Diff line number Diff line
@@ -1090,7 +1090,7 @@ static void viu_capture_intr(struct viu_dev *dev, u32 status)

		if (waitqueue_active(&buf->vb.done)) {
			list_del(&buf->vb.queue);
			v4l2_get_timestamp(&buf->vb.ts);
			buf->vb.ts = ktime_get_ns();
			buf->vb.state = VIDEOBUF_DONE;
			buf->vb.field_count++;
			wake_up(&buf->vb.done);
Loading