• Home
  • Raw
  • Download

Lines Matching refs:buffers

196 	fh->buffers.buffer_size = v4l_bufsize;  in map_mode_raw()
197 fh->buffers.num_buffers = v4l_nbufs; in map_mode_raw()
202 fh->buffers.buffer_size = jpg_bufsize; in map_mode_jpg()
203 fh->buffers.num_buffers = jpg_nbufs; in map_mode_jpg()
222 for (i = 0; i < fh->buffers.num_buffers; i++) { in v4l_fbuffer_alloc()
223 if (fh->buffers.buffer[i].v4l.fbuffer) in v4l_fbuffer_alloc()
230 mem = kmalloc(fh->buffers.buffer_size, in v4l_fbuffer_alloc()
240 fh->buffers.buffer[i].v4l.fbuffer = mem; in v4l_fbuffer_alloc()
241 fh->buffers.buffer[i].v4l.fbuffer_phys = virt_to_phys(mem); in v4l_fbuffer_alloc()
242 fh->buffers.buffer[i].v4l.fbuffer_bus = virt_to_bus(mem); in v4l_fbuffer_alloc()
243 for (off = 0; off < fh->buffers.buffer_size; in v4l_fbuffer_alloc()
253 fh->buffers.allocated = 1; in v4l_fbuffer_alloc()
267 for (i = 0; i < fh->buffers.num_buffers; i++) { in v4l_fbuffer_free()
268 if (!fh->buffers.buffer[i].v4l.fbuffer) in v4l_fbuffer_free()
271 mem = fh->buffers.buffer[i].v4l.fbuffer; in v4l_fbuffer_free()
272 for (off = 0; off < fh->buffers.buffer_size; in v4l_fbuffer_free()
275 kfree(fh->buffers.buffer[i].v4l.fbuffer); in v4l_fbuffer_free()
276 fh->buffers.buffer[i].v4l.fbuffer = NULL; in v4l_fbuffer_free()
279 fh->buffers.allocated = 0; in v4l_fbuffer_free()
316 for (i = 0; i < fh->buffers.num_buffers; i++) { in jpg_fbuffer_alloc()
317 if (fh->buffers.buffer[i].jpg.frag_tab) in jpg_fbuffer_alloc()
334 fh->buffers.buffer[i].jpg.frag_tab = (__le32 *)mem; in jpg_fbuffer_alloc()
335 fh->buffers.buffer[i].jpg.frag_tab_bus = virt_to_bus(mem); in jpg_fbuffer_alloc()
337 if (fh->buffers.need_contiguous) { in jpg_fbuffer_alloc()
338 mem = kmalloc(fh->buffers.buffer_size, GFP_KERNEL); in jpg_fbuffer_alloc()
347 fh->buffers.buffer[i].jpg.frag_tab[0] = in jpg_fbuffer_alloc()
349 fh->buffers.buffer[i].jpg.frag_tab[1] = in jpg_fbuffer_alloc()
350 cpu_to_le32((fh->buffers.buffer_size >> 1) | 1); in jpg_fbuffer_alloc()
351 for (off = 0; off < fh->buffers.buffer_size; off += PAGE_SIZE) in jpg_fbuffer_alloc()
355 for (j = 0; j < fh->buffers.buffer_size / PAGE_SIZE; j++) { in jpg_fbuffer_alloc()
366 fh->buffers.buffer[i].jpg.frag_tab[2 * j] = in jpg_fbuffer_alloc()
368 fh->buffers.buffer[i].jpg.frag_tab[2 * j + 1] = in jpg_fbuffer_alloc()
373 fh->buffers.buffer[i].jpg.frag_tab[2 * j - 1] |= cpu_to_le32(1); in jpg_fbuffer_alloc()
380 (fh->buffers.num_buffers * fh->buffers.buffer_size) >> 10); in jpg_fbuffer_alloc()
382 fh->buffers.allocated = 1; in jpg_fbuffer_alloc()
398 for (i = 0, buffer = &fh->buffers.buffer[0]; in jpg_fbuffer_free()
399 i < fh->buffers.num_buffers; i++, buffer++) { in jpg_fbuffer_free()
403 if (fh->buffers.need_contiguous) { in jpg_fbuffer_free()
408 for (off = 0; off < fh->buffers.buffer_size; off += PAGE_SIZE) in jpg_fbuffer_free()
415 for (j = 0; j < fh->buffers.buffer_size / PAGE_SIZE; j++) { in jpg_fbuffer_free()
431 fh->buffers.allocated = 0; in jpg_fbuffer_free()
461 if (height * width * bpp > fh->buffers.buffer_size) { in zoran_v4l_set_format()
465 ZR_DEVNAME(zr), __func__, fh->buffers.buffer_size >> 10); in zoran_v4l_set_format()
493 if (!fh->buffers.allocated) { in zoran_v4l_queue_frame()
502 if (num >= fh->buffers.num_buffers || num < 0) { in zoran_v4l_queue_frame()
512 if (fh->buffers.active == ZORAN_FREE) { in zoran_v4l_queue_frame()
514 zr->v4l_buffers = fh->buffers; in zoran_v4l_queue_frame()
515 fh->buffers.active = ZORAN_ACTIVE; in zoran_v4l_queue_frame()
531 fh->buffers.active = ZORAN_FREE; in zoran_v4l_queue_frame()
549 fh->buffers.buffer[num] = zr->v4l_buffers.buffer[num]; in zoran_v4l_queue_frame()
557 zr->v4l_buffers.active = fh->buffers.active; in zoran_v4l_queue_frame()
571 if (fh->buffers.active == ZORAN_FREE) { in v4l_sync()
580 if (frame >= fh->buffers.num_buffers || frame < 0) { in v4l_sync()
614 fh->buffers.buffer[frame] = zr->v4l_buffers.buffer[frame]; in v4l_sync()
622 fh->buffers.active = zr->v4l_buffers.active = ZORAN_FREE; in v4l_sync()
644 if (!fh->buffers.allocated) { in zoran_jpg_queue_frame()
653 if (num >= fh->buffers.num_buffers || num < 0) { in zoran_jpg_queue_frame()
673 if (fh->buffers.active == ZORAN_FREE) { in zoran_jpg_queue_frame()
675 zr->jpg_buffers = fh->buffers; in zoran_jpg_queue_frame()
676 fh->buffers.active = ZORAN_ACTIVE; in zoran_jpg_queue_frame()
705 fh->buffers.buffer[num] = zr->jpg_buffers.buffer[num]; in zoran_jpg_queue_frame()
712 fh->buffers.active = ZORAN_FREE; in zoran_jpg_queue_frame()
723 zr->jpg_buffers.active = fh->buffers.active; in zoran_jpg_queue_frame()
736 if (fh->buffers.active == ZORAN_FREE) { in jpg_qbuf()
743 fh->buffers.active = zr->jpg_buffers.active = ZORAN_FREE; in jpg_qbuf()
776 if (fh->buffers.active == ZORAN_FREE) { in jpg_sync()
831 fh->buffers.buffer[frame] = zr->jpg_buffers.buffer[frame]; in jpg_sync()
858 memset(&fh->buffers, 0, sizeof(fh->buffers)); in zoran_open_init_session()
860 fh->buffers.buffer[i].state = BUZ_STATE_USER; /* nothing going on */ in zoran_open_init_session()
861 fh->buffers.buffer[i].bs.frame = i; in zoran_open_init_session()
863 fh->buffers.allocated = 0; in zoran_open_init_session()
864 fh->buffers.active = ZORAN_FREE; in zoran_open_init_session()
882 if (fh->buffers.active != ZORAN_FREE) { in zoran_close_end_session()
888 zr->v4l_buffers.active = fh->buffers.active = ZORAN_FREE; in zoran_close_end_session()
893 if (fh->buffers.allocated) in zoran_close_end_session()
897 if (fh->buffers.active != ZORAN_FREE) { in zoran_close_end_session()
900 zr->jpg_buffers.active = fh->buffers.active = ZORAN_FREE; in zoran_close_end_session()
904 if (fh->buffers.allocated) in zoran_close_end_session()
1329 if (num < 0 || num >= fh->buffers.num_buffers || in zoran_v4l2_buffer_status()
1330 !fh->buffers.allocated) { in zoran_v4l2_buffer_status()
1343 "FAL"[fh->buffers.active], num, in zoran_v4l2_buffer_status()
1345 fh->buffers.buffer[num].map ? 'Y' : 'N'); in zoran_v4l2_buffer_status()
1349 buf->length = fh->buffers.buffer_size; in zoran_v4l2_buffer_status()
1352 buf->bytesused = fh->buffers.buffer[num].bs.length; in zoran_v4l2_buffer_status()
1353 if (fh->buffers.buffer[num].state == BUZ_STATE_DONE || in zoran_v4l2_buffer_status()
1354 fh->buffers.buffer[num].state == BUZ_STATE_USER) { in zoran_v4l2_buffer_status()
1355 buf->sequence = fh->buffers.buffer[num].bs.seq; in zoran_v4l2_buffer_status()
1357 buf->timestamp = fh->buffers.buffer[num].bs.timestamp; in zoran_v4l2_buffer_status()
1373 if (num < 0 || num >= fh->buffers.num_buffers || in zoran_v4l2_buffer_status()
1374 !fh->buffers.allocated) { in zoran_v4l2_buffer_status()
1385 buf->length = fh->buffers.buffer_size; in zoran_v4l2_buffer_status()
1388 if (fh->buffers.buffer[num].state == BUZ_STATE_DONE || in zoran_v4l2_buffer_status()
1389 fh->buffers.buffer[num].state == BUZ_STATE_USER) { in zoran_v4l2_buffer_status()
1390 buf->sequence = fh->buffers.buffer[num].bs.seq; in zoran_v4l2_buffer_status()
1391 buf->timestamp = fh->buffers.buffer[num].bs.timestamp; in zoran_v4l2_buffer_status()
1392 buf->bytesused = fh->buffers.buffer[num].bs.length; in zoran_v4l2_buffer_status()
1773 if (fh->buffers.allocated) { in zoran_s_fmt_vid_out()
1820 fh->buffers.buffer_size = zoran_v4l2_calc_bufsize(&fh->jpg_settings); in zoran_s_fmt_vid_out()
1833 fmt->fmt.pix.sizeimage = fh->buffers.buffer_size; in zoran_s_fmt_vid_out()
1858 if ((fh->map_mode != ZORAN_MAP_MODE_RAW && fh->buffers.allocated) || in zoran_s_fmt_vid_cap()
1859 fh->buffers.active != ZORAN_FREE) { in zoran_s_fmt_vid_cap()
1961 if (fh->buffers.allocated) { in zoran_reqbufs()
1980 fh->buffers.num_buffers = req->count; in zoran_reqbufs()
1996 fh->buffers.num_buffers = req->count; in zoran_reqbufs()
1997 fh->buffers.buffer_size = zoran_v4l2_calc_bufsize(&fh->jpg_settings); in zoran_reqbufs()
2043 if (!zr->v4l_memgrab_active && fh->buffers.active == ZORAN_LOCKED) in zoran_qbuf()
2069 fh->buffers.active == ZORAN_LOCKED) in zoran_qbuf()
2165 fh->buffers.active != ZORAN_ACTIVE) { in zoran_streamon()
2170 zr->v4l_buffers.active = fh->buffers.active = ZORAN_LOCKED; in zoran_streamon()
2184 fh->buffers.active != ZORAN_ACTIVE) { in zoran_streamon()
2189 zr->jpg_buffers.active = fh->buffers.active = ZORAN_LOCKED; in zoran_streamon()
2217 if (fh->buffers.active == ZORAN_FREE && in zoran_streamoff()
2232 for (i = 0; i < fh->buffers.num_buffers; i++) in zoran_streamoff()
2234 fh->buffers = zr->v4l_buffers; in zoran_streamoff()
2236 zr->v4l_buffers.active = fh->buffers.active = ZORAN_FREE; in zoran_streamoff()
2248 if (fh->buffers.active == ZORAN_FREE && in zoran_streamoff()
2430 if (fh->buffers.allocated) { in zoran_s_selection()
2487 if (fh->buffers.active != ZORAN_FREE) { in zoran_s_jpegcomp()
2498 if (!fh->buffers.allocated) in zoran_s_jpegcomp()
2499 fh->buffers.buffer_size = in zoran_s_jpegcomp()
2533 "FAL"[fh->buffers.active], zr->v4l_sync_tail, in zoran_poll()
2537 if (fh->buffers.active != ZORAN_FREE && in zoran_poll()
2555 "FAL"[fh->buffers.active], zr->jpg_que_tail, in zoran_poll()
2558 if (fh->buffers.active != ZORAN_FREE && in zoran_poll()
2611 for (i = 0; i < fh->buffers.num_buffers; i++) { in zoran_vm_close()
2612 if (fh->buffers.buffer[i].map == map) in zoran_vm_close()
2613 fh->buffers.buffer[i].map = NULL; in zoran_vm_close()
2618 for (i = 0; i < fh->buffers.num_buffers; i++) { in zoran_vm_close()
2619 if (fh->buffers.buffer[i].map) { in zoran_vm_close()
2628 if (fh->buffers.active != ZORAN_FREE) { in zoran_vm_close()
2634 zr->v4l_buffers.active = fh->buffers.active = ZORAN_FREE; in zoran_vm_close()
2639 if (fh->buffers.active != ZORAN_FREE) { in zoran_vm_close()
2642 zr->jpg_buffers.active = fh->buffers.active = ZORAN_FREE; in zoran_vm_close()
2681 if (!fh->buffers.allocated) { in zoran_mmap()
2690 first = offset / fh->buffers.buffer_size; in zoran_mmap()
2691 last = first - 1 + size / fh->buffers.buffer_size; in zoran_mmap()
2692 if (offset % fh->buffers.buffer_size != 0 || in zoran_mmap()
2693 size % fh->buffers.buffer_size != 0 || first < 0 || in zoran_mmap()
2694 last < 0 || first >= fh->buffers.num_buffers || in zoran_mmap()
2695 last >= fh->buffers.buffer_size) { in zoran_mmap()
2700 fh->buffers.buffer_size, in zoran_mmap()
2701 fh->buffers.num_buffers); in zoran_mmap()
2708 if (fh->buffers.buffer[i].map) { in zoran_mmap()
2734 if (todo > fh->buffers.buffer_size) in zoran_mmap()
2735 todo = fh->buffers.buffer_size; in zoran_mmap()
2736 page = fh->buffers.buffer[i].v4l.fbuffer_phys; in zoran_mmap()
2748 fh->buffers.buffer[i].map = map; in zoran_mmap()
2755 j < fh->buffers.buffer_size / PAGE_SIZE; in zoran_mmap()
2758 (le32_to_cpu(fh->buffers.buffer[i].jpg. in zoran_mmap()
2764 le32_to_cpu(fh->buffers. in zoran_mmap()
2782 if (le32_to_cpu(fh->buffers.buffer[i].jpg. in zoran_mmap()
2786 fh->buffers.buffer[i].map = map; in zoran_mmap()