On Thu, Mar 28, 2019 at 09:05:55PM +0100, Jacopo Mondi wrote: > From: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> > Signed-off-by: Michal Simek <michal.simek@xxxxxxxxxx> > > - 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. > > Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> > Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx> > > - 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. > > Signed-off-by: Jacopo Mondi <jacopo+renesas@xxxxxxxxxx> > --- > drivers/media/v4l2-core/v4l2-ioctl.c | 25 ++++++++++++++++- > drivers/media/v4l2-core/v4l2-subdev.c | 36 ++++++++++++++++++++++++ > include/media/v4l2-subdev.h | 22 +++++++++++++++ > include/uapi/linux/v4l2-subdev.h | 40 +++++++++++++++++++++++++++ > 4 files changed, 122 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c > index ac87c3e37280..091f25526e72 100644 > --- a/drivers/media/v4l2-core/v4l2-ioctl.c > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c > @@ -19,6 +19,7 @@ > #include <linux/kernel.h> > #include <linux/version.h> > > +#include <linux/v4l2-subdev.h> > #include <linux/videodev2.h> > > #include <media/v4l2-common.h> > @@ -2968,6 +2969,21 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size, > } > break; > } > + > + case VIDIOC_SUBDEV_G_ROUTING: > + case VIDIOC_SUBDEV_S_ROUTING: { > + struct v4l2_subdev_routing *route = parg; > + > + if (route->num_routes > 256) > + return -EINVAL; > + > + *user_ptr = (void __user *)route->routes; > + *kernel_ptr = (void *)&route->routes; void ** --- it's a pointer to a pointer. > + *array_size = sizeof(struct v4l2_subdev_route) > + * route->num_routes; > + ret = 1; > + break; > + } > } > > return ret; -- Sakari Ailus sakari.ailus@xxxxxxxxxxxxxxx