mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
[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 <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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
9057bc2b35
commit
d6dd645eae
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ done:
|
||||
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++;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -225,7 +225,7 @@ finish_buf:
|
||||
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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user