+
+ return 0;
+}
+
+static int gen_frame(void)
+{
+ struct buffer *buf = 0;
+
+ spin_lock(&blist_lock);
+ if(buflist) {
+ buf = buflist;
+ buflist = buflist->next;
+ if(!buflist) buflist_tail = 0;
+ }
+ spin_unlock(&blist_lock);
+
+ if(buf) {
+ mutex_lock(&mutex);
+ memcpy(vb2_plane_vaddr(&buf->vb.vb2_buf, 0), frame, frame_size);
+
+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
+ printk(KERN_INFO "vdummy: copying frame: %d ts: %lu\n", seqno,
+ (unsigned long)buf->vb.vb2_buf.timestamp);
+ buf->vb.sequence = seqno++;
+ buf->vb.field = V4L2_FIELD_NONE;
+ vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
+ vb2_set_plane_payload(&buf->vb.vb2_buf, 0, frame_size);
+ mutex_unlock(&mutex);
+ }