videobuf2-memops.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * videobuf2-memops.h - generic memory handling routines for videobuf2
  3. *
  4. * Copyright (C) 2010 Samsung Electronics
  5. *
  6. * Author: Pawel Osciak <pawel@osciak.com>
  7. * Marek Szyprowski <m.szyprowski@samsung.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation.
  12. */
  13. #ifndef _MEDIA_VIDEOBUF2_MEMOPS_H
  14. #define _MEDIA_VIDEOBUF2_MEMOPS_H
  15. #include <media/videobuf2-v4l2.h>
  16. #include <linux/mm.h>
  17. /**
  18. * struct vb2_vmarea_handler - common vma refcount tracking handler
  19. *
  20. * @refcount: pointer to refcount entry in the buffer
  21. * @put: callback to function that decreases buffer refcount
  22. * @arg: argument for @put callback
  23. */
  24. struct vb2_vmarea_handler {
  25. atomic_t *refcount;
  26. void (*put)(void *arg);
  27. void *arg;
  28. };
  29. extern const struct vm_operations_struct vb2_common_vm_ops;
  30. struct frame_vector *vb2_create_framevec(unsigned long start,
  31. unsigned long length,
  32. bool write);
  33. void vb2_destroy_framevec(struct frame_vector *vec);
  34. #endif