1 /* 2 * videobuf2-vmalloc.h - vmalloc memory allocator for videobuf2 3 * 4 * Copyright (C) 2010 Samsung Electronics 5 * 6 * Author: Pawel Osciak <pawel@osciak.com> 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation. 11 */ 12 13 #ifndef _MEDIA_VIDEOBUF2_CMAALLOC_H 14 #define _MEDIA_VIDEOBUF2_CMAALLOC_H 15 16 #include <media/videobuf2-v4l2.h> 17 #include <media/videobuf2-memops.h> 18 19 extern const struct vb2_mem_ops vb2_cmalloc_memops; 20 21 struct vb2_cmalloc_buf { 22 void *vaddr; 23 struct frame_vector *vec; 24 enum dma_data_direction dma_dir; 25 unsigned long size; 26 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)) 27 refcount_t refcount; 28 #else 29 atomic_t refcount; 30 #endif 31 struct vb2_vmarea_handler handler; 32 struct dma_buf *dbuf; 33 }; 34 35 36 #endif 37