blob: 24eaf138520da2653a76d1ff66718e28f27c3e0a [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>
Ankit Premrajkac6864b82011-07-15 11:43:41 -070019#include <mach/msm_subsystem_map.h>
Mingcheng Zhu9812bd32011-07-22 22:57:11 -070020
21struct videobuf2_mapping {
22 unsigned int count;
23};
24
25struct videobuf2_contig_pmem {
26 u32 magic;
27 void *vaddr;
28 int phyaddr;
29 unsigned long size;
30 int is_userptr;
31 uint32_t y_off;
32 uint32_t cbcr_off;
33 int buffer_type;
34 struct file *file;
35 uint32_t addr_offset;
36 int dirty;
37 unsigned int count;
38 void *alloc_ctx;
Ankit Premrajkac6864b82011-07-15 11:43:41 -070039 struct msm_mapped_buffer *msm_buffer;
40 int subsys_id;
Mingcheng Zhu9812bd32011-07-22 22:57:11 -070041};
42void videobuf2_queue_pmem_contig_init(struct vb2_queue *q,
43 enum v4l2_buf_type type,
44 const struct vb2_ops *ops,
45 unsigned int size,
46 void *priv);
47int videobuf2_pmem_contig_mmap_get(struct videobuf2_contig_pmem *mem,
48 uint32_t yoffset,
49 uint32_t cbcroffset, int path);
50int videobuf2_pmem_contig_user_get(struct videobuf2_contig_pmem *mem,
51 uint32_t yoffset, uint32_t cbcroffset,
52 uint32_t addr_offset, int path);
53void videobuf2_pmem_contig_user_put(struct videobuf2_contig_pmem *mem);
Ankit Premrajkac6864b82011-07-15 11:43:41 -070054unsigned long videobuf2_to_pmem_contig(struct vb2_buffer *buf,
55 unsigned int plane_no);
Mingcheng Zhu9812bd32011-07-22 22:57:11 -070056
57#endif /* _VIDEOBUF2_PMEM_CONTIG_H */