Re: [PATCH 01/16] am437x/davinci: set device_caps in struct video_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans,

Thank you for the patch.

On Wed, Jun 26, 2019 at 8:44 AM Hans Verkuil <hverkuil-cisco@xxxxxxxxx> 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-cisco@xxxxxxxxx>
> Cc: prabhakar.csengg@xxxxxxxxx
> ---
>  drivers/media/platform/am437x/am437x-vpfe.c   | 6 ++----
>  drivers/media/platform/davinci/vpbe_display.c | 3 +--
>  drivers/media/platform/davinci/vpfe_capture.c | 3 +--
>  drivers/media/platform/davinci/vpif_capture.c | 3 +--
>  drivers/media/platform/davinci/vpif_display.c | 3 +--
>  5 files changed, 6 insertions(+), 12 deletions(-)
>

Acked-by: Lad, Prabhakar <prabhakar.csengg@xxxxxxxxx>

Cheers,
Prabhakar Lad

> diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c
> index fe7b937eb5f2..ef635f80d645 100644
> --- a/drivers/media/platform/am437x/am437x-vpfe.c
> +++ b/drivers/media/platform/am437x/am437x-vpfe.c
> @@ -1412,10 +1412,6 @@ static int vpfe_querycap(struct file *file, void  *priv,
>         strscpy(cap->card, "TI AM437x VPFE", sizeof(cap->card));
>         snprintf(cap->bus_info, sizeof(cap->bus_info),
>                         "platform:%s", vpfe->v4l2_dev.name);
> -       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
> -                           V4L2_CAP_READWRITE;
> -       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
> -
>         return 0;
>  }
>
> @@ -2393,6 +2389,8 @@ static int vpfe_probe_complete(struct vpfe_device *vpfe)
>         vdev->vfl_dir = VFL_DIR_RX;
>         vdev->queue = q;
>         vdev->lock = &vpfe->lock;
> +       vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
> +                           V4L2_CAP_READWRITE;
>         video_set_drvdata(vdev, vpfe);
>         err = video_register_device(&vpfe->video_dev, VFL_TYPE_GRABBER, -1);
>         if (err) {
> diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
> index 000b191c42d8..8d864b4da65e 100644
> --- a/drivers/media/platform/davinci/vpbe_display.c
> +++ b/drivers/media/platform/davinci/vpbe_display.c
> @@ -633,8 +633,6 @@ static int vpbe_display_querycap(struct file *file, void  *priv,
>         struct vpbe_layer *layer = video_drvdata(file);
>         struct vpbe_device *vpbe_dev = layer->disp_dev->vpbe_dev;
>
> -       cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
> -       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
>         snprintf(cap->driver, sizeof(cap->driver), "%s",
>                 dev_name(vpbe_dev->pdev));
>         snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> @@ -1319,6 +1317,7 @@ static int init_vpbe_layer(int i, struct vpbe_display *disp_dev,
>         vbd->v4l2_dev   = &disp_dev->vpbe_dev->v4l2_dev;
>         vbd->lock       = &vpbe_display_layer->opslock;
>         vbd->vfl_dir    = VFL_DIR_TX;
> +       vbd->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
>
>         if (disp_dev->vpbe_dev->current_timings.timings_type &
>                         VPBE_ENC_STD)
> diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
> index 295fbf1a49cf..852fc357e19d 100644
> --- a/drivers/media/platform/davinci/vpfe_capture.c
> +++ b/drivers/media/platform/davinci/vpfe_capture.c
> @@ -877,8 +877,6 @@ static int vpfe_querycap(struct file *file, void  *priv,
>
>         v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_querycap\n");
>
> -       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> -       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
>         strscpy(cap->driver, CAPTURE_DRV_NAME, sizeof(cap->driver));
>         strscpy(cap->bus_info, "VPFE", sizeof(cap->bus_info));
>         strscpy(cap->card, vpfe_dev->cfg->card_name, sizeof(cap->card));
> @@ -1785,6 +1783,7 @@ static int vpfe_probe(struct platform_device *pdev)
>         vfd->ioctl_ops          = &vpfe_ioctl_ops;
>         vfd->tvnorms            = 0;
>         vfd->v4l2_dev           = &vpfe_dev->v4l2_dev;
> +       vfd->device_caps        = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
>         snprintf(vfd->name, sizeof(vfd->name),
>                  "%s_V%d.%d.%d",
>                  CAPTURE_DRV_NAME,
> diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
> index f0f7ef638c56..af22fc5050c3 100644
> --- a/drivers/media/platform/davinci/vpif_capture.c
> +++ b/drivers/media/platform/davinci/vpif_capture.c
> @@ -1085,8 +1085,6 @@ static int vpif_querycap(struct file *file, void  *priv,
>  {
>         struct vpif_capture_config *config = vpif_dev->platform_data;
>
> -       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> -       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
>         strscpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver));
>         snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
>                  dev_name(vpif_dev));
> @@ -1473,6 +1471,7 @@ static int vpif_probe_complete(void)
>                 vdev->vfl_dir = VFL_DIR_RX;
>                 vdev->queue = q;
>                 vdev->lock = &common->lock;
> +               vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
>                 video_set_drvdata(&ch->video_dev, ch);
>                 err = video_register_device(vdev,
>                                             VFL_TYPE_GRABBER, (j ? 1 : 0));
> diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
> index a69897c68a50..91592e766368 100644
> --- a/drivers/media/platform/davinci/vpif_display.c
> +++ b/drivers/media/platform/davinci/vpif_display.c
> @@ -584,8 +584,6 @@ static int vpif_querycap(struct file *file, void  *priv,
>  {
>         struct vpif_display_config *config = vpif_dev->platform_data;
>
> -       cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
> -       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
>         strscpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver));
>         snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
>                  dev_name(vpif_dev));
> @@ -1218,6 +1216,7 @@ static int vpif_probe_complete(void)
>                 vdev->vfl_dir = VFL_DIR_TX;
>                 vdev->queue = q;
>                 vdev->lock = &common->lock;
> +               vdev->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
>                 video_set_drvdata(&ch->video_dev, ch);
>                 err = video_register_device(vdev, VFL_TYPE_GRABBER,
>                                             (j ? 3 : 2));
> --
> 2.20.1
>



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux