blob: 047d20faa64e98bb4a2387b703a3fc6b162d1b53 [file] [log] [blame]
Mingcheng Zhu9812bd32011-07-22 22:57:11 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
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 _VIDEOBUF2_PMEM_CONTIG_H
16#define _VIDEOBUF2_PMEM_CONTIG_H
17
18#include <media/videobuf2-core.h>
19
20struct videobuf2_mapping {
21 unsigned int count;
22};
23
24struct videobuf2_contig_pmem {
25 u32 magic;
26 void *vaddr;
27 int phyaddr;
28 unsigned long size;
29 int is_userptr;
30 uint32_t y_off;
31 uint32_t cbcr_off;
32 int buffer_type;
33 struct file *file;
34 uint32_t addr_offset;
35 int dirty;
36 unsigned int count;
37 void *alloc_ctx;
38};
39void videobuf2_queue_pmem_contig_init(struct vb2_queue *q,
40 enum v4l2_buf_type type,
41 const struct vb2_ops *ops,
42 unsigned int size,
43 void *priv);
44int videobuf2_pmem_contig_mmap_get(struct videobuf2_contig_pmem *mem,
45 uint32_t yoffset,
46 uint32_t cbcroffset, int path);
47int videobuf2_pmem_contig_user_get(struct videobuf2_contig_pmem *mem,
48 uint32_t yoffset, uint32_t cbcroffset,
49 uint32_t addr_offset, int path);
50void videobuf2_pmem_contig_user_put(struct videobuf2_contig_pmem *mem);
51int videobuf2_to_pmem_contig(struct vb2_buffer *buf, unsigned int plane_no);
52
53#endif /* _VIDEOBUF2_PMEM_CONTIG_H */