Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] uvc/vsp1/ipu3: use VFL_TYPE_METADATA for metadata device.
@ 2019-09-11 10:10 Vandana BN
  2019-09-14  3:14 ` kbuild test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Vandana BN @ 2019-09-11 10:10 UTC (permalink / raw)
  To: laurent.pinchart, sakari.ailus, linux-media, linux-kernel-mentees
  Cc: hverkuil, Vandana BN

Use vfl_type VFL_TYPE_METADATA instead of VFL_TYPE_GRABBER for metadata device.

Signed-off-by: Vandana BN <bnvandana@gmail.com>
---
 drivers/media/platform/vsp1/vsp1_histo.c | 4 ++--
 drivers/media/usb/uvc/uvc_driver.c       | 4 +++-
 drivers/staging/media/ipu3/ipu3-v4l2.c   | 8 +++++++-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_histo.c b/drivers/media/platform/vsp1/vsp1_histo.c
index 30d751f2cccf..1e1429817758 100644
--- a/drivers/media/platform/vsp1/vsp1_histo.c
+++ b/drivers/media/platform/vsp1/vsp1_histo.c
@@ -551,7 +551,7 @@ int vsp1_histogram_init(struct vsp1_device *vsp1, struct vsp1_histogram *histo,
 	histo->video.fops = &histo_v4l2_fops;
 	snprintf(histo->video.name, sizeof(histo->video.name),
 		 "%s histo", histo->entity.subdev.name);
-	histo->video.vfl_type = VFL_TYPE_GRABBER;
+	histo->video.vfl_type = VFL_TYPE_METADATA;
 	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;
@@ -576,7 +576,7 @@ int vsp1_histogram_init(struct vsp1_device *vsp1, struct vsp1_histogram *histo,
 
 	/* ... and register the video device. */
 	histo->video.queue = &histo->queue;
-	ret = video_register_device(&histo->video, VFL_TYPE_GRABBER, -1);
+	ret = video_register_device(&histo->video, VFL_TYPE_METADATA, -1);
 	if (ret < 0) {
 		dev_err(vsp1->dev, "failed to register video device\n");
 		goto error;
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 66ee168ddc7e..cf2e23238268 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1942,6 +1942,7 @@ int uvc_register_video_device(struct uvc_device *dev,
 			      const struct v4l2_ioctl_ops *ioctl_ops)
 {
 	int ret;
+	int vfl_type = VFL_TYPE_GRABBER;
 
 	/* Initialize the video buffers queue. */
 	ret = uvc_queue_init(queue, type, !uvc_no_drop_param);
@@ -1975,6 +1976,7 @@ int uvc_register_video_device(struct uvc_device *dev,
 		break;
 	case V4L2_BUF_TYPE_META_CAPTURE:
 		vdev->device_caps = V4L2_CAP_META_CAPTURE | V4L2_CAP_STREAMING;
+		vfl_type = VFL_TYPE_METADATA;
 		break;
 	}
 
@@ -1986,7 +1988,7 @@ int uvc_register_video_device(struct uvc_device *dev,
 	 */
 	video_set_drvdata(vdev, stream);
 
-	ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
+	ret = video_register_device(vdev, vfl_type, -1);
 	if (ret < 0) {
 		uvc_printk(KERN_ERR, "Failed to register %s device (%d).\n",
 			   v4l2_type_names[type], ret);
diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c
index 3c7ad1eed434..56fab0de4342 100644
--- a/drivers/staging/media/ipu3/ipu3-v4l2.c
+++ b/drivers/staging/media/ipu3/ipu3-v4l2.c
@@ -1245,7 +1245,13 @@ static int imgu_v4l2_node_setup(struct imgu_device *imgu, unsigned int pipe,
 	vdev->queue = &node->vbq;
 	vdev->vfl_dir = node->output ? VFL_DIR_TX : VFL_DIR_RX;
 	video_set_drvdata(vdev, imgu);
-	r = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
+
+	if (vbq->type == V4L2_BUF_TYPE_META_CAPTURE ||
+	    vbq->type == V4L2_BUF_TYPE_META_OUTPUT)
+		r = video_register_device(vdev, VFL_TYPE_METADATA, -1);
+	else
+		r = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
+
 	if (r) {
 		dev_err(dev, "failed to register video device (%d)", r);
 		media_entity_cleanup(&vdev->entity);
-- 
2.17.1


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

* Re: [PATCH] uvc/vsp1/ipu3: use VFL_TYPE_METADATA for metadata device.
  2019-09-11 10:10 [PATCH] uvc/vsp1/ipu3: use VFL_TYPE_METADATA for metadata device Vandana BN
@ 2019-09-14  3:14 ` kbuild test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2019-09-14  3:14 UTC (permalink / raw)
  To: Vandana BN
  Cc: kbuild-all, laurent.pinchart, sakari.ailus, linux-media,
	linux-kernel-mentees, hverkuil, Vandana BN

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

Hi Vandana,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[cannot apply to v5.3-rc8 next-20190904]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Vandana-BN/uvc-vsp1-ipu3-use-VFL_TYPE_METADATA-for-metadata-device/20190914-074954
base:   git://linuxtv.org/media_tree.git master
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/media/usb/uvc/uvc_driver.c: In function 'uvc_register_video_device':
>> drivers/media/usb/uvc/uvc_driver.c:1979:14: error: 'VFL_TYPE_METADATA' undeclared (first use in this function); did you mean 'VFL_TYPE_MAX'?
      vfl_type = VFL_TYPE_METADATA;
                 ^~~~~~~~~~~~~~~~~
                 VFL_TYPE_MAX
   drivers/media/usb/uvc/uvc_driver.c:1979:14: note: each undeclared identifier is reported only once for each function it appears in
--
   drivers/media/platform/vsp1/vsp1_histo.c: In function 'vsp1_histogram_init':
>> drivers/media/platform/vsp1/vsp1_histo.c:554:26: error: 'VFL_TYPE_METADATA' undeclared (first use in this function); did you mean 'VFL_TYPE_MAX'?
     histo->video.vfl_type = VFL_TYPE_METADATA;
                             ^~~~~~~~~~~~~~~~~
                             VFL_TYPE_MAX
   drivers/media/platform/vsp1/vsp1_histo.c:554:26: note: each undeclared identifier is reported only once for each function it appears in

vim +1979 drivers/media/usb/uvc/uvc_driver.c

  1935	
  1936	int uvc_register_video_device(struct uvc_device *dev,
  1937				      struct uvc_streaming *stream,
  1938				      struct video_device *vdev,
  1939				      struct uvc_video_queue *queue,
  1940				      enum v4l2_buf_type type,
  1941				      const struct v4l2_file_operations *fops,
  1942				      const struct v4l2_ioctl_ops *ioctl_ops)
  1943	{
  1944		int ret;
  1945		int vfl_type = VFL_TYPE_GRABBER;
  1946	
  1947		/* Initialize the video buffers queue. */
  1948		ret = uvc_queue_init(queue, type, !uvc_no_drop_param);
  1949		if (ret)
  1950			return ret;
  1951	
  1952		/* Register the device with V4L. */
  1953	
  1954		/*
  1955		 * We already hold a reference to dev->udev. The video device will be
  1956		 * unregistered before the reference is released, so we don't need to
  1957		 * get another one.
  1958		 */
  1959		vdev->v4l2_dev = &dev->vdev;
  1960		vdev->fops = fops;
  1961		vdev->ioctl_ops = ioctl_ops;
  1962		vdev->release = uvc_release;
  1963		vdev->prio = &stream->chain->prio;
  1964		if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
  1965			vdev->vfl_dir = VFL_DIR_TX;
  1966		else
  1967			vdev->vfl_dir = VFL_DIR_RX;
  1968	
  1969		switch (type) {
  1970		case V4L2_BUF_TYPE_VIDEO_CAPTURE:
  1971		default:
  1972			vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
  1973			break;
  1974		case V4L2_BUF_TYPE_VIDEO_OUTPUT:
  1975			vdev->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
  1976			break;
  1977		case V4L2_BUF_TYPE_META_CAPTURE:
  1978			vdev->device_caps = V4L2_CAP_META_CAPTURE | V4L2_CAP_STREAMING;
> 1979			vfl_type = VFL_TYPE_METADATA;
  1980			break;
  1981		}
  1982	
  1983		strscpy(vdev->name, dev->name, sizeof(vdev->name));
  1984	
  1985		/*
  1986		 * Set the driver data before calling video_register_device, otherwise
  1987		 * the file open() handler might race us.
  1988		 */
  1989		video_set_drvdata(vdev, stream);
  1990	
  1991		ret = video_register_device(vdev, vfl_type, -1);
  1992		if (ret < 0) {
  1993			uvc_printk(KERN_ERR, "Failed to register %s device (%d).\n",
  1994				   v4l2_type_names[type], ret);
  1995			return ret;
  1996		}
  1997	
  1998		kref_get(&dev->ref);
  1999		return 0;
  2000	}
  2001	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 54564 bytes --]

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 10:10 [PATCH] uvc/vsp1/ipu3: use VFL_TYPE_METADATA for metadata device Vandana BN
2019-09-14  3:14 ` kbuild test robot

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org linux-media@archiver.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/ public-inbox