Lines Matching refs:vb
379 static inline void store_byte(struct go7007_buffer *vb, u8 byte)
381 if (vb && vb->vb.vb2_buf.planes[0].bytesused < GO7007_BUF_SIZE) {
382 u8 *ptr = vb2_plane_vaddr(&vb->vb.vb2_buf, 0);
384 ptr[vb->vb.vb2_buf.planes[0].bytesused++] = byte;
388 static void go7007_set_motion_regions(struct go7007 *go, struct go7007_buffer *vb,
396 .frame_sequence = vb->vb.sequence,
410 static void go7007_motion_regions(struct go7007 *go, struct go7007_buffer *vb)
412 u32 *bytesused = &vb->vb.vb2_buf.planes[0].bytesused;
420 store_byte(vb, go->active_map[i]);
433 go7007_set_motion_regions(go, vb, motion_regions);
439 static struct go7007_buffer *frame_boundary(struct go7007 *go, struct go7007_buffer *vb)
445 if (vb == NULL) {
448 vb = go->active_buf =
452 return vb;
454 bytesused = &vb->vb.vb2_buf.planes[0].bytesused;
456 vb->vb.sequence = go->next_seq++;
457 if (vb->modet_active && *bytesused + 216 < GO7007_BUF_SIZE)
458 go7007_motion_regions(go, vb);
460 go7007_set_motion_regions(go, vb, 0);
462 vb->vb.vb2_buf.timestamp = ktime_get_ns();
463 vb_tmp = vb;
465 list_del(&vb->list);
467 vb = NULL;
469 vb = list_first_entry(&go->vidq_active,
471 go->active_buf = vb;
473 vb2_buffer_done(&vb_tmp->vb.vb2_buf, VB2_BUF_STATE_DONE);
474 return vb;
498 struct go7007_buffer *vb = go->active_buf;
516 if (vb && vb->vb.vb2_buf.planes[0].bytesused >=
519 vb->vb.vb2_buf.planes[0].bytesused = 0;
520 vb->frame_offset = 0;
521 vb->modet_active = 0;
522 vb = go->active_buf = NULL;
535 store_byte(vb, buf[i]);
545 store_byte(vb, 0x00);
549 store_byte(vb, 0x00);
550 store_byte(vb, buf[i]);
558 store_byte(vb, 0x00);
565 store_byte(vb, 0x00);
566 store_byte(vb, 0x00);
570 store_byte(vb, 0x00);
571 store_byte(vb, 0x00);
572 store_byte(vb, buf[i]);
580 store_byte(vb, 0x00);
581 store_byte(vb, 0x00);
582 store_byte(vb, 0x01);
583 store_byte(vb, 0xF8);
595 if (vb == NULL || go->seen_frame)
596 vb = frame_boundary(go, vb);
598 if (vb && go->seen_frame)
599 vb->frame_offset =
600 vb->vb.vb2_buf.planes[0].bytesused;
619 store_byte(vb, 0x00);
620 store_byte(vb, 0x00);
621 store_byte(vb, 0x01);
625 store_byte(vb, 0x00);
626 store_byte(vb, 0x00);
627 store_byte(vb, 0x01);
628 store_byte(vb, buf[i]);
636 store_byte(vb, 0xFF);
640 store_byte(vb, 0xFF);
645 vb = frame_boundary(go, vb);
648 store_byte(vb, 0xFF);
649 store_byte(vb, buf[i]);
672 } else if (go->parse_length == 207 && vb) {
673 vb->modet_active = buf[i];