Hej,

On Thu, Dec 14, 2017 at 08:08:23PM +0100, Niklas Söderlund wrote:
> To work with multiplexed streams the pad and stream aware s_stream
> operation needs to be used.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
> ---
>  drivers/media/platform/rcar-vin/rcar-dma.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c 
> b/drivers/media/platform/rcar-vin/rcar-dma.c
> index cf30e5fceb1d493a..8435491535060eae 100644
> --- a/drivers/media/platform/rcar-vin/rcar-dma.c
> +++ b/drivers/media/platform/rcar-vin/rcar-dma.c
> @@ -1180,7 +1180,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on)
>  
>       if (!on) {
>               media_pipeline_stop(vin->vdev.entity.pads);
> -             return v4l2_subdev_call(sd, video, s_stream, 0);
> +             return v4l2_subdev_call(sd, pad, s_stream, pad->index, 0, 0);

Have you thought of adding a wrapper for the s_stream callback?

I think you should either change all s_stream callbacks from video to pad,
or add a wrapper which then calls the video op instead of the pad op if the
pad op does not exist. Otherwise we again have two non-interoperable
classes of drivers for no good reason.

Thinking about it, I'm not all that certain changing all instances would be
that much work in the end; it should be done anyway. Devices that have a
single stream (i.e. everything right now) just don't care about the pad
number.

>       }
>  
>       fmt.pad = pad->index;
> @@ -1239,12 +1239,14 @@ static int rvin_set_stream(struct rvin_dev *vin, int 
> on)
>       if (media_pipeline_start(vin->vdev.entity.pads, pipe))
>               return -EPIPE;
>  
> -     ret = v4l2_subdev_call(sd, video, s_stream, 1);
> +     ret = v4l2_subdev_call(sd, pad, s_stream, pad->index, 0, 1);
>       if (ret == -ENOIOCTLCMD)
>               ret = 0;
>       if (ret)
>               media_pipeline_stop(vin->vdev.entity.pads);
>  
> +     vin_dbg(vin, "pad: %u stream: 0 enable: %d\n", pad->index, on);
> +
>       return ret;
>  }
>  
> -- 
> 2.15.1
> 

-- 
Sakari Ailus
sakari.ai...@linux.intel.com

Reply via email to