History

media: subdev: Add [GS]_ROUTING subdev ioctls and operations

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

Laurent Pinchart committed 5 years ago

Commit a418bb31 parent ea73eda4 files · +173 −1Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/v4l2-subdev.h+43−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #ifndef __LINUX_V4L2_SUBDEV_H
1212 #define __LINUX_V4L2_SUBDEV_H
1313
14+#include <linux/const.h>
1415 #include <linux/ioctl.h>
1516 #include <linux/types.h>
1617 #include <linux/v4l2-common.h>
@@ -178,6 +179,46 @@ struct v4l2_subdev_capability { · 161 unmodified lines
178179 /* The v4l2 sub-device supports routing and multiplexed streams. */
179180 #define V4L2_SUBDEV_CAP_STREAMS 0x00000002
180181
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+
181222 /* Backwards compatibility define --- to be removed */
182223 #define v4l2_subdev_edid v4l2_edid
183224
@@ -193,6 +234,8 @@ struct v4l2_subdev_capability { · 9 unmodified lines
193234 #define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)
194235 #define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection)
195236 #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)
196239 /* The following ioctls are identical to the ioctls in videodev2.h */
197240 #define VIDIOC_SUBDEV_G_STD _IOR('V', 23, v4l2_std_id)
198241 #define VIDIOC_SUBDEV_S_STD _IOW('V', 24, v4l2_std_id)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t