Lines Matching full:planes
231 * Allocate memory for all planes in this buffer in __vb2_buf_mem_alloc()
236 unsigned long size = PAGE_ALIGN(vb->planes[plane].length); in __vb2_buf_mem_alloc()
239 if (size < vb->planes[plane].length) in __vb2_buf_mem_alloc()
253 vb->planes[plane].mem_priv = mem_priv; in __vb2_buf_mem_alloc()
260 call_void_memop(vb, put, vb->planes[plane - 1].mem_priv); in __vb2_buf_mem_alloc()
261 vb->planes[plane - 1].mem_priv = NULL; in __vb2_buf_mem_alloc()
275 call_void_memop(vb, put, vb->planes[plane].mem_priv); in __vb2_buf_mem_free()
276 vb->planes[plane].mem_priv = NULL; in __vb2_buf_mem_free()
291 if (vb->planes[plane].mem_priv) in __vb2_buf_userptr_put()
292 call_void_memop(vb, put_userptr, vb->planes[plane].mem_priv); in __vb2_buf_userptr_put()
293 vb->planes[plane].mem_priv = NULL; in __vb2_buf_userptr_put()
333 * When multiple planes share the same DMA buffer attachment, the plane in __vb2_buf_dmabuf_put()
335 * Put planes in the reversed order so that we don't leave invalid in __vb2_buf_dmabuf_put()
339 __vb2_plane_dmabuf_put(vb, &vb->planes[plane]); in __vb2_buf_dmabuf_put()
355 call_void_memop(vb, prepare, vb->planes[plane].mem_priv); in __vb2_buf_mem_prepare()
371 call_void_memop(vb, finish, vb->planes[plane].mem_priv); in __vb2_buf_mem_finish()
386 * - a buffer can have up to 8 planes. in __setup_offsets()
401 vb->planes[plane].m.offset = offset + (plane << PAGE_SHIFT); in __setup_offsets()
458 * video buffer memory for all buffers/planes on the queue and initializes the
514 vb->planes[plane].length = plane_sizes[plane]; in __vb2_queue_alloc()
515 vb->planes[plane].min_length = plane_sizes[plane]; in __vb2_queue_alloc()
594 if (vb && vb->planes[0].mem_priv) in __vb2_queue_free()
704 void *mem_priv = vb->planes[plane].mem_priv; in vb2_buffer_in_use()
942 * Ask the driver how many buffers and planes per buffer it requires. in vb2_core_reqbufs()
1091 * Ask the driver, whether the requested number of buffers, planes per in vb2_core_create_bufs()
1165 if (plane_no >= vb->num_planes || !vb->planes[plane_no].mem_priv) in vb2_plane_vaddr()
1168 return call_ptr_memop(vaddr, vb, vb->planes[plane_no].mem_priv); in vb2_plane_vaddr()
1175 if (plane_no >= vb->num_planes || !vb->planes[plane_no].mem_priv) in vb2_plane_cookie()
1178 return call_ptr_memop(cookie, vb, vb->planes[plane_no].mem_priv); in vb2_plane_cookie()
1258 vb, vb->planes); in __prepare_mmap()
1267 struct vb2_plane planes[VB2_MAX_PLANES]; in __prepare_userptr() local
1272 bool reacquired = vb->planes[0].mem_priv == NULL; in __prepare_userptr()
1274 memset(planes, 0, sizeof(planes[0]) * vb->num_planes); in __prepare_userptr()
1277 vb, planes); in __prepare_userptr()
1283 if (vb->planes[plane].m.userptr && in __prepare_userptr()
1284 vb->planes[plane].m.userptr == planes[plane].m.userptr in __prepare_userptr()
1285 && vb->planes[plane].length == planes[plane].length) in __prepare_userptr()
1292 if (planes[plane].length < vb->planes[plane].min_length) { in __prepare_userptr()
1294 planes[plane].length, in __prepare_userptr()
1295 vb->planes[plane].min_length, in __prepare_userptr()
1302 if (vb->planes[plane].mem_priv) { in __prepare_userptr()
1308 call_void_memop(vb, put_userptr, vb->planes[plane].mem_priv); in __prepare_userptr()
1311 vb->planes[plane].mem_priv = NULL; in __prepare_userptr()
1312 vb->planes[plane].bytesused = 0; in __prepare_userptr()
1313 vb->planes[plane].length = 0; in __prepare_userptr()
1314 vb->planes[plane].m.userptr = 0; in __prepare_userptr()
1315 vb->planes[plane].data_offset = 0; in __prepare_userptr()
1321 planes[plane].m.userptr, in __prepare_userptr()
1322 planes[plane].length); in __prepare_userptr()
1329 vb->planes[plane].mem_priv = mem_priv; in __prepare_userptr()
1337 vb->planes[plane].bytesused = planes[plane].bytesused; in __prepare_userptr()
1338 vb->planes[plane].length = planes[plane].length; in __prepare_userptr()
1339 vb->planes[plane].m.userptr = planes[plane].m.userptr; in __prepare_userptr()
1340 vb->planes[plane].data_offset = planes[plane].data_offset; in __prepare_userptr()
1345 * One or more planes changed, so we must call buf_init to do in __prepare_userptr()
1365 /* In case of errors, release planes that were already acquired */ in __prepare_userptr()
1367 if (vb->planes[plane].mem_priv) in __prepare_userptr()
1369 vb->planes[plane].mem_priv); in __prepare_userptr()
1370 vb->planes[plane].mem_priv = NULL; in __prepare_userptr()
1371 vb->planes[plane].m.userptr = 0; in __prepare_userptr()
1372 vb->planes[plane].length = 0; in __prepare_userptr()
1383 struct vb2_plane planes[VB2_MAX_PLANES]; in __prepare_dmabuf() local
1388 bool reacquired = vb->planes[0].mem_priv == NULL; in __prepare_dmabuf()
1390 memset(planes, 0, sizeof(planes[0]) * vb->num_planes); in __prepare_dmabuf()
1393 vb, planes); in __prepare_dmabuf()
1398 struct dma_buf *dbuf = dma_buf_get(planes[plane].m.fd); in __prepare_dmabuf()
1400 planes[plane].dbuf = dbuf; in __prepare_dmabuf()
1410 if (planes[plane].length == 0) in __prepare_dmabuf()
1411 planes[plane].length = dbuf->size; in __prepare_dmabuf()
1413 if (planes[plane].length < vb->planes[plane].min_length) { in __prepare_dmabuf()
1415 planes[plane].length, plane, in __prepare_dmabuf()
1416 vb->planes[plane].min_length); in __prepare_dmabuf()
1422 if (dbuf == vb->planes[plane].dbuf && in __prepare_dmabuf()
1423 vb->planes[plane].length == planes[plane].length) in __prepare_dmabuf()
1432 if (vb->planes[0].mem_priv) { in __prepare_dmabuf()
1441 * When the same dma_buf is used for multiple planes, there is no need in __prepare_dmabuf()
1445 if (planes[plane].dbuf == vb->planes[i].dbuf && in __prepare_dmabuf()
1447 vb->planes[plane].dbuf_duplicated = true; in __prepare_dmabuf()
1448 vb->planes[plane].dbuf = vb->planes[i].dbuf; in __prepare_dmabuf()
1449 vb->planes[plane].mem_priv = vb->planes[i].mem_priv; in __prepare_dmabuf()
1454 if (vb->planes[plane].dbuf_duplicated) in __prepare_dmabuf()
1461 planes[plane].dbuf, in __prepare_dmabuf()
1462 planes[plane].length); in __prepare_dmabuf()
1469 vb->planes[plane].dbuf = planes[plane].dbuf; in __prepare_dmabuf()
1470 vb->planes[plane].mem_priv = mem_priv; in __prepare_dmabuf()
1477 ret = call_memop(vb, map_dmabuf, vb->planes[plane].mem_priv); in __prepare_dmabuf()
1483 vb->planes[plane].dbuf_mapped = 1; in __prepare_dmabuf()
1487 dma_buf_put(planes[plane].dbuf); in __prepare_dmabuf()
1495 vb->planes[plane].bytesused = planes[plane].bytesused; in __prepare_dmabuf()
1496 vb->planes[plane].length = planes[plane].length; in __prepare_dmabuf()
1497 vb->planes[plane].m.fd = planes[plane].m.fd; in __prepare_dmabuf()
1498 vb->planes[plane].data_offset = planes[plane].data_offset; in __prepare_dmabuf()
1524 if (!IS_ERR_OR_NULL(planes[plane].dbuf)) in __prepare_dmabuf()
1525 dma_buf_put(planes[plane].dbuf); in __prepare_dmabuf()
1528 /* In case of errors, release planes that were already acquired */ in __prepare_dmabuf()
2096 * Only remove the buffer from done_list if all planes can be in __vb2_get_done_vb()
2471 vb_plane = &vb->planes[plane]; in vb2_core_expbuf()
2541 length = PAGE_ALIGN(vb->planes[plane].length); in vb2_mmap()
2556 ret = call_memop(vb, mmap, vb->planes[plane].mem_priv, vma); in vb2_mmap()
3079 b->planes[0].data_offset < buf->size) { in __vb2_perform_fileio()
3080 buf->pos = b->planes[0].data_offset; in __vb2_perform_fileio()
3133 b->planes[0].bytesused = buf->pos; in __vb2_perform_fileio()