Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | * helper functions for physically contiguous PMEM capture buffers |
| 13 | */ |
| 14 | |
| 15 | #ifndef _VIDEOBUF_PMEM_CONTIG_H |
| 16 | #define _VIDEOBUF_PMEM_CONTIG_H |
| 17 | |
| 18 | #include <media/videobuf-core.h> |
| 19 | |
| 20 | struct videobuf_contig_pmem { |
| 21 | u32 magic; |
| 22 | void *vaddr; |
| 23 | int phyaddr; |
| 24 | unsigned long size; |
| 25 | int is_userptr; |
Kiran Kumar H N | 5a19c68 | 2011-07-23 11:34:34 -0700 | [diff] [blame] | 26 | uint32_t y_off; |
| 27 | uint32_t cbcr_off; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 28 | int buffer_type; |
| 29 | struct file *file; |
| 30 | }; |
| 31 | |
| 32 | void videobuf_queue_pmem_contig_init(struct videobuf_queue *q, |
| 33 | const struct videobuf_queue_ops *ops, |
| 34 | struct device *dev, |
| 35 | spinlock_t *irqlock, |
| 36 | enum v4l2_buf_type type, |
| 37 | enum v4l2_field field, |
| 38 | unsigned int msize, |
| 39 | void *priv, |
| 40 | struct mutex *ext_lock); |
| 41 | |
| 42 | int videobuf_to_pmem_contig(struct videobuf_buffer *buf); |
| 43 | int videobuf_pmem_contig_free(struct videobuf_queue *q, |
| 44 | struct videobuf_buffer *buf); |
| 45 | |
| 46 | #endif /* _VIDEOBUF_PMEM_CONTIG_H */ |