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