Skip to content

Commit d6dd645

Browse files
Junghak Sungmchehab
authored andcommitted
[media] media: videobuf2: Move timestamp to vb2_buffer
Move timestamp from struct vb2_v4l2_buffer to struct vb2_buffer for common use, and change its type to u64 in order to handling y2038 problem. This patch also includes all device drivers' changes related to this restructuring. Signed-off-by: Junghak Sung <[email protected]> Signed-off-by: Geunyoung Kim <[email protected]> Acked-by: Seung-Woo Kim <[email protected]> Acked-by: Inki Dae <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 9057bc2 commit d6dd645

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+108
-106
lines changed

drivers/input/touchscreen/sur40.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ static void sur40_process_video(struct sur40_state *sur40)
444444
goto err_poll;
445445

446446
/* mark as finished */
447-
v4l2_get_timestamp(&new_buf->vb.timestamp);
447+
new_buf->vb.vb2_buf.timestamp = ktime_get_ns();
448448
new_buf->vb.sequence = sur40->sequence++;
449449
new_buf->vb.field = V4L2_FIELD_NONE;
450450
vb2_buffer_done(&new_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);

drivers/media/dvb-frontends/rtl2832_sdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ static void rtl2832_sdr_urb_complete(struct urb *urb)
310310
len = rtl2832_sdr_convert_stream(dev, ptr, urb->transfer_buffer,
311311
urb->actual_length);
312312
vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0, len);
313-
v4l2_get_timestamp(&fbuf->vb.timestamp);
313+
fbuf->vb.vb2_buf.timestamp = ktime_get_ns();
314314
fbuf->vb.sequence = dev->sequence++;
315315
vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
316316
}

drivers/media/pci/cobalt/cobalt-irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static void cobalt_dma_stream_queue_handler(struct cobalt_stream *s)
134134
skip = true;
135135
s->skip_first_frames--;
136136
}
137-
v4l2_get_timestamp(&cb->vb.timestamp);
137+
cb->vb.vb2_buf.timestamp = ktime_get_ns();
138138
/* TODO: the sequence number should be read from the FPGA so we
139139
also know about dropped frames. */
140140
cb->vb.sequence = s->sequence++;

drivers/media/pci/cx23885/cx23885-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ static void cx23885_wakeup(struct cx23885_tsport *port,
427427
buf = list_entry(q->active.next,
428428
struct cx23885_buffer, queue);
429429

430-
v4l2_get_timestamp(&buf->vb.timestamp);
430+
buf->vb.vb2_buf.timestamp = ktime_get_ns();
431431
buf->vb.sequence = q->count++;
432432
dprintk(1, "[%p/%d] wakeup reg=%d buf=%d\n", buf,
433433
buf->vb.vb2_buf.index,

drivers/media/pci/cx23885/cx23885-video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void cx23885_video_wakeup(struct cx23885_dev *dev,
105105
struct cx23885_buffer, queue);
106106

107107
buf->vb.sequence = q->count++;
108-
v4l2_get_timestamp(&buf->vb.timestamp);
108+
buf->vb.vb2_buf.timestamp = ktime_get_ns();
109109
dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf,
110110
buf->vb.vb2_buf.index, count, q->count);
111111
list_del(&buf->queue);

drivers/media/pci/cx25821/cx25821-video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status)
130130
buf = list_entry(dmaq->active.next,
131131
struct cx25821_buffer, queue);
132132

133-
v4l2_get_timestamp(&buf->vb.timestamp);
133+
buf->vb.vb2_buf.timestamp = ktime_get_ns();
134134
buf->vb.sequence = dmaq->count++;
135135
list_del(&buf->queue);
136136
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);

drivers/media/pci/cx88/cx88-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ void cx88_wakeup(struct cx88_core *core,
518518

519519
buf = list_entry(q->active.next,
520520
struct cx88_buffer, list);
521-
v4l2_get_timestamp(&buf->vb.timestamp);
521+
buf->vb.vb2_buf.timestamp = ktime_get_ns();
522522
buf->vb.field = core->field;
523523
buf->vb.sequence = q->count++;
524524
list_del(&buf->list);

drivers/media/pci/dt3155/dt3155.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static irqreturn_t dt3155_irq_handler_even(int irq, void *dev_id)
270270

271271
spin_lock(&ipd->lock);
272272
if (ipd->curr_buf && !list_empty(&ipd->dmaq)) {
273-
v4l2_get_timestamp(&ipd->curr_buf->timestamp);
273+
ipd->curr_buf->vb2_buf.timestamp = ktime_get_ns();
274274
ipd->curr_buf->sequence = ipd->sequence++;
275275
ipd->curr_buf->field = V4L2_FIELD_NONE;
276276
vb2_buffer_done(&ipd->curr_buf->vb2_buf, VB2_BUF_STATE_DONE);

drivers/media/pci/netup_unidvb/netup_unidvb_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static void netup_unidvb_dma_worker(struct work_struct *work)
579579
dev_dbg(&ndev->pci_dev->dev,
580580
"%s(): buffer %p done, size %d\n",
581581
__func__, buf, buf->size);
582-
v4l2_get_timestamp(&buf->vb.timestamp);
582+
buf->vb.vb2_buf.timestamp = ktime_get_ns();
583583
vb2_set_plane_payload(&buf->vb.vb2_buf, 0, buf->size);
584584
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
585585
}

drivers/media/pci/saa7134/saa7134-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void saa7134_buffer_finish(struct saa7134_dev *dev,
309309
core_dbg("buffer_finish %p\n", q->curr);
310310

311311
/* finish current buffer */
312-
v4l2_get_timestamp(&q->curr->vb2.timestamp);
312+
q->curr->vb2.vb2_buf.timestamp = ktime_get_ns();
313313
q->curr->vb2.sequence = q->seq_nr++;
314314
vb2_buffer_done(&q->curr->vb2.vb2_buf, state);
315315
q->curr = NULL;

0 commit comments

Comments
 (0)