@@ -493,7 +493,6 @@ void cal_ctx_unprepare(struct cal_ctx *ctx)
void cal_ctx_start(struct cal_ctx *ctx)
{
- ctx->sequence = 0;
ctx->dma.state = CAL_DMA_RUNNING;
/* Configure the CSI-2, pixel processing and write DMA contexts. */
@@ -586,6 +585,10 @@ static inline void cal_irq_wdma_start(struct cal_ctx *ctx)
static inline void cal_irq_wdma_end(struct cal_ctx *ctx)
{
struct cal_buffer *buf = NULL;
+ u32 frame_num;
+
+ frame_num = cal_read(ctx->cal, CAL_CSI2_STATUS(ctx->phy->instance,
+ ctx->csi2_ctx)) & 0xffff;
spin_lock(&ctx->dma.lock);
@@ -607,7 +610,7 @@ static inline void cal_irq_wdma_end(struct cal_ctx *ctx)
if (buf) {
buf->vb.vb2_buf.timestamp = ktime_get_ns();
buf->vb.field = ctx->v_fmt.fmt.pix.field;
- buf->vb.sequence = ctx->sequence++;
+ buf->vb.sequence = frame_num;
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
}
}
@@ -217,7 +217,6 @@ struct cal_ctx {
const struct cal_format_info **active_fmt;
unsigned int num_active_fmt;
- unsigned int sequence;
struct vb2_queue vb_vidq;
u8 dma_ctx;
u8 cport;
The driver fills buf->vb.sequence with an increasing number which is incremented by the driver. This feels a bit pointless, as the userspace could as well track that kind of number itself. Instead, lets use the frame number provided in the CSI-2 data from the sensor. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> --- drivers/media/platform/ti-vpe/cal.c | 7 +++++-- drivers/media/platform/ti-vpe/cal.h | 1 - 2 files changed, 5 insertions(+), 3 deletions(-)