Hi Hans,

Thank you for the patch.

On Wed, Jun 26, 2019 at 09:44:18AM +0200, Hans Verkuil wrote:
> Instead of filling in the struct v4l2_capability device_caps
> field, fill in the struct video_device device_caps field.
> 
> That way the V4L2 core knows what the capabilities of the
> video device are.
> 
> Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>
> Cc: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
> ---
>  drivers/media/platform/vsp1/vsp1_histo.c |  3 +--
>  drivers/media/platform/vsp1/vsp1_video.c | 12 ++++--------
>  2 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/media/platform/vsp1/vsp1_histo.c 
> b/drivers/media/platform/vsp1/vsp1_histo.c
> index 8b01e99acd20..30d751f2cccf 100644
> --- a/drivers/media/platform/vsp1/vsp1_histo.c
> +++ b/drivers/media/platform/vsp1/vsp1_histo.c
> @@ -426,8 +426,6 @@ static int histo_v4l2_querycap(struct file *file, void 
> *fh,
>                         | V4L2_CAP_VIDEO_CAPTURE_MPLANE
>                         | V4L2_CAP_VIDEO_OUTPUT_MPLANE
>                         | V4L2_CAP_META_CAPTURE;
> -     cap->device_caps = V4L2_CAP_META_CAPTURE
> -                      | V4L2_CAP_STREAMING;
>  
>       strscpy(cap->driver, "vsp1", sizeof(cap->driver));
>       strscpy(cap->card, histo->video.name, sizeof(cap->card));
> @@ -556,6 +554,7 @@ int vsp1_histogram_init(struct vsp1_device *vsp1, struct 
> vsp1_histogram *histo,
>       histo->video.vfl_type = VFL_TYPE_GRABBER;
>       histo->video.release = video_device_release_empty;
>       histo->video.ioctl_ops = &histo_v4l2_ioctl_ops;
> +     histo->video.device_caps = V4L2_CAP_META_CAPTURE | V4L2_CAP_STREAMING;
>  
>       video_set_drvdata(&histo->video, histo);
>  
> diff --git a/drivers/media/platform/vsp1/vsp1_video.c 
> b/drivers/media/platform/vsp1/vsp1_video.c
> index fd98e483b2f4..fee2ec45b1d6 100644
> --- a/drivers/media/platform/vsp1/vsp1_video.c
> +++ b/drivers/media/platform/vsp1/vsp1_video.c
> @@ -955,14 +955,6 @@ vsp1_video_querycap(struct file *file, void *fh, struct 
> v4l2_capability *cap)
>       cap->capabilities = V4L2_CAP_DEVICE_CAPS | V4L2_CAP_STREAMING
>                         | V4L2_CAP_VIDEO_CAPTURE_MPLANE
>                         | V4L2_CAP_VIDEO_OUTPUT_MPLANE;
> -
> -     if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
> -             cap->device_caps = V4L2_CAP_VIDEO_CAPTURE_MPLANE
> -                              | V4L2_CAP_STREAMING;
> -     else
> -             cap->device_caps = V4L2_CAP_VIDEO_OUTPUT_MPLANE
> -                              | V4L2_CAP_STREAMING;
> -

Could you please keep this blank line ? Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>

Feel free to merge the patch as part of the series, I don't have any
queued conflicting change.

>       strscpy(cap->driver, "vsp1", sizeof(cap->driver));
>       strscpy(cap->card, video->video.name, sizeof(cap->card));
>       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> @@ -1268,11 +1260,15 @@ struct vsp1_video *vsp1_video_create(struct 
> vsp1_device *vsp1,
>               video->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
>               video->pad.flags = MEDIA_PAD_FL_SOURCE;
>               video->video.vfl_dir = VFL_DIR_TX;
> +             video->video.device_caps = V4L2_CAP_VIDEO_OUTPUT_MPLANE |
> +                                        V4L2_CAP_STREAMING;
>       } else {
>               direction = "output";
>               video->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
>               video->pad.flags = MEDIA_PAD_FL_SINK;
>               video->video.vfl_dir = VFL_DIR_RX;
> +             video->video.device_caps = V4L2_CAP_VIDEO_CAPTURE_MPLANE |
> +                                        V4L2_CAP_STREAMING;
>       }
>  
>       mutex_init(&video->lock);

-- 
Regards,

Laurent Pinchart

Reply via email to