diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2023-09-06 12:51:04 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2024-04-29 14:56:37 +0200 |
commit | 91e99e5a0bed1084ab5db2a69923b248039408ae (patch) | |
tree | 33281a751d98c1ca7e6953aa6f08fa4d3811d283 /drivers/media | |
parent | media: v4l: subdev: Add len_routes field to struct v4l2_subdev_routing (diff) | |
download | linux-91e99e5a0bed1084ab5db2a69923b248039408ae.tar.xz linux-91e99e5a0bed1084ab5db2a69923b248039408ae.zip |
media: v4l: subdev: Return routes set using S_ROUTING
Return the routes set using S_ROUTING back to the user. Also reflect this
in documentation.
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>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-subdev.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index b565f202df67..3d1ed8ab5229 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -1017,8 +1017,18 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, krouting.len_routes = routing->len_routes; krouting.routes = routes; - return v4l2_subdev_call(sd, pad, set_routing, state, + rval = v4l2_subdev_call(sd, pad, set_routing, state, routing->which, &krouting); + if (rval < 0) + return rval; + + memcpy((struct v4l2_subdev_route *)(uintptr_t)routing->routes, + state->routing.routes, + min(state->routing.num_routes, routing->len_routes) * + sizeof(*state->routing.routes)); + routing->num_routes = state->routing.num_routes; + + return 0; } case VIDIOC_SUBDEV_G_CLIENT_CAP: { |