aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h
blob: 6f56c517d850e332c64b32bbce513173c5e55168 (plain) (blame)
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
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Broadcom BM2835 V4L2 driver
 *
 * Copyright © 2013 Raspberry Pi (Trading) Ltd.
 *
 * Authors: Vincent Sanders @ Collabora
 *          Dave Stevenson @ Broadcom
 *		(now dave.stevenson@raspberrypi.org)
 *          Simon Mellor @ Broadcom
 *          Luke Diamand @ Broadcom
 *
 * MMAL structures
 *
 */
#ifndef MMAL_COMMON_H
#define MMAL_COMMON_H

#define MMAL_FOURCC(a, b, c, d) ((a) | (b << 8) | (c << 16) | (d << 24))
#define MMAL_MAGIC MMAL_FOURCC('m', 'm', 'a', 'l')

/** Special value signalling that time is not known */
#define MMAL_TIME_UNKNOWN BIT_ULL(63)

struct mmal_msg_context;

/* mapping between v4l and mmal video modes */
struct mmal_fmt {
	char  *name;
	u32   fourcc;          /* v4l2 format id */
	int   flags;           /* v4l2 flags field */
	u32   mmal;
	int   depth;
	u32   mmal_component;  /* MMAL component index to be used to encode */
	u32   ybbp;            /* depth of first Y plane for planar formats */
	bool  remove_padding;  /* Does the GPU have to remove padding,
				* or can we do hide padding via bytesperline.
				*/
};

/* buffer for one video frame */
struct mmal_buffer {
	/* v4l buffer data -- must be first */
	struct vb2_v4l2_buffer	vb;

	/* list of buffers available */
	struct list_head	list;

	void *buffer; /* buffer pointer */
	unsigned long buffer_size; /* size of allocated buffer */

	struct mmal_msg_context *msg_context;
};

/* */
struct mmal_colourfx {
	s32 enable;
	u32 u;
	u32 v;
};
#endif