Add support for subdev internal routing. A route is defined as a single stream from a sink pad to a source pad. The userspace can configure the routing via two new ioctls, VIDIOC_SUBDEV_G_ROUTING and VIDIOC_SUBDEV_S_ROUTING, and subdevs can implement the functionality with v4l2_subdev_pad_ops.set_routing(). - Add sink and source streams for multiplexed links - Copy the argument back in case of an error. This is needed to let the caller know the number of routes. - Expand and refine documentation. - Make the 'routes' pointer a __u64 __user pointer so that a compat32 version of the ioctl is not required. - Add struct v4l2_subdev_krouting to be used for subdevice operations. - Fix typecasing warnings - Check sink & source pad types - Add 'which' field - Routing to subdev state - Dropped get_routing subdev op
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | #ifndef __LINUX_V4L2_SUBDEV_H |
| 12 | 12 | #define __LINUX_V4L2_SUBDEV_H |
| 13 | 13 | |
| 14 | +#include <linux/const.h> | |
| 14 | 15 | #include <linux/ioctl.h> |
| 15 | 16 | #include <linux/types.h> |
| 16 | 17 | #include <linux/v4l2-common.h> |
| @@ -178,6 +179,46 @@ struct v4l2_subdev_capability { · 161 unmodified lines | ||
| 178 | 179 | /* The v4l2 sub-device supports routing and multiplexed streams. */ |
| 179 | 180 | #define V4L2_SUBDEV_CAP_STREAMS 0x00000002 |
| 180 | 181 | |
| 182 | +/* | |
| 183 | + * Is the route active? An active route will start when streaming is enabled | |
| 184 | + * on a video node. | |
| 185 | + */ | |
| 186 | +#define V4L2_SUBDEV_ROUTE_FL_ACTIVE (1U << 0) | |
| 187 | + | |
| 188 | +/** | |
| 189 | + * struct v4l2_subdev_route - A route inside a subdev | |
| 190 | + * | |
| 191 | + * @sink_pad: the sink pad index | |
| 192 | + * @sink_stream: the sink stream identifier | |
| 193 | + * @source_pad: the source pad index | |
| 194 | + * @source_stream: the source stream identifier | |
| 195 | + * @flags: route flags V4L2_SUBDEV_ROUTE_FL_* | |
| 196 | + * @reserved: drivers and applications must zero this array | |
| 197 | + */ | |
| 198 | +struct v4l2_subdev_route { | |
| 199 | + __u32 sink_pad; | |
| 200 | + __u32 sink_stream; | |
| 201 | + __u32 source_pad; | |
| 202 | + __u32 source_stream; | |
| 203 | + __u32 flags; | |
| 204 | + __u32 reserved[5]; | |
| 205 | +}; | |
| 206 | + | |
| 207 | +/** | |
| 208 | + * struct v4l2_subdev_routing - Subdev routing information | |
| 209 | + * | |
| 210 | + * @which: configuration type (from enum v4l2_subdev_format_whence) | |
| 211 | + * @num_routes: the total number of routes in the routes array | |
| 212 | + * @routes: pointer to the routes array | |
| 213 | + * @reserved: drivers and applications must zero this array | |
| 214 | + */ | |
| 215 | +struct v4l2_subdev_routing { | |
| 216 | + __u32 which; | |
| 217 | + __u32 num_routes; | |
| 218 | + __u64 routes; | |
| 219 | + __u32 reserved[6]; | |
| 220 | +}; | |
| 221 | + | |
| 181 | 222 | /* Backwards compatibility define --- to be removed */ |
| 182 | 223 | #define v4l2_subdev_edid v4l2_edid |
| 183 | 224 | |
| @@ -193,6 +234,8 @@ struct v4l2_subdev_capability { · 9 unmodified lines | ||
| 193 | 234 | #define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop) |
| 194 | 235 | #define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection) |
| 195 | 236 | #define VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection) |
| 237 | +#define VIDIOC_SUBDEV_G_ROUTING _IOWR('V', 38, struct v4l2_subdev_routing) | |
| 238 | +#define VIDIOC_SUBDEV_S_ROUTING _IOWR('V', 39, struct v4l2_subdev_routing) | |
| 196 | 239 | /* The following ioctls are identical to the ioctls in videodev2.h */ |
| 197 | 240 | #define VIDIOC_SUBDEV_G_STD _IOR('V', 23, v4l2_std_id) |
| 198 | 241 | #define VIDIOC_SUBDEV_S_STD _IOW('V', 24, v4l2_std_id) |