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 <[email protected]>
  7. * Marek Szyprowski <[email protected]>
  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. #include <linux/refcount.h>
  18. /**
  19. * struct vb2_vmarea_handler - common vma refcount tracking handler.
  20. *
  21. * @refcount: pointer to &refcount_t entry in the buffer.
  22. * @put: callback to function that decreases buffer refcount.
  23. * @arg: argument for @put callback.
  24. */
  25. struct vb2_vmarea_handler {
  26. refcount_t *refcount;
  27. void (*put)(void *arg);
  28. void *arg;
  29. };
  30. extern const struct vm_operations_struct vb2_common_vm_ops;
  31. struct frame_vector *vb2_create_framevec(unsigned long start,
  32. unsigned long length);
  33. void vb2_destroy_framevec(struct frame_vector *vec);
  34. #endif