videobuf-vmalloc.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * helper functions for vmalloc capture buffers
  4. *
  5. * The functions expect the hardware being able to scatter gather
  6. * (i.e. the buffers are not linear in physical memory, but fragmented
  7. * into PAGE_SIZE chunks). They also assume the driver does not need
  8. * to touch the video data.
  9. *
  10. * (c) 2007 Mauro Carvalho Chehab, <[email protected]>
  11. */
  12. #ifndef _VIDEOBUF_VMALLOC_H
  13. #define _VIDEOBUF_VMALLOC_H
  14. #include <media/videobuf-core.h>
  15. /* --------------------------------------------------------------------- */
  16. struct videobuf_vmalloc_memory {
  17. u32 magic;
  18. void *vaddr;
  19. /* remap_vmalloc_range seems to need to run
  20. * after mmap() on some cases */
  21. struct vm_area_struct *vma;
  22. };
  23. void videobuf_queue_vmalloc_init(struct videobuf_queue *q,
  24. const struct videobuf_queue_ops *ops,
  25. struct device *dev,
  26. spinlock_t *irqlock,
  27. enum v4l2_buf_type type,
  28. enum v4l2_field field,
  29. unsigned int msize,
  30. void *priv,
  31. struct mutex *ext_lock);
  32. void *videobuf_to_vmalloc(struct videobuf_buffer *buf);
  33. void videobuf_vmalloc_free(struct videobuf_buffer *buf);
  34. #endif