|
@@ -99,7 +99,7 @@ static int stop_streaming(struct vb2_queue *q)
|
|
|
|
|
|
static void fimc_device_run(void *priv)
|
|
|
{
|
|
|
- struct vb2_buffer *vb = NULL;
|
|
|
+ struct vb2_buffer *src_vb, *dst_vb;
|
|
|
struct fimc_ctx *ctx = priv;
|
|
|
struct fimc_frame *sf, *df;
|
|
|
struct fimc_dev *fimc;
|
|
@@ -122,16 +122,18 @@ static void fimc_device_run(void *priv)
|
|
|
fimc_prepare_dma_offset(ctx, df);
|
|
|
}
|
|
|
|
|
|
- vb = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
|
|
|
- ret = fimc_prepare_addr(ctx, vb, sf, &sf->paddr);
|
|
|
+ src_vb = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
|
|
|
+ ret = fimc_prepare_addr(ctx, src_vb, sf, &sf->paddr);
|
|
|
if (ret)
|
|
|
goto dma_unlock;
|
|
|
|
|
|
- vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
|
|
|
- ret = fimc_prepare_addr(ctx, vb, df, &df->paddr);
|
|
|
+ dst_vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
|
|
|
+ ret = fimc_prepare_addr(ctx, dst_vb, df, &df->paddr);
|
|
|
if (ret)
|
|
|
goto dma_unlock;
|
|
|
|
|
|
+ dst_vb->v4l2_buf.timestamp = src_vb->v4l2_buf.timestamp;
|
|
|
+
|
|
|
/* Reconfigure hardware if the context has changed. */
|
|
|
if (fimc->m2m.ctx != ctx) {
|
|
|
ctx->state |= FIMC_PARAMS;
|
|
@@ -620,6 +622,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
|
|
|
src_vq->ops = &fimc_qops;
|
|
|
src_vq->mem_ops = &vb2_dma_contig_memops;
|
|
|
src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer);
|
|
|
+ src_vq->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_COPY;
|
|
|
|
|
|
ret = vb2_queue_init(src_vq);
|
|
|
if (ret)
|
|
@@ -631,6 +634,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
|
|
|
dst_vq->ops = &fimc_qops;
|
|
|
dst_vq->mem_ops = &vb2_dma_contig_memops;
|
|
|
dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer);
|
|
|
+ dst_vq->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_COPY;
|
|
|
|
|
|
return vb2_queue_init(dst_vq);
|
|
|
}
|