linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/16] media/platform: set device_caps in struct video_device
@ 2019-06-26  7:44 Hans Verkuil
  2019-06-26  7:44 ` [PATCH 01/16] am437x/davinci: " Hans Verkuil
                   ` (15 more replies)
  0 siblings, 16 replies; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media

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.

But this only really works if all drivers use this, so convert
all platform drivers in this patch series.

Hans Verkuil (16):
  am437x/davinci: set device_caps in struct video_device
  coda: set device_caps in struct video_device
  s3c-camif/s5p-g2d/s5p-jpeg: set device_caps in struct video_device
  fsl-viu: set device_caps in struct video_device
  m2m-deinterlace: set device_caps in struct video_device
  mx2_emmaprp: set device_caps in struct video_device
  marvell-ccic: set device_caps in struct video_device
  pxa_camera: set device_caps in struct video_device
  bdisp: set device_caps in struct video_device
  via-camera: set device_caps in struct video_device
  xilinx: set device_caps in struct video_device
  sh_veu/sh_vou: set device_caps in struct video_device
  vsp1: set device_caps in struct video_device
  omap_vout: set device_caps in struct video_device
  ti-vpe: set device_caps in struct video_device
  omap3isp: set device_caps in struct video_device

 drivers/media/platform/am437x/am437x-vpfe.c      |  6 ++----
 drivers/media/platform/coda/coda-common.c        |  4 +---
 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 +--
 drivers/media/platform/fsl-viu.c                 |  7 ++-----
 drivers/media/platform/m2m-deinterlace.c         | 10 +---------
 drivers/media/platform/marvell-ccic/mcam-core.c  |  5 ++---
 drivers/media/platform/mx2_emmaprp.c             |  3 +--
 drivers/media/platform/omap/omap_vout.c          |  6 ++----
 drivers/media/platform/omap3isp/ispvideo.c       | 13 +++++++------
 drivers/media/platform/pxa_camera.c              |  3 ---
 drivers/media/platform/s3c-camif/camif-capture.c |  5 +----
 drivers/media/platform/s5p-g2d/g2d.c             |  3 +--
 drivers/media/platform/s5p-jpeg/jpeg-core.c      |  4 ++--
 drivers/media/platform/sh_veu.c                  |  4 +---
 drivers/media/platform/sh_vou.c                  |  5 ++---
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c    |  6 +-----
 drivers/media/platform/ti-vpe/cal.c              |  5 ++---
 drivers/media/platform/via-camera.c              |  5 ++---
 drivers/media/platform/vsp1/vsp1_histo.c         |  3 +--
 drivers/media/platform/vsp1/vsp1_video.c         | 12 ++++--------
 drivers/media/platform/xilinx/xilinx-dma.c       | 16 +++++++---------
 24 files changed, 46 insertions(+), 91 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 01/16] am437x/davinci: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-07-01  7:30   ` Lad, Prabhakar
  2019-06-26  7:44 ` [PATCH 02/16] coda: " Hans Verkuil
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, prabhakar.csengg

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@xs4all.nl>
Cc: prabhakar.csengg@gmail.com
---
 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(-)

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


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 02/16] coda: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
  2019-06-26  7:44 ` [PATCH 01/16] am437x/davinci: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  7:49   ` Philipp Zabel
  2019-06-26  7:44 ` [PATCH 03/16] s3c-camif/s5p-g2d/s5p-jpeg: " Hans Verkuil
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Philipp Zabel

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@xs4all.nl>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/media/platform/coda/coda-common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 01428de2596e..73222c0615c0 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -390,9 +390,6 @@ static int coda_querycap(struct file *file, void *priv,
 	strscpy(cap->card, coda_product_name(ctx->dev->devtype->product),
 		sizeof(cap->card));
 	strscpy(cap->bus_info, "platform:" CODA_NAME, sizeof(cap->bus_info));
-	cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-
 	return 0;
 }
 
@@ -2699,6 +2696,7 @@ static int coda_register_device(struct coda_dev *dev, int i)
 	vfd->lock	= &dev->dev_mutex;
 	vfd->v4l2_dev	= &dev->v4l2_dev;
 	vfd->vfl_dir	= VFL_DIR_M2M;
+	vfd->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
 	video_set_drvdata(vfd, dev);
 
 	/* Not applicable, use the selection API instead */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 03/16] s3c-camif/s5p-g2d/s5p-jpeg: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
  2019-06-26  7:44 ` [PATCH 01/16] am437x/davinci: " Hans Verkuil
  2019-06-26  7:44 ` [PATCH 02/16] coda: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  7:44 ` [PATCH 04/16] fsl-viu: " Hans Verkuil
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Sylwester Nawrocki

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@xs4all.nl>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/media/platform/s3c-camif/camif-capture.c | 5 +----
 drivers/media/platform/s5p-g2d/g2d.c             | 3 +--
 drivers/media/platform/s5p-jpeg/jpeg-core.c      | 4 ++--
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
index c3fc94ef251e..2ef0ca9bbbcb 100644
--- a/drivers/media/platform/s3c-camif/camif-capture.c
+++ b/drivers/media/platform/s3c-camif/camif-capture.c
@@ -644,10 +644,6 @@ static int s3c_camif_vidioc_querycap(struct file *file, void *priv,
 	strscpy(cap->card, S3C_CAMIF_DRIVER_NAME, sizeof(cap->card));
 	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s.%d",
 		 dev_name(vp->camif->dev), vp->id);
-
-	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-
 	return 0;
 }
 
@@ -1166,6 +1162,7 @@ int s3c_camif_register_video_node(struct camif_dev *camif, int idx)
 		goto err_me_cleanup;
 
 	vfd->ctrl_handler = &vp->ctrl_handler;
+	vfd->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE;
 
 	ret = video_register_device(vfd, VFL_TYPE_GRABBER, -1);
 	if (ret)
diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c
index 152d192d5c3f..131d55cc7450 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -296,8 +296,6 @@ static int vidioc_querycap(struct file *file, void *priv,
 	strscpy(cap->driver, G2D_NAME, sizeof(cap->driver));
 	strscpy(cap->card, G2D_NAME, sizeof(cap->card));
 	cap->bus_info[0] = 0;
-	cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 	return 0;
 }
 
@@ -704,6 +702,7 @@ static int g2d_probe(struct platform_device *pdev)
 	set_bit(V4L2_FL_QUIRK_INVERTED_CROP, &vfd->flags);
 	vfd->lock = &dev->mutex;
 	vfd->v4l2_dev = &dev->v4l2_dev;
+	vfd->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
 	ret = video_register_device(vfd, VFL_TYPE_GRABBER, 0);
 	if (ret) {
 		v4l2_err(&dev->v4l2_dev, "Failed to register video device\n");
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 8cc730eccb6c..3ecb29c75968 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1288,8 +1288,6 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
 	}
 	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
 		 dev_name(ctx->jpeg->dev));
-	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 	return 0;
 }
 
@@ -2977,6 +2975,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
 	jpeg->vfd_encoder->lock		= &jpeg->lock;
 	jpeg->vfd_encoder->v4l2_dev	= &jpeg->v4l2_dev;
 	jpeg->vfd_encoder->vfl_dir	= VFL_DIR_M2M;
+	jpeg->vfd_encoder->device_caps	= V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
 
 	ret = video_register_device(jpeg->vfd_encoder, VFL_TYPE_GRABBER, -1);
 	if (ret) {
@@ -3006,6 +3005,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
 	jpeg->vfd_decoder->lock		= &jpeg->lock;
 	jpeg->vfd_decoder->v4l2_dev	= &jpeg->v4l2_dev;
 	jpeg->vfd_decoder->vfl_dir	= VFL_DIR_M2M;
+	jpeg->vfd_decoder->device_caps	= V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
 
 	ret = video_register_device(jpeg->vfd_decoder, VFL_TYPE_GRABBER, -1);
 	if (ret) {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 04/16] fsl-viu: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (2 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 03/16] s3c-camif/s5p-g2d/s5p-jpeg: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  7:44 ` [PATCH 05/16] m2m-deinterlace: " Hans Verkuil
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

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@xs4all.nl>
---
 drivers/media/platform/fsl-viu.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
index 691be788e38b..bf5392f0d61c 100644
--- a/drivers/media/platform/fsl-viu.c
+++ b/drivers/media/platform/fsl-viu.c
@@ -563,11 +563,6 @@ static int vidioc_querycap(struct file *file, void *priv,
 	strscpy(cap->driver, "viu", sizeof(cap->driver));
 	strscpy(cap->card, "viu", sizeof(cap->card));
 	strscpy(cap->bus_info, "platform:viu", sizeof(cap->bus_info));
-	cap->device_caps =	V4L2_CAP_VIDEO_CAPTURE |
-				V4L2_CAP_STREAMING     |
-				V4L2_CAP_VIDEO_OVERLAY |
-				V4L2_CAP_READWRITE;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 	return 0;
 }
 
@@ -1380,6 +1375,8 @@ static const struct video_device viu_template = {
 	.release	= video_device_release,
 
 	.tvnorms        = V4L2_STD_NTSC_M | V4L2_STD_PAL,
+	.device_caps	= V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
+			  V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_READWRITE,
 };
 
 static int viu_of_probe(struct platform_device *op)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 05/16] m2m-deinterlace: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (3 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 04/16] fsl-viu: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  7:44 ` [PATCH 06/16] mx2_emmaprp: " Hans Verkuil
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

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@xs4all.nl>
---
 drivers/media/platform/m2m-deinterlace.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c
index beb7fd7442fb..485fcf36ce32 100644
--- a/drivers/media/platform/m2m-deinterlace.c
+++ b/drivers/media/platform/m2m-deinterlace.c
@@ -437,15 +437,6 @@ static int vidioc_querycap(struct file *file, void *priv,
 	strscpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver));
 	strscpy(cap->card, MEM2MEM_NAME, sizeof(cap->card));
 	strscpy(cap->bus_info, MEM2MEM_NAME, sizeof(cap->card));
-	/*
-	 * This is only a mem-to-mem video device. The capture and output
-	 * device capability flags are left only for backward compatibility
-	 * and are scheduled for removal.
-	 */
-	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT |
-			   V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-
 	return 0;
 }
 
@@ -972,6 +963,7 @@ static const struct video_device deinterlace_videodev = {
 	.minor		= -1,
 	.release	= video_device_release_empty,
 	.vfl_dir	= VFL_DIR_M2M,
+	.device_caps	= V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING,
 };
 
 static const struct v4l2_m2m_ops m2m_ops = {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 06/16] mx2_emmaprp: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (4 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 05/16] m2m-deinterlace: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  7:44 ` [PATCH 07/16] marvell-ccic: " Hans Verkuil
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

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@xs4all.nl>
---
 drivers/media/platform/mx2_emmaprp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
index 333324c75027..a77fff122467 100644
--- a/drivers/media/platform/mx2_emmaprp.c
+++ b/drivers/media/platform/mx2_emmaprp.c
@@ -383,8 +383,6 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
 	strscpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver));
 	strscpy(cap->card, MEM2MEM_NAME, sizeof(cap->card));
-	cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 	return 0;
 }
 
@@ -866,6 +864,7 @@ static const struct video_device emmaprp_videodev = {
 	.minor		= -1,
 	.release	= video_device_release,
 	.vfl_dir	= VFL_DIR_M2M,
+	.device_caps	= V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING,
 };
 
 static const struct v4l2_m2m_ops m2m_ops = {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 07/16] marvell-ccic: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (5 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 06/16] mx2_emmaprp: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  7:44 ` [PATCH 08/16] pxa_camera: " Hans Verkuil
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Jonathan Corbet

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@xs4all.nl>
Cc: Jonathan Corbet <corbet@lwn.net>
---
 drivers/media/platform/marvell-ccic/mcam-core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
index dc30c48d4671..69862c44e409 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -1357,9 +1357,6 @@ static int mcam_vidioc_querycap(struct file *file, void *priv,
 	strscpy(cap->driver, "marvell_ccic", sizeof(cap->driver));
 	strscpy(cap->card, "marvell_ccic", sizeof(cap->card));
 	strscpy(cap->bus_info, cam->bus_info, sizeof(cap->bus_info));
-	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
-		V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 	return 0;
 }
 
@@ -1698,6 +1695,8 @@ static const struct video_device mcam_v4l_template = {
 	.fops = &mcam_v4l_fops,
 	.ioctl_ops = &mcam_v4l_ioctl_ops,
 	.release = video_device_release_empty,
+	.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
+		       V4L2_CAP_STREAMING,
 };
 
 /* ---------------------------------------------------------------------- */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 08/16] pxa_camera: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (6 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 07/16] marvell-ccic: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  7:44 ` [PATCH 09/16] bdisp: " Hans Verkuil
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

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@xs4all.nl>
---
 drivers/media/platform/pxa_camera.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c
index 1c9bfaabc54c..53682da099c5 100644
--- a/drivers/media/platform/pxa_camera.c
+++ b/drivers/media/platform/pxa_camera.c
@@ -1992,9 +1992,6 @@ static int pxac_vidioc_querycap(struct file *file, void *priv,
 	strscpy(cap->bus_info, "platform:pxa-camera", sizeof(cap->bus_info));
 	strscpy(cap->driver, PXA_CAM_DRV_NAME, sizeof(cap->driver));
 	strscpy(cap->card, pxa_cam_driver_description, sizeof(cap->card));
-	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-
 	return 0;
 }
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 09/16] bdisp: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (7 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 08/16] pxa_camera: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  8:06   ` Fabien DESSENNE
  2019-06-26  7:44 ` [PATCH 10/16] via-camera: " Hans Verkuil
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Fabien Dessenne

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@xs4all.nl>
Cc: Fabien Dessenne <fabien.dessenne@st.com>
---
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
index 79f7db1a9d18..e90f1ba30574 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
@@ -692,11 +692,6 @@ static int bdisp_querycap(struct file *file, void *fh,
 	strscpy(cap->card, bdisp->pdev->name, sizeof(cap->card));
 	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s%d",
 		 BDISP_NAME, bdisp->id);
-
-	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
-
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-
 	return 0;
 }
 
@@ -1059,6 +1054,7 @@ static int bdisp_register_device(struct bdisp_dev *bdisp)
 	bdisp->vdev.lock        = &bdisp->lock;
 	bdisp->vdev.vfl_dir     = VFL_DIR_M2M;
 	bdisp->vdev.v4l2_dev    = &bdisp->v4l2_dev;
+	bdisp->vdev.device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
 	snprintf(bdisp->vdev.name, sizeof(bdisp->vdev.name), "%s.%d",
 		 BDISP_NAME, bdisp->id);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 10/16] via-camera: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (8 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 09/16] bdisp: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  7:44 ` [PATCH 11/16] xilinx: " Hans Verkuil
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Jonathan Corbet

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@xs4all.nl>
Cc: Jonathan Corbet <corbet@lwn.net>
---
 drivers/media/platform/via-camera.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c
index 038de7a2027a..1df1de13117d 100644
--- a/drivers/media/platform/via-camera.c
+++ b/drivers/media/platform/via-camera.c
@@ -992,9 +992,6 @@ static int viacam_querycap(struct file *filp, void *priv,
 {
 	strscpy(cap->driver, "via-camera", sizeof(cap->driver));
 	strscpy(cap->card, "via-camera", sizeof(cap->card));
-	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
-		V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 	return 0;
 }
 
@@ -1271,6 +1268,8 @@ static const struct video_device viacam_v4l_template = {
 	.fops		= &viacam_fops,
 	.ioctl_ops	= &viacam_ioctl_ops,
 	.release	= video_device_release_empty, /* Check this */
+	.device_caps	= V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
+			  V4L2_CAP_STREAMING,
 };
 
 /*
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 11/16] xilinx: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (9 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 10/16] via-camera: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  9:44   ` Laurent Pinchart
  2019-06-26  7:44 ` [PATCH 12/16] sh_veu/sh_vou: " Hans Verkuil
                   ` (4 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Laurent Pinchart

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@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/platform/xilinx/xilinx-dma.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
index c9d5fdb2d407..bcd783d9e5ae 100644
--- a/drivers/media/platform/xilinx/xilinx-dma.c
+++ b/drivers/media/platform/xilinx/xilinx-dma.c
@@ -491,15 +491,8 @@ xvip_dma_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 	struct v4l2_fh *vfh = file->private_data;
 	struct xvip_dma *dma = to_xvip_dma(vfh->vdev);
 
-	cap->device_caps = V4L2_CAP_STREAMING;
-
-	if (dma->queue.type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
-		cap->device_caps |= V4L2_CAP_VIDEO_CAPTURE;
-	else
-		cap->device_caps |= V4L2_CAP_VIDEO_OUTPUT;
-
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS
-			  | dma->xdev->v4l2_caps;
+	cap->capabilities = dma->xdev->v4l2_caps | V4L2_CAP_STREAMING |
+			    V4L2_CAP_DEVICE_CAPS;
 
 	strscpy(cap->driver, "xilinx-vipp", sizeof(cap->driver));
 	strscpy(cap->card, dma->video.name, sizeof(cap->card));
@@ -700,6 +693,11 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,
 	dma->video.release = video_device_release_empty;
 	dma->video.ioctl_ops = &xvip_dma_ioctl_ops;
 	dma->video.lock = &dma->lock;
+	dma->video.device_caps = V4L2_CAP_STREAMING;
+	if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		dma->video.device_caps |= V4L2_CAP_VIDEO_CAPTURE;
+	else
+		dma->video.device_caps |= V4L2_CAP_VIDEO_OUTPUT;
 
 	video_set_drvdata(&dma->video, dma);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 12/16] sh_veu/sh_vou: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (10 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 11/16] xilinx: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26 10:25   ` Jacopo Mondi
  2019-06-26  7:44 ` [PATCH 13/16] vsp1: " Hans Verkuil
                   ` (3 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Jacopo Mondi

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@xs4all.nl>
Cc: Jacopo Mondi <jacopo@jmondi.org>
---
 drivers/media/platform/sh_veu.c | 4 +---
 drivers/media/platform/sh_vou.c | 5 ++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index 5a9ba05c996e..ab39d6c80920 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -348,9 +348,6 @@ static int sh_veu_querycap(struct file *file, void *priv,
 	strscpy(cap->driver, "sh-veu", sizeof(cap->driver));
 	strscpy(cap->card, "sh-mobile VEU", sizeof(cap->card));
 	strscpy(cap->bus_info, "platform:sh-veu", sizeof(cap->bus_info));
-	cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-
 	return 0;
 }
 
@@ -1039,6 +1036,7 @@ static const struct video_device sh_veu_videodev = {
 	.minor		= -1,
 	.release	= video_device_release_empty,
 	.vfl_dir	= VFL_DIR_M2M,
+	.device_caps	= V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING,
 };
 
 static const struct v4l2_m2m_ops sh_veu_m2m_ops = {
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index 5799aa4b9323..1fe573a90f0d 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -381,9 +381,6 @@ static int sh_vou_querycap(struct file *file, void  *priv,
 	strscpy(cap->card, "SuperH VOU", sizeof(cap->card));
 	strscpy(cap->driver, "sh-vou", sizeof(cap->driver));
 	strscpy(cap->bus_info, "platform:sh-vou", sizeof(cap->bus_info));
-	cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_READWRITE |
-			   V4L2_CAP_STREAMING;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 	return 0;
 }
 
@@ -1218,6 +1215,8 @@ static const struct video_device sh_vou_video_template = {
 	.ioctl_ops	= &sh_vou_ioctl_ops,
 	.tvnorms	= V4L2_STD_525_60, /* PAL only supported in 8-bit non-bt656 mode */
 	.vfl_dir	= VFL_DIR_TX,
+	.device_caps	= V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_READWRITE |
+			  V4L2_CAP_STREAMING,
 };
 
 static int sh_vou_probe(struct platform_device *pdev)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 13/16] vsp1: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (11 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 12/16] sh_veu/sh_vou: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  9:16   ` Laurent Pinchart
  2019-06-26  7:44 ` [PATCH 14/16] omap_vout: " Hans Verkuil
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Laurent Pinchart

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@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@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;
-
 	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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 14/16] omap_vout: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (12 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 13/16] vsp1: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  7:44 ` [PATCH 15/16] ti-vpe: " Hans Verkuil
  2019-06-26  7:44 ` [PATCH 16/16] omap3isp: " Hans Verkuil
  15 siblings, 0 replies; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

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@xs4all.nl>
---
 drivers/media/platform/omap/omap_vout.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
index cb6a9e3946b6..29f9c2a3ce2b 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -1044,10 +1044,6 @@ static int vidioc_querycap(struct file *file, void *fh,
 	strscpy(cap->driver, VOUT_NAME, sizeof(cap->driver));
 	strscpy(cap->card, vout->vfd->name, sizeof(cap->card));
 	cap->bus_info[0] = '\0';
-	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT |
-		V4L2_CAP_VIDEO_OUTPUT_OVERLAY;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-
 	return 0;
 }
 
@@ -1870,6 +1866,8 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout)
 	vfd->fops = &omap_vout_fops;
 	vfd->v4l2_dev = &vout->vid_dev->v4l2_dev;
 	vfd->vfl_dir = VFL_DIR_TX;
+	vfd->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT |
+			   V4L2_CAP_VIDEO_OUTPUT_OVERLAY;
 	mutex_init(&vout->lock);
 
 	vfd->minor = -1;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 15/16] ti-vpe: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (13 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 14/16] omap_vout: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26 14:34   ` Benoit Parrot
  2019-06-26  7:44 ` [PATCH 16/16] omap3isp: " Hans Verkuil
  15 siblings, 1 reply; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Benoit Parrot

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@xs4all.nl>
Cc: Benoit Parrot <bparrot@ti.com>
---
 drivers/media/platform/ti-vpe/cal.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index 8d075683e448..3fa306a45787 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -916,9 +916,6 @@ static int cal_querycap(struct file *file, void *priv,
 
 	snprintf(cap->bus_info, sizeof(cap->bus_info),
 		 "platform:%s", ctx->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;
 }
 
@@ -1422,6 +1419,8 @@ static const struct video_device cal_videodev = {
 	.ioctl_ops	= &cal_ioctl_ops,
 	.minor		= -1,
 	.release	= video_device_release_empty,
+	.device_caps	= V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
+			  V4L2_CAP_READWRITE,
 };
 
 /* -----------------------------------------------------------------
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 16/16] omap3isp: set device_caps in struct video_device
  2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
                   ` (14 preceding siblings ...)
  2019-06-26  7:44 ` [PATCH 15/16] ti-vpe: " Hans Verkuil
@ 2019-06-26  7:44 ` Hans Verkuil
  2019-06-26  9:25   ` Laurent Pinchart
  15 siblings, 1 reply; 25+ messages in thread
From: Hans Verkuil @ 2019-06-26  7:44 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Laurent Pinchart

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@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/platform/omap3isp/ispvideo.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
index 175bbed9a235..d98b8c3ec0b2 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -660,12 +660,6 @@ isp_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 
 	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT
 		| V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
-
-	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
-		cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
-	else
-		cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
-
 	return 0;
 }
 
@@ -1463,6 +1457,13 @@ int omap3isp_video_init(struct isp_video *video, const char *name)
 	video->video.vfl_type = VFL_TYPE_GRABBER;
 	video->video.release = video_device_release_empty;
 	video->video.ioctl_ops = &isp_video_ioctl_ops;
+	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		video->video.device_caps =
+			V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+	else
+		video->video.device_caps =
+			V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
+
 	video->pipe.stream_state = ISP_PIPELINE_STREAM_STOPPED;
 
 	video_set_drvdata(&video->video, video);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH 02/16] coda: set device_caps in struct video_device
  2019-06-26  7:44 ` [PATCH 02/16] coda: " Hans Verkuil
@ 2019-06-26  7:49   ` Philipp Zabel
  0 siblings, 0 replies; 25+ messages in thread
From: Philipp Zabel @ 2019-06-26  7:49 UTC (permalink / raw)
  To: Hans Verkuil, linux-media

On Wed, 2019-06-26 at 09:44 +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-cisco@xs4all.nl>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/media/platform/coda/coda-common.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
> index 01428de2596e..73222c0615c0 100644
> --- a/drivers/media/platform/coda/coda-common.c
> +++ b/drivers/media/platform/coda/coda-common.c
> @@ -390,9 +390,6 @@ static int coda_querycap(struct file *file, void *priv,
>  	strscpy(cap->card, coda_product_name(ctx->dev->devtype->product),
>  		sizeof(cap->card));
>  	strscpy(cap->bus_info, "platform:" CODA_NAME, sizeof(cap->bus_info));
> -	cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
> -	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
> -
>  	return 0;
>  }
>  
> @@ -2699,6 +2696,7 @@ static int coda_register_device(struct coda_dev *dev, int i)
>  	vfd->lock	= &dev->dev_mutex;
>  	vfd->v4l2_dev	= &dev->v4l2_dev;
>  	vfd->vfl_dir	= VFL_DIR_M2M;
> +	vfd->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
>  	video_set_drvdata(vfd, dev);
>  
>  	/* Not applicable, use the selection API instead */

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 09/16] bdisp: set device_caps in struct video_device
  2019-06-26  7:44 ` [PATCH 09/16] bdisp: " Hans Verkuil
@ 2019-06-26  8:06   ` Fabien DESSENNE
  0 siblings, 0 replies; 25+ messages in thread
From: Fabien DESSENNE @ 2019-06-26  8:06 UTC (permalink / raw)
  To: Hans Verkuil, linux-media

Hi Hans,


Thank you for the patch.


On 26/06/2019 9:44 AM, 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-cisco@xs4all.nl>
> Cc: Fabien Dessenne <fabien.dessenne@st.com>


Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


> ---
>   drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> index 79f7db1a9d18..e90f1ba30574 100644
> --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> @@ -692,11 +692,6 @@ static int bdisp_querycap(struct file *file, void *fh,
>   	strscpy(cap->card, bdisp->pdev->name, sizeof(cap->card));
>   	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s%d",
>   		 BDISP_NAME, bdisp->id);
> -
> -	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
> -
> -	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
> -
>   	return 0;
>   }
>   
> @@ -1059,6 +1054,7 @@ static int bdisp_register_device(struct bdisp_dev *bdisp)
>   	bdisp->vdev.lock        = &bdisp->lock;
>   	bdisp->vdev.vfl_dir     = VFL_DIR_M2M;
>   	bdisp->vdev.v4l2_dev    = &bdisp->v4l2_dev;
> +	bdisp->vdev.device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
>   	snprintf(bdisp->vdev.name, sizeof(bdisp->vdev.name), "%s.%d",
>   		 BDISP_NAME, bdisp->id);
>   

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 13/16] vsp1: set device_caps in struct video_device
  2019-06-26  7:44 ` [PATCH 13/16] vsp1: " Hans Verkuil
@ 2019-06-26  9:16   ` Laurent Pinchart
  0 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2019-06-26  9:16 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

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-cisco@xs4all.nl>
> Cc: Laurent Pinchart <laurent.pinchart@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.pinchart@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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 16/16] omap3isp: set device_caps in struct video_device
  2019-06-26  7:44 ` [PATCH 16/16] omap3isp: " Hans Verkuil
@ 2019-06-26  9:25   ` Laurent Pinchart
  0 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2019-06-26  9:25 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

Hi Hans,

Thank you for the patch.

On Wed, Jun 26, 2019 at 09:44:21AM +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-cisco@xs4all.nl>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/platform/omap3isp/ispvideo.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
> index 175bbed9a235..d98b8c3ec0b2 100644
> --- a/drivers/media/platform/omap3isp/ispvideo.c
> +++ b/drivers/media/platform/omap3isp/ispvideo.c
> @@ -660,12 +660,6 @@ isp_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
>  
>  	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT
>  		| V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
> -
> -	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
> -		cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> -	else
> -		cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
> -

Could you please keep this blank line ?

>  	return 0;
>  }
>  
> @@ -1463,6 +1457,13 @@ int omap3isp_video_init(struct isp_video *video, const char *name)
>  	video->video.vfl_type = VFL_TYPE_GRABBER;
>  	video->video.release = video_device_release_empty;
>  	video->video.ioctl_ops = &isp_video_ioctl_ops;
> +	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
> +		video->video.device_caps =
> +			V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> +	else
> +		video->video.device_caps =
> +			V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;

Based on the coding style of the driver, this should be

	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
		video->video.device_caps = V4L2_CAP_VIDEO_CAPTURE
					 | V4L2_CAP_STREAMING;
	else
		video->video.device_caps = V4L2_CAP_VIDEO_OUTPUT
					 | V4L2_CAP_STREAMING;

With those minor issues fixed,

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

Please feel free to merge this patch as part of the whole series.

>  	video->pipe.stream_state = ISP_PIPELINE_STREAM_STOPPED;
>  
>  	video_set_drvdata(&video->video, video);

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 11/16] xilinx: set device_caps in struct video_device
  2019-06-26  7:44 ` [PATCH 11/16] xilinx: " Hans Verkuil
@ 2019-06-26  9:44   ` Laurent Pinchart
  0 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2019-06-26  9:44 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

Hi Hans,

Thank you for the patch.

On Wed, Jun 26, 2019 at 09:44:16AM +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-cisco@xs4all.nl>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

Please feel free to merge this patch along with the rest of the series.

> ---
>  drivers/media/platform/xilinx/xilinx-dma.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
> index c9d5fdb2d407..bcd783d9e5ae 100644
> --- a/drivers/media/platform/xilinx/xilinx-dma.c
> +++ b/drivers/media/platform/xilinx/xilinx-dma.c
> @@ -491,15 +491,8 @@ xvip_dma_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
>  	struct v4l2_fh *vfh = file->private_data;
>  	struct xvip_dma *dma = to_xvip_dma(vfh->vdev);
>  
> -	cap->device_caps = V4L2_CAP_STREAMING;
> -
> -	if (dma->queue.type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
> -		cap->device_caps |= V4L2_CAP_VIDEO_CAPTURE;
> -	else
> -		cap->device_caps |= V4L2_CAP_VIDEO_OUTPUT;
> -
> -	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS
> -			  | dma->xdev->v4l2_caps;
> +	cap->capabilities = dma->xdev->v4l2_caps | V4L2_CAP_STREAMING |
> +			    V4L2_CAP_DEVICE_CAPS;
>  
>  	strscpy(cap->driver, "xilinx-vipp", sizeof(cap->driver));
>  	strscpy(cap->card, dma->video.name, sizeof(cap->card));
> @@ -700,6 +693,11 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,
>  	dma->video.release = video_device_release_empty;
>  	dma->video.ioctl_ops = &xvip_dma_ioctl_ops;
>  	dma->video.lock = &dma->lock;
> +	dma->video.device_caps = V4L2_CAP_STREAMING;
> +	if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
> +		dma->video.device_caps |= V4L2_CAP_VIDEO_CAPTURE;
> +	else
> +		dma->video.device_caps |= V4L2_CAP_VIDEO_OUTPUT;
>  
>  	video_set_drvdata(&dma->video, dma);

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 12/16] sh_veu/sh_vou: set device_caps in struct video_device
  2019-06-26  7:44 ` [PATCH 12/16] sh_veu/sh_vou: " Hans Verkuil
@ 2019-06-26 10:25   ` Jacopo Mondi
  0 siblings, 0 replies; 25+ messages in thread
From: Jacopo Mondi @ 2019-06-26 10:25 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

[-- Attachment #1: Type: text/plain, Size: 2582 bytes --]

iHi Hans,

On Wed, Jun 26, 2019 at 09:44:17AM +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-cisco@xs4all.nl>
> Cc: Jacopo Mondi <jacopo@jmondi.org>

Thanks for doing this.

Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

Thanks
   j

> ---
>  drivers/media/platform/sh_veu.c | 4 +---
>  drivers/media/platform/sh_vou.c | 5 ++---
>  2 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
> index 5a9ba05c996e..ab39d6c80920 100644
> --- a/drivers/media/platform/sh_veu.c
> +++ b/drivers/media/platform/sh_veu.c
> @@ -348,9 +348,6 @@ static int sh_veu_querycap(struct file *file, void *priv,
>  	strscpy(cap->driver, "sh-veu", sizeof(cap->driver));
>  	strscpy(cap->card, "sh-mobile VEU", sizeof(cap->card));
>  	strscpy(cap->bus_info, "platform:sh-veu", sizeof(cap->bus_info));
> -	cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
> -	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
> -
>  	return 0;
>  }
>
> @@ -1039,6 +1036,7 @@ static const struct video_device sh_veu_videodev = {
>  	.minor		= -1,
>  	.release	= video_device_release_empty,
>  	.vfl_dir	= VFL_DIR_M2M,
> +	.device_caps	= V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING,
>  };
>
>  static const struct v4l2_m2m_ops sh_veu_m2m_ops = {
> diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
> index 5799aa4b9323..1fe573a90f0d 100644
> --- a/drivers/media/platform/sh_vou.c
> +++ b/drivers/media/platform/sh_vou.c
> @@ -381,9 +381,6 @@ static int sh_vou_querycap(struct file *file, void  *priv,
>  	strscpy(cap->card, "SuperH VOU", sizeof(cap->card));
>  	strscpy(cap->driver, "sh-vou", sizeof(cap->driver));
>  	strscpy(cap->bus_info, "platform:sh-vou", sizeof(cap->bus_info));
> -	cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_READWRITE |
> -			   V4L2_CAP_STREAMING;
> -	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
>  	return 0;
>  }
>
> @@ -1218,6 +1215,8 @@ static const struct video_device sh_vou_video_template = {
>  	.ioctl_ops	= &sh_vou_ioctl_ops,
>  	.tvnorms	= V4L2_STD_525_60, /* PAL only supported in 8-bit non-bt656 mode */
>  	.vfl_dir	= VFL_DIR_TX,
> +	.device_caps	= V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_READWRITE |
> +			  V4L2_CAP_STREAMING,
>  };
>
>  static int sh_vou_probe(struct platform_device *pdev)
> --
> 2.20.1
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 15/16] ti-vpe: set device_caps in struct video_device
  2019-06-26  7:44 ` [PATCH 15/16] ti-vpe: " Hans Verkuil
@ 2019-06-26 14:34   ` Benoit Parrot
  0 siblings, 0 replies; 25+ messages in thread
From: Benoit Parrot @ 2019-06-26 14:34 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

Acked-by: Benoit Parrot <bparrot@ti.com>

Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote on Wed [2019-Jun-26 09:44:20 +0200]:
> 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@xs4all.nl>
> Cc: Benoit Parrot <bparrot@ti.com>
> ---
>  drivers/media/platform/ti-vpe/cal.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
> index 8d075683e448..3fa306a45787 100644
> --- a/drivers/media/platform/ti-vpe/cal.c
> +++ b/drivers/media/platform/ti-vpe/cal.c
> @@ -916,9 +916,6 @@ static int cal_querycap(struct file *file, void *priv,
>  
>  	snprintf(cap->bus_info, sizeof(cap->bus_info),
>  		 "platform:%s", ctx->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;
>  }
>  
> @@ -1422,6 +1419,8 @@ static const struct video_device cal_videodev = {
>  	.ioctl_ops	= &cal_ioctl_ops,
>  	.minor		= -1,
>  	.release	= video_device_release_empty,
> +	.device_caps	= V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
> +			  V4L2_CAP_READWRITE,
>  };
>  
>  /* -----------------------------------------------------------------
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 01/16] am437x/davinci: set device_caps in struct video_device
  2019-06-26  7:44 ` [PATCH 01/16] am437x/davinci: " Hans Verkuil
@ 2019-07-01  7:30   ` Lad, Prabhakar
  0 siblings, 0 replies; 25+ messages in thread
From: Lad, Prabhakar @ 2019-07-01  7:30 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

Hi Hans,

Thank you for the patch.

On Wed, Jun 26, 2019 at 8:44 AM Hans Verkuil <hverkuil-cisco@xs4all.nl> 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@xs4all.nl>
> Cc: prabhakar.csengg@gmail.com
> ---
>  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@gmail.com>

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
>

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2019-07-01  7:31 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26  7:44 [PATCH 00/16] media/platform: set device_caps in struct video_device Hans Verkuil
2019-06-26  7:44 ` [PATCH 01/16] am437x/davinci: " Hans Verkuil
2019-07-01  7:30   ` Lad, Prabhakar
2019-06-26  7:44 ` [PATCH 02/16] coda: " Hans Verkuil
2019-06-26  7:49   ` Philipp Zabel
2019-06-26  7:44 ` [PATCH 03/16] s3c-camif/s5p-g2d/s5p-jpeg: " Hans Verkuil
2019-06-26  7:44 ` [PATCH 04/16] fsl-viu: " Hans Verkuil
2019-06-26  7:44 ` [PATCH 05/16] m2m-deinterlace: " Hans Verkuil
2019-06-26  7:44 ` [PATCH 06/16] mx2_emmaprp: " Hans Verkuil
2019-06-26  7:44 ` [PATCH 07/16] marvell-ccic: " Hans Verkuil
2019-06-26  7:44 ` [PATCH 08/16] pxa_camera: " Hans Verkuil
2019-06-26  7:44 ` [PATCH 09/16] bdisp: " Hans Verkuil
2019-06-26  8:06   ` Fabien DESSENNE
2019-06-26  7:44 ` [PATCH 10/16] via-camera: " Hans Verkuil
2019-06-26  7:44 ` [PATCH 11/16] xilinx: " Hans Verkuil
2019-06-26  9:44   ` Laurent Pinchart
2019-06-26  7:44 ` [PATCH 12/16] sh_veu/sh_vou: " Hans Verkuil
2019-06-26 10:25   ` Jacopo Mondi
2019-06-26  7:44 ` [PATCH 13/16] vsp1: " Hans Verkuil
2019-06-26  9:16   ` Laurent Pinchart
2019-06-26  7:44 ` [PATCH 14/16] omap_vout: " Hans Verkuil
2019-06-26  7:44 ` [PATCH 15/16] ti-vpe: " Hans Verkuil
2019-06-26 14:34   ` Benoit Parrot
2019-06-26  7:44 ` [PATCH 16/16] omap3isp: " Hans Verkuil
2019-06-26  9:25   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).