GNU Linux-libre 4.14.254-gnu1
[releases.git] / drivers / staging / vc04_services / bcm2835-camera / mmal-msg-port.h
1 /*
2  * Broadcom BM2835 V4L2 driver
3  *
4  * Copyright © 2013 Raspberry Pi (Trading) Ltd.
5  *
6  * This file is subject to the terms and conditions of the GNU General Public
7  * License.  See the file COPYING in the main directory of this archive
8  * for more details.
9  *
10  * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk>
11  *          Dave Stevenson <dsteve@broadcom.com>
12  *          Simon Mellor <simellor@broadcom.com>
13  *          Luke Diamand <luked@broadcom.com>
14  */
15
16 /* MMAL_PORT_TYPE_T */
17 enum mmal_port_type {
18         MMAL_PORT_TYPE_UNKNOWN = 0,  /**< Unknown port type */
19         MMAL_PORT_TYPE_CONTROL,      /**< Control port */
20         MMAL_PORT_TYPE_INPUT,        /**< Input port */
21         MMAL_PORT_TYPE_OUTPUT,       /**< Output port */
22         MMAL_PORT_TYPE_CLOCK,        /**< Clock port */
23 };
24
25 /** The port is pass-through and doesn't need buffer headers allocated */
26 #define MMAL_PORT_CAPABILITY_PASSTHROUGH                       0x01
27 /** The port wants to allocate the buffer payloads.
28  * This signals a preference that payload allocation should be done
29  * on this port for efficiency reasons.
30  */
31 #define MMAL_PORT_CAPABILITY_ALLOCATION                        0x02
32 /** The port supports format change events.
33  * This applies to input ports and is used to let the client know
34  * whether the port supports being reconfigured via a format
35  * change event (i.e. without having to disable the port).
36  */
37 #define MMAL_PORT_CAPABILITY_SUPPORTS_EVENT_FORMAT_CHANGE      0x04
38
39 /* mmal port structure (MMAL_PORT_T)
40  *
41  * most elements are informational only, the pointer values for
42  * interogation messages are generally provided as additional
43  * strucures within the message. When used to set values only teh
44  * buffer_num, buffer_size and userdata parameters are writable.
45  */
46 struct mmal_port {
47         u32 priv; /* Private member used by the framework */
48         u32 name; /* Port name. Used for debugging purposes (RO) */
49
50         u32 type;      /* Type of the port (RO) enum mmal_port_type */
51         u16 index;     /* Index of the port in its type list (RO) */
52         u16 index_all; /* Index of the port in the list of all ports (RO) */
53
54         u32 is_enabled; /* Indicates whether the port is enabled or not (RO) */
55         u32 format; /* Format of the elementary stream */
56
57         u32 buffer_num_min; /* Minimum number of buffers the port
58                              *   requires (RO).  This is set by the
59                              *   component.
60                              */
61
62         u32 buffer_size_min; /* Minimum size of buffers the port
63                               * requires (RO).  This is set by the
64                               * component.
65                               */
66
67         u32 buffer_alignment_min; /* Minimum alignment requirement for
68                                    * the buffers (RO).  A value of
69                                    * zero means no special alignment
70                                    * requirements.  This is set by the
71                                    * component.
72                                    */
73
74         u32 buffer_num_recommended;  /* Number of buffers the port
75                                       * recommends for optimal
76                                       * performance (RO).  A value of
77                                       * zero means no special
78                                       * recommendation.  This is set
79                                       * by the component.
80                                       */
81
82         u32 buffer_size_recommended; /* Size of buffers the port
83                                       * recommends for optimal
84                                       * performance (RO).  A value of
85                                       * zero means no special
86                                       * recommendation.  This is set
87                                       * by the component.
88                                       */
89
90         u32 buffer_num; /* Actual number of buffers the port will use.
91                          * This is set by the client.
92                          */
93
94         u32 buffer_size; /* Actual maximum size of the buffers that
95                           * will be sent to the port. This is set by
96                           * the client.
97                           */
98
99         u32 component; /* Component this port belongs to (Read Only) */
100
101         u32 userdata; /* Field reserved for use by the client */
102
103         u32 capabilities; /* Flags describing the capabilities of a
104                            * port (RO).  Bitwise combination of \ref
105                            * portcapabilities "Port capabilities"
106                            * values.
107                            */
108
109 };