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