Skip to content

Commit

Permalink
[media] media: videobuf2: Move timestamp to vb2_buffer
Browse files Browse the repository at this point in the history
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 <jh1009.sung@samsung.com>
Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Junghak Sung authored and Mauro Carvalho Chehab committed Dec 18, 2015
1 parent 9057bc2 commit d6dd645
Show file tree
Hide file tree
Showing 71 changed files with 108 additions and 106 deletions.
2 changes: 1 addition & 1 deletion drivers/input/touchscreen/sur40.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ static void sur40_process_video(struct sur40_state *sur40)
goto err_poll;

/* mark as finished */
v4l2_get_timestamp(&new_buf->vb.timestamp);
new_buf->vb.vb2_buf.timestamp = ktime_get_ns();
new_buf->vb.sequence = sur40->sequence++;
new_buf->vb.field = V4L2_FIELD_NONE;
vb2_buffer_done(&new_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb-frontends/rtl2832_sdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static void rtl2832_sdr_urb_complete(struct urb *urb)
len = rtl2832_sdr_convert_stream(dev, ptr, urb->transfer_buffer,
urb->actual_length);
vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0, len);
v4l2_get_timestamp(&fbuf->vb.timestamp);
fbuf->vb.vb2_buf.timestamp = ktime_get_ns();
fbuf->vb.sequence = dev->sequence++;
vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cobalt/cobalt-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void cobalt_dma_stream_queue_handler(struct cobalt_stream *s)
skip = true;
s->skip_first_frames--;
}
v4l2_get_timestamp(&cb->vb.timestamp);
cb->vb.vb2_buf.timestamp = ktime_get_ns();
/* TODO: the sequence number should be read from the FPGA so we
also know about dropped frames. */
cb->vb.sequence = s->sequence++;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx23885/cx23885-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static void cx23885_wakeup(struct cx23885_tsport *port,
buf = list_entry(q->active.next,
struct cx23885_buffer, queue);

v4l2_get_timestamp(&buf->vb.timestamp);
buf->vb.vb2_buf.timestamp = ktime_get_ns();
buf->vb.sequence = q->count++;
dprintk(1, "[%p/%d] wakeup reg=%d buf=%d\n", buf,
buf->vb.vb2_buf.index,
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx23885/cx23885-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void cx23885_video_wakeup(struct cx23885_dev *dev,
struct cx23885_buffer, queue);

buf->vb.sequence = q->count++;
v4l2_get_timestamp(&buf->vb.timestamp);
buf->vb.vb2_buf.timestamp = ktime_get_ns();
dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf,
buf->vb.vb2_buf.index, count, q->count);
list_del(&buf->queue);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx25821/cx25821-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status)
buf = list_entry(dmaq->active.next,
struct cx25821_buffer, queue);

v4l2_get_timestamp(&buf->vb.timestamp);
buf->vb.vb2_buf.timestamp = ktime_get_ns();
buf->vb.sequence = dmaq->count++;
list_del(&buf->queue);
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx88/cx88-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ void cx88_wakeup(struct cx88_core *core,

buf = list_entry(q->active.next,
struct cx88_buffer, list);
v4l2_get_timestamp(&buf->vb.timestamp);
buf->vb.vb2_buf.timestamp = ktime_get_ns();
buf->vb.field = core->field;
buf->vb.sequence = q->count++;
list_del(&buf->list);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/dt3155/dt3155.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ static irqreturn_t dt3155_irq_handler_even(int irq, void *dev_id)

spin_lock(&ipd->lock);
if (ipd->curr_buf && !list_empty(&ipd->dmaq)) {
v4l2_get_timestamp(&ipd->curr_buf->timestamp);
ipd->curr_buf->vb2_buf.timestamp = ktime_get_ns();
ipd->curr_buf->sequence = ipd->sequence++;
ipd->curr_buf->field = V4L2_FIELD_NONE;
vb2_buffer_done(&ipd->curr_buf->vb2_buf, VB2_BUF_STATE_DONE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/netup_unidvb/netup_unidvb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ static void netup_unidvb_dma_worker(struct work_struct *work)
dev_dbg(&ndev->pci_dev->dev,
"%s(): buffer %p done, size %d\n",
__func__, buf, buf->size);
v4l2_get_timestamp(&buf->vb.timestamp);
buf->vb.vb2_buf.timestamp = ktime_get_ns();
vb2_set_plane_payload(&buf->vb.vb2_buf, 0, buf->size);
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/saa7134/saa7134-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void saa7134_buffer_finish(struct saa7134_dev *dev,
core_dbg("buffer_finish %p\n", q->curr);

/* finish current buffer */
v4l2_get_timestamp(&q->curr->vb2.timestamp);
q->curr->vb2.vb2_buf.timestamp = ktime_get_ns();
q->curr->vb2.sequence = q->seq_nr++;
vb2_buffer_done(&q->curr->vb2.vb2_buf, state);
q->curr = NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ static int solo_enc_fillbuf(struct solo_enc_dev *solo_enc,

if (!ret) {
vbuf->sequence = solo_enc->sequence++;
v4l2_get_timestamp(&vbuf->timestamp);
vb->timestamp = ktime_get_ns();

/* Check for motion flags */
if (solo_is_motion_on(solo_enc) && enc_buf->motion) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/solo6x10/solo6x10-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static void solo_fillbuf(struct solo_dev *solo_dev,
vb2_set_plane_payload(vb, 0,
solo_vlines(solo_dev) * solo_bytesperline(solo_dev));
vbuf->sequence = solo_dev->sequence++;
v4l2_get_timestamp(&vbuf->timestamp);
vb->timestamp = ktime_get_ns();
}

vb2_buffer_done(vb, error ? VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/sta2x11/sta2x11_vip.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ static irqreturn_t vip_irq(int irq, struct sta2x11_vip *vip)
/* Disable acquisition */
reg_write(vip, DVP_CTL, reg_read(vip, DVP_CTL) & ~DVP_CTL_ENA);
/* Remove the active buffer from the list */
v4l2_get_timestamp(&vip->active->vb.timestamp);
vip->active->vb.vb2_buf.timestamp = ktime_get_ns();
vip->active->vb.sequence = vip->sequence++;
vb2_buffer_done(&vip->active->vb.vb2_buf, VB2_BUF_STATE_DONE);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/tw68/tw68-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ void tw68_irq_video_done(struct tw68_dev *dev, unsigned long status)
buf = list_entry(dev->active.next, struct tw68_buf, list);
list_del(&buf->list);
spin_unlock(&dev->slock);
v4l2_get_timestamp(&buf->vb.timestamp);
buf->vb.vb2_buf.timestamp = ktime_get_ns();
buf->vb.field = dev->field;
buf->vb.sequence = dev->seqnr++;
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/am437x/am437x-vpfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ static inline void vpfe_schedule_bottom_field(struct vpfe_device *vpfe)
*/
static inline void vpfe_process_buffer_complete(struct vpfe_device *vpfe)
{
v4l2_get_timestamp(&vpfe->cur_frm->vb.timestamp);
vpfe->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
vpfe->cur_frm->vb.field = vpfe->fmt.fmt.pix.field;
vpfe->cur_frm->vb.sequence = vpfe->sequence++;
vb2_buffer_done(&vpfe->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/blackfin/bfin_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ static irqreturn_t bcap_isr(int irq, void *dev_id)
spin_lock(&bcap_dev->lock);

if (!list_empty(&bcap_dev->dma_queue)) {
v4l2_get_timestamp(&vbuf->timestamp);
vb->timestamp = ktime_get_ns();
if (ppi->err) {
vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
ppi->err = false;
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/platform/coda/coda-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void coda_fill_bitstream(struct coda_ctx *ctx, bool streaming)
if (meta) {
meta->sequence = src_buf->sequence;
meta->timecode = src_buf->timecode;
meta->timestamp = src_buf->timestamp;
meta->timestamp = src_buf->vb2_buf.timestamp;
meta->start = start;
meta->end = ctx->bitstream_fifo.kfifo.in &
ctx->bitstream_fifo.kfifo.mask;
Expand Down Expand Up @@ -1364,7 +1364,7 @@ static void coda_finish_encode(struct coda_ctx *ctx)
dst_buf->flags &= ~V4L2_BUF_FLAG_KEYFRAME;
}

dst_buf->timestamp = src_buf->timestamp;
dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
dst_buf->flags |=
src_buf->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
Expand Down Expand Up @@ -2040,7 +2040,7 @@ static void coda_finish_decode(struct coda_ctx *ctx)
dst_buf->flags |= ctx->frame_types[ctx->display_idx];
meta = &ctx->frame_metas[ctx->display_idx];
dst_buf->timecode = meta->timecode;
dst_buf->timestamp = meta->timestamp;
dst_buf->vb2_buf.timestamp = meta->timestamp;

trace_coda_dec_rot_done(ctx, dst_buf, meta);

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/coda/coda.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct coda_buffer_meta {
struct list_head list;
u32 sequence;
struct v4l2_timecode timecode;
struct timeval timestamp;
u64 timestamp;
u32 start;
u32 end;
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/davinci/vpbe_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void vpbe_isr_even_field(struct vpbe_display *disp_obj,
if (layer->cur_frm == layer->next_frm)
return;

v4l2_get_timestamp(&layer->cur_frm->vb.timestamp);
layer->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
vb2_buffer_done(&layer->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
/* Make cur_frm pointing to next_frm */
layer->cur_frm = layer->next_frm;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/davinci/vpif_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static struct vb2_ops video_qops = {
*/
static void vpif_process_buffer_complete(struct common_obj *common)
{
v4l2_get_timestamp(&common->cur_frm->vb.timestamp);
common->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
vb2_buffer_done(&common->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
/* Make curFrm pointing to nextFrm */
common->cur_frm = common->next_frm;
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/platform/davinci/vpif_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static void process_interlaced_mode(int fid, struct common_obj *common)
/* one frame is displayed If next frame is
* available, release cur_frm and move on */
/* Copy frame display time */
v4l2_get_timestamp(&common->cur_frm->vb.timestamp);
common->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
/* Change status of the cur_frm */
vb2_buffer_done(&common->cur_frm->vb.vb2_buf,
VB2_BUF_STATE_DONE);
Expand Down Expand Up @@ -387,8 +387,8 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
if (!channel_first_int[i][channel_id]) {
/* Mark status of the cur_frm to
* done and unlock semaphore on it */
v4l2_get_timestamp(
&common->cur_frm->vb.timestamp);
common->cur_frm->vb.vb2_buf.timestamp =
ktime_get_ns();
vb2_buffer_done(&common->cur_frm->vb.vb2_buf,
VB2_BUF_STATE_DONE);
/* Make cur_frm pointing to next_frm */
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/platform/exynos-gsc/gsc-m2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void gsc_m2m_job_finish(struct gsc_ctx *ctx, int vb_state)
dst_vb = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx);

if (src_vb && dst_vb) {
dst_vb->timestamp = src_vb->timestamp;
dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
dst_vb->timecode = src_vb->timecode;
dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
dst_vb->flags |=
Expand Down Expand Up @@ -125,7 +125,7 @@ static int gsc_get_bufs(struct gsc_ctx *ctx)
if (ret)
return ret;

dst_vb->timestamp = src_vb->timestamp;
dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/exynos4-is/fimc-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void fimc_capture_irq_handler(struct fimc_dev *fimc, int deq_buf)
test_bit(ST_CAPT_RUN, &fimc->state) && deq_buf) {
v_buf = fimc_active_queue_pop(cap);

v4l2_get_timestamp(&v_buf->vb.timestamp);
v_buf->vb.vb2_buf.timestamp = ktime_get_ns();
v_buf->vb.sequence = cap->frame_count++;

vb2_buffer_done(&v_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/exynos4-is/fimc-isp-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void fimc_isp_video_irq_handler(struct fimc_is *is)
buf_index = (is->i2h_cmd.args[1] - 1) % video->buf_count;
vbuf = &video->buffers[buf_index]->vb;

v4l2_get_timestamp(&vbuf->timestamp);
vbuf->vb2_buf.timestamp = ktime_get_ns();
vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);

video->buf_mask &= ~BIT(buf_index);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/exynos4-is/fimc-lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ static irqreturn_t flite_irq_handler(int irq, void *priv)
test_bit(ST_FLITE_RUN, &fimc->state) &&
!list_empty(&fimc->active_buf_q)) {
vbuf = fimc_lite_active_queue_pop(fimc);
v4l2_get_timestamp(&vbuf->vb.timestamp);
vbuf->vb.vb2_buf.timestamp = ktime_get_ns();
vbuf->vb.sequence = fimc->frame_count++;
flite_hw_mask_dma_buffer(fimc, vbuf->index);
vb2_buffer_done(&vbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/exynos4-is/fimc-m2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static void fimc_device_run(void *priv)
if (ret)
goto dma_unlock;

dst_vb->timestamp = src_vb->timestamp;
dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
dst_vb->flags |=
src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/m2m-deinterlace.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static void dma_callback(void *data)
src_vb = v4l2_m2m_src_buf_remove(curr_ctx->m2m_ctx);
dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->m2m_ctx);

dst_vb->timestamp = src_vb->timestamp;
dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
dst_vb->flags |=
src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/marvell-ccic/mcam-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static void mcam_buffer_done(struct mcam_camera *cam, int frame,
vbuf->vb2_buf.planes[0].bytesused = cam->pix_format.sizeimage;
vbuf->sequence = cam->buf_seq[frame];
vbuf->field = V4L2_FIELD_NONE;
v4l2_get_timestamp(&vbuf->timestamp);
vbuf->vb2_buf.timestamp = ktime_get_ns();
vb2_set_plane_payload(&vbuf->vb2_buf, 0, cam->pix_format.sizeimage);
vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/mx2_emmaprp.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ static irqreturn_t emmaprp_irq(int irq_emma, void *data)
src_vb = v4l2_m2m_src_buf_remove(curr_ctx->m2m_ctx);
dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->m2m_ctx);

dst_vb->timestamp = src_vb->timestamp;
dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
dst_vb->flags &=
~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
dst_vb->flags |=
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/omap3isp/ispvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ struct isp_buffer *omap3isp_video_buffer_next(struct isp_video *video)
list_del(&buf->irqlist);
spin_unlock_irqrestore(&video->irqlock, flags);

v4l2_get_timestamp(&buf->vb.timestamp);
buf->vb.vb2_buf.timestamp = ktime_get_ns();

/* Do frame number propagation only if this is the output video node.
* Frame number either comes from the CSI receivers or it gets
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/rcar_jpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ static irqreturn_t jpu_irq_handler(int irq, void *dev_id)
}

dst_buf->field = src_buf->field;
dst_buf->timestamp = src_buf->timestamp;
dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
if (src_buf->flags & V4L2_BUF_FLAG_TIMECODE)
dst_buf->timecode = src_buf->timecode;
dst_buf->flags = src_buf->flags &
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/s3c-camif/camif-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ irqreturn_t s3c_camif_irq_handler(int irq, void *priv)

if (!WARN_ON(vbuf == NULL)) {
/* Dequeue a filled buffer */
v4l2_get_timestamp(&vbuf->vb.timestamp);
vbuf->vb.vb2_buf.timestamp = ktime_get_ns();
vbuf->vb.sequence = vp->frame_sequence++;
vb2_buffer_done(&vbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/s5p-g2d/g2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ static irqreturn_t g2d_isr(int irq, void *prv)
BUG_ON(dst == NULL);

dst->timecode = src->timecode;
dst->timestamp = src->timestamp;
dst->vb2_buf.timestamp = src->vb2_buf.timestamp;
dst->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
dst->flags |=
src->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/platform/s5p-jpeg/jpeg-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2620,7 +2620,7 @@ static irqreturn_t s5p_jpeg_irq(int irq, void *dev_id)
}

dst_buf->timecode = src_buf->timecode;
dst_buf->timestamp = src_buf->timestamp;
dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
dst_buf->flags |=
src_buf->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
Expand Down Expand Up @@ -2751,7 +2751,7 @@ static irqreturn_t exynos3250_jpeg_irq(int irq, void *dev_id)
dst_buf = v4l2_m2m_dst_buf_remove(curr_ctx->fh.m2m_ctx);

dst_buf->timecode = src_buf->timecode;
dst_buf->timestamp = src_buf->timestamp;
dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;

v4l2_m2m_buf_done(src_buf, state);
if (curr_ctx->mode == S5P_JPEG_ENCODE)
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/platform/s5p-mfc/s5p_mfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ static void s5p_mfc_handle_frame_copy_time(struct s5p_mfc_ctx *ctx)
== dec_y_addr) {
dst_buf->b->timecode =
src_buf->b->timecode;
dst_buf->b->timestamp =
src_buf->b->timestamp;
dst_buf->b->vb2_buf.timestamp =
src_buf->b->vb2_buf.timestamp;
dst_buf->b->flags &=
~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
dst_buf->b->flags |=
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/sh_veu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ static irqreturn_t sh_veu_isr(int irq, void *dev_id)
if (!src || !dst)
return IRQ_NONE;

dst->timestamp = src->timestamp;
dst->vb2_buf.timestamp = src->vb2_buf.timestamp;
dst->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
dst->flags |=
src->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/sh_vou.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ static irqreturn_t sh_vou_isr(int irq, void *dev_id)

list_del(&vb->list);

v4l2_get_timestamp(&vb->vb.timestamp);
vb->vb.vb2_buf.timestamp = ktime_get_ns();
vb->vb.sequence = vou_dev->sequence++;
vb->vb.field = V4L2_FIELD_INTERLACED;
vb2_buffer_done(&vb->vb.vb2_buf, VB2_BUF_STATE_DONE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/soc_camera/atmel-isi.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static irqreturn_t atmel_isi_handle_streaming(struct atmel_isi *isi)
struct frame_buffer *buf = isi->active;

list_del_init(&buf->list);
v4l2_get_timestamp(&vbuf->timestamp);
vbuf->vb2_buf.timestamp = ktime_get_ns();
vbuf->sequence = isi->sequence++;
vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/soc_camera/mx2_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev,
vb2_get_plane_payload(vb, 0));

list_del_init(&buf->internal.queue);
v4l2_get_timestamp(&vbuf->timestamp);
vb->timestamp = ktime_get_ns();
vbuf->sequence = pcdev->frame_count;
if (err)
vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
Expand Down
Loading

0 comments on commit d6dd645

Please sign in to comment.