summaryrefslogtreecommitdiff
path: root/drivers/media/platform/mxc/output/mxc_pxp_v4l2.h
blob: e424cb9dd1d6d9cbb5cb98978ea65acc0823daf1 (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
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2010-2014 Freescale Semiconductor, Inc.
 * Copyright 2019 NXP
 */
/*
 * 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 dma_mem {
	void *vaddr;
	dma_addr_t paddr;
	size_t size;
};

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;
	struct dma_mem outbuf;

	int output;

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

	struct fb_info *fbi;
	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