• Home
  • Raw
  • Download

Lines Matching refs:vb

64 static int __verify_planes_array(struct vb2_buffer *vb, const struct v4l2_buffer *b)  in __verify_planes_array()  argument
71 dprintk(vb->vb2_queue, 1, in __verify_planes_array()
76 if (b->length < vb->num_planes || b->length > VB2_MAX_PLANES) { in __verify_planes_array()
77 dprintk(vb->vb2_queue, 1, in __verify_planes_array()
79 vb->num_planes, b->length); in __verify_planes_array()
86 static int __verify_planes_array_core(struct vb2_buffer *vb, const void *pb) in __verify_planes_array_core() argument
88 return __verify_planes_array(vb, pb); in __verify_planes_array_core()
95 static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b) in __verify_length() argument
105 for (plane = 0; plane < vb->num_planes; ++plane) { in __verify_length()
109 : vb->planes[plane].length; in __verify_length()
122 ? b->length : vb->planes[0].length; in __verify_length()
134 static void __init_vb2_v4l2_buffer(struct vb2_buffer *vb) in __init_vb2_v4l2_buffer() argument
136 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); in __init_vb2_v4l2_buffer()
141 static void __copy_timestamp(struct vb2_buffer *vb, const void *pb) in __copy_timestamp() argument
144 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); in __copy_timestamp()
145 struct vb2_queue *q = vb->vb2_queue; in __copy_timestamp()
153 vb->timestamp = v4l2_buffer_get_timestamp(b); in __copy_timestamp()
160 static void vb2_warn_zero_bytesused(struct vb2_buffer *vb) in vb2_warn_zero_bytesused() argument
170 if (vb->vb2_queue->allow_zero_bytesused) in vb2_warn_zero_bytesused()
176 static int vb2_fill_vb2_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b) in vb2_fill_vb2_v4l2_buffer() argument
178 struct vb2_queue *q = vb->vb2_queue; in vb2_fill_vb2_v4l2_buffer()
179 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); in vb2_fill_vb2_v4l2_buffer()
184 ret = __verify_length(vb, b); in vb2_fill_vb2_v4l2_buffer()
209 for (plane = 0; plane < vb->num_planes; ++plane) { in vb2_fill_vb2_v4l2_buffer()
217 for (plane = 0; plane < vb->num_planes; ++plane) { in vb2_fill_vb2_v4l2_buffer()
225 for (plane = 0; plane < vb->num_planes; ++plane) { in vb2_fill_vb2_v4l2_buffer()
227 vb->planes[plane].m.offset; in vb2_fill_vb2_v4l2_buffer()
229 vb->planes[plane].length; in vb2_fill_vb2_v4l2_buffer()
252 for (plane = 0; plane < vb->num_planes; ++plane) { in vb2_fill_vb2_v4l2_buffer()
257 vb2_warn_zero_bytesused(vb); in vb2_fill_vb2_v4l2_buffer()
259 if (vb->vb2_queue->allow_zero_bytesused) in vb2_fill_vb2_v4l2_buffer()
292 planes[0].m.offset = vb->planes[0].m.offset; in vb2_fill_vb2_v4l2_buffer()
293 planes[0].length = vb->planes[0].length; in vb2_fill_vb2_v4l2_buffer()
300 vb2_warn_zero_bytesused(vb); in vb2_fill_vb2_v4l2_buffer()
302 if (vb->vb2_queue->allow_zero_bytesused) in vb2_fill_vb2_v4l2_buffer()
314 if (!vb->vb2_queue->copy_timestamp || V4L2_TYPE_IS_CAPTURE(b->type)) { in vb2_fill_vb2_v4l2_buffer()
345 struct vb2_buffer *vb, in set_buffer_cache_hints() argument
360 vb->skip_cache_sync_on_finish = 1; in set_buffer_cache_hints()
363 vb->skip_cache_sync_on_prepare = 1; in set_buffer_cache_hints()
373 struct vb2_buffer *vb; in vb2_queue_or_prepare_buf() local
397 vb = q->bufs[b->index]; in vb2_queue_or_prepare_buf()
398 vbuf = to_vb2_v4l2_buffer(vb); in vb2_queue_or_prepare_buf()
399 ret = __verify_planes_array(vb, b); in vb2_queue_or_prepare_buf()
404 vb->state != VB2_BUF_STATE_DEQUEUED) { in vb2_queue_or_prepare_buf()
409 if (!vb->prepared) { in vb2_queue_or_prepare_buf()
410 set_buffer_cache_hints(q, vb, b); in vb2_queue_or_prepare_buf()
413 sizeof(vbuf->planes[0]) * vb->num_planes); in vb2_queue_or_prepare_buf()
414 ret = vb2_fill_vb2_v4l2_buffer(vb, b); in vb2_queue_or_prepare_buf()
492 static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) in __fill_v4l2_buffer() argument
495 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); in __fill_v4l2_buffer()
496 struct vb2_queue *q = vb->vb2_queue; in __fill_v4l2_buffer()
500 b->index = vb->index; in __fill_v4l2_buffer()
501 b->type = vb->type; in __fill_v4l2_buffer()
502 b->memory = vb->memory; in __fill_v4l2_buffer()
507 v4l2_buffer_set_timestamp(b, vb->timestamp); in __fill_v4l2_buffer()
518 b->length = vb->num_planes; in __fill_v4l2_buffer()
519 for (plane = 0; plane < vb->num_planes; ++plane) { in __fill_v4l2_buffer()
521 struct vb2_plane *psrc = &vb->planes[plane]; in __fill_v4l2_buffer()
539 b->length = vb->planes[0].length; in __fill_v4l2_buffer()
540 b->bytesused = vb->planes[0].bytesused; in __fill_v4l2_buffer()
542 b->m.offset = vb->planes[0].m.offset; in __fill_v4l2_buffer()
544 b->m.userptr = vb->planes[0].m.userptr; in __fill_v4l2_buffer()
546 b->m.fd = vb->planes[0].m.fd; in __fill_v4l2_buffer()
563 switch (vb->state) { in __fill_v4l2_buffer()
583 if ((vb->state == VB2_BUF_STATE_DEQUEUED || in __fill_v4l2_buffer()
584 vb->state == VB2_BUF_STATE_IN_REQUEST) && in __fill_v4l2_buffer()
585 vb->synced && vb->prepared) in __fill_v4l2_buffer()
588 if (vb2_buffer_in_use(q, vb)) in __fill_v4l2_buffer()
601 static int __fill_vb2_buffer(struct vb2_buffer *vb, struct vb2_plane *planes) in __fill_vb2_buffer() argument
603 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); in __fill_vb2_buffer()
606 if (!vb->vb2_queue->copy_timestamp) in __fill_vb2_buffer()
607 vb->timestamp = 0; in __fill_vb2_buffer()
609 for (plane = 0; plane < vb->num_planes; ++plane) { in __fill_vb2_buffer()
610 if (vb->vb2_queue->memory != VB2_MEMORY_MMAP) { in __fill_vb2_buffer()
655 struct vb2_buffer *vb; in vb2_querybuf() local
667 vb = q->bufs[b->index]; in vb2_querybuf()
668 ret = __verify_planes_array(vb, b); in vb2_querybuf()