summaryrefslogtreecommitdiff
path: root/drivers/media/video/mxc/output/mxc_pxp_v4l2.h
blob: d17eea5713742bef991e42da85453b959cebd1e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * Copyright (C) 2010 Freescale Semiconductor, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 *
 */
/*
 * Based on STMP378X PxP driver
 * Copyright 2008-2009 Embedded Alley Solutions, Inc All Rights Reserved.
 */

#ifndef	_MXC_PXP_V4L2_H
#define	_MXC_PXP_V4L2_H

#include <linux/dmaengine.h>
#include <linux/pxp_dma.h>

struct pxp_buffer {
	/* Must be first! */
	struct videobuf_buffer vb;

	/* One descriptor per scatterlist (per frame) */
	struct dma_async_tx_descriptor		*txd;

	struct scatterlist			sg[3];
};

struct pxps {
	struct platform_device *pdev;

	spinlock_t lock;
	struct mutex mutex;
	int users;

	struct video_device *vdev;

	struct videobuf_queue s0_vbq;
	struct pxp_buffer *active;
	struct list_head outq;
	struct pxp_channel	*pxp_channel[1];	/* We need 1 channel */
	struct pxp_config_data pxp_conf;

	int output;
	u32 *outb;
	dma_addr_t outb_phys;
	u32 outb_size;

	/* Current S0 configuration */
	struct pxp_data_format *s0_fmt;

	struct v4l2_framebuffer fb;

	/* Output overlay support */
	int overlay_state;
	int global_alpha_state;
	u8  global_alpha;
	int s1_chromakey_state;
	u32 s1_chromakey;

	int fb_blank;
};

struct pxp_data_format {
	char *name;
	unsigned int bpp;
	u32 fourcc;
	enum v4l2_colorspace colorspace;
};

#endif