media: v4l: subdev: Add len_routes field to struct v4l2_subdev_routing

The len_routes field is used to tell the size of the routes array in
struct v4l2_subdev_routing. This way the number of routes returned from
S_ROUTING IOCTL may be larger than the number of routes provided, in case
there are more routes returned by the driver.

Note that this uAPI is still disabled in the code, so this change can
safely be done. Anyone who manually patched the code to enable this uAPI
must update their code.

The patch also increases the number of reserved fields in struct
v4l2_subdev_routing.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
Sakari Ailus
2023-08-31 14:56:28 +03:00
committed by Hans Verkuil
parent 38c84932de
commit 83a22a07cd
5 changed files with 48 additions and 24 deletions
+7 -3
View File
@@ -228,15 +228,19 @@ struct v4l2_subdev_route {
* struct v4l2_subdev_routing - Subdev routing information
*
* @which: configuration type (from enum v4l2_subdev_format_whence)
* @num_routes: the total number of routes in the routes array
* @len_routes: the length of the routes array, in routes; set by the user, not
* modified by the kernel
* @routes: pointer to the routes array
* @num_routes: the total number of routes, possibly more than fits in the
* routes array
* @reserved: drivers and applications must zero this array
*/
struct v4l2_subdev_routing {
__u32 which;
__u32 num_routes;
__u32 len_routes;
__u64 routes;
__u32 reserved[6];
__u32 num_routes;
__u32 reserved[11];
};
/*