18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * videobuf2-memops.h - generic memory handling routines for videobuf2 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Copyright (C) 2010 Samsung Electronics 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Author: Pawel Osciak <pawel@osciak.com> 78c2ecf20Sopenharmony_ci * Marek Szyprowski <m.szyprowski@samsung.com> 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 108c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License as published by 118c2ecf20Sopenharmony_ci * the Free Software Foundation. 128c2ecf20Sopenharmony_ci */ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#ifndef _MEDIA_VIDEOBUF2_MEMOPS_H 158c2ecf20Sopenharmony_ci#define _MEDIA_VIDEOBUF2_MEMOPS_H 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#include <media/videobuf2-v4l2.h> 188c2ecf20Sopenharmony_ci#include <linux/mm.h> 198c2ecf20Sopenharmony_ci#include <linux/refcount.h> 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci/** 228c2ecf20Sopenharmony_ci * struct vb2_vmarea_handler - common vma refcount tracking handler. 238c2ecf20Sopenharmony_ci * 248c2ecf20Sopenharmony_ci * @refcount: pointer to &refcount_t entry in the buffer. 258c2ecf20Sopenharmony_ci * @put: callback to function that decreases buffer refcount. 268c2ecf20Sopenharmony_ci * @arg: argument for @put callback. 278c2ecf20Sopenharmony_ci */ 288c2ecf20Sopenharmony_cistruct vb2_vmarea_handler { 298c2ecf20Sopenharmony_ci refcount_t *refcount; 308c2ecf20Sopenharmony_ci void (*put)(void *arg); 318c2ecf20Sopenharmony_ci void *arg; 328c2ecf20Sopenharmony_ci}; 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciextern const struct vm_operations_struct vb2_common_vm_ops; 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_cistruct frame_vector *vb2_create_framevec(unsigned long start, 378c2ecf20Sopenharmony_ci unsigned long length); 388c2ecf20Sopenharmony_civoid vb2_destroy_framevec(struct frame_vector *vec); 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci#endif 41