/* subdevice async Notifier */
struct v4l2_async_notifier notifier;
unsigned int sequence;
+ bool frame_started;
/* ptr to sub device */
struct v4l2_subdev *sensor;
* buffer forever.
*/
if (fe) {
+ bool inc_seq = unicam->frame_started;
+
/*
* Ensure we have swapped buffers already as we can't
* stop the peripheral. If no buffer is available, use a
unicam_process_buffer_complete(node, sequence);
node->cur_frm = node->next_frm;
node->next_frm = NULL;
+ inc_seq = true;
} else {
node->cur_frm = node->next_frm;
}
}
- unicam->sequence++;
+
+ /*
+ * Increment the sequence number conditionally on either a FS
+ * having already occurred, or in the FE + FS condition as
+ * caught in the FE handler above. This ensures the sequence
+ * number corresponds to the frames generated by the sensor, not
+ * the frames dequeued to userland.
+ */
+ if (inc_seq) {
+ unicam->sequence++;
+ unicam->frame_started = false;
+ }
}
if (ista & UNICAM_FSI) {
}
unicam_queue_event_sof(unicam);
+ unicam->frame_started = true;
}
/*
vb2_dma_contig_plane_dma_addr(&buf->vb.vb2_buf, 0);
}
+ dev->frame_started = false;
unicam_start_rx(dev, buffer_addr);
ret = v4l2_subdev_call(dev->sensor, video, s_stream, 1);