Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600720

Re: [PATCH v5 00/39] i.MX Media Driver

From Steve Longerbeam <steve_longerbeam@mentor.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 00/39] i.MX Media Driver
Date 2017-03-14 18:10 +0100
Message-ID <tkY7p-3hF-45@gated-at.bofh.it> (permalink)
References <tjkOJ-708-5@gated-at.bofh.it> <tkhF8-61I-9@gated-at.bofh.it> <tkiKR-6Jc-1@gated-at.bofh.it> <tkj4d-77v-1@gated-at.bofh.it> <tkk0h-7Lv-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 03/12/2017 03:10 PM, Mauro Carvalho Chehab wrote:
> Em Sun, 12 Mar 2017 21:13:24 +0000
> Russell King - ARM Linux <linux@armlinux.org.uk> escreveu:
>
>> On Sun, Mar 12, 2017 at 05:59:28PM -0300, Mauro Carvalho Chehab wrote:
>>> Yet, udev/systemd has some rules that provide an unique name for V4L
>>> devices at /lib/udev/rules.d/60-persistent-v4l.rules. Basically, it
>>> runs a small application (v4l_id) with creates a persistent symling
>>> using rules like this:
>>>
>>> 	KERNEL=="video*", ENV{ID_SERIAL}=="?*", SYMLINK+="v4l/by-id/$env{ID_BUS}-$env{ID_SERIAL}-video-index$attr{index}"
>>>
>>> Those names are stored at /dev/v4l/by-path.
>> This doesn't help:
>>
>> $ ls -Al /dev/v4l/by-id/
>> total 0
>> lrwxrwxrwx 1 root root 13 Mar 12 19:54 usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera-video-index0 -> ../../video10
>> $ ls -Al /dev/v4l/by-path/
>> total 0
>> lrwxrwxrwx 1 root root 12 Mar 12 19:54 platform-2040000.vpu-video-index0 -> ../../video0
>> lrwxrwxrwx 1 root root 12 Mar 12 19:54 platform-2040000.vpu-video-index1 -> ../../video1
>> lrwxrwxrwx 1 root root 12 Mar 12 20:53 platform-capture-subsystem-video-index0 -> ../../video2
>> lrwxrwxrwx 1 root root 12 Mar 12 20:53 platform-capture-subsystem-video-index1 -> ../../video3
>> lrwxrwxrwx 1 root root 12 Mar 12 20:53 platform-capture-subsystem-video-index2 -> ../../video4
>> lrwxrwxrwx 1 root root 12 Mar 12 20:53 platform-capture-subsystem-video-index3 -> ../../video5
>> lrwxrwxrwx 1 root root 12 Mar 12 20:53 platform-capture-subsystem-video-index4 -> ../../video6
>> lrwxrwxrwx 1 root root 12 Mar 12 20:53 platform-capture-subsystem-video-index5 -> ../../video7
>> lrwxrwxrwx 1 root root 12 Mar 12 20:53 platform-capture-subsystem-video-index6 -> ../../video8
>> lrwxrwxrwx 1 root root 12 Mar 12 20:53 platform-capture-subsystem-video-index7 -> ../../video9
>> lrwxrwxrwx 1 root root 13 Mar 12 19:54 platform-ci_hdrc.0-usb-0:1:1.0-video-index0 -> ../../video10
>>
>> The problem is the "platform-capture-subsystem-video-index" entries.
>> These themselves change order.  For instance, I now have:
>>
>> - entity 72: ipu1_csi0 capture (1 pad, 1 link)
>>               type Node subtype V4L flags 0
>>               device node name /dev/video6
>>
>> which means it's platform-capture-subsystem-video-index4.  Before, it
>> was platform-capture-subsystem-video-index2.
> That's a driver problem. v4l_id gets information to build the persistent
> name from the result of VIDIOC_QUERYCAP.
>
> In the case of Exynos gsc driver, for example, the information is here:
>
> static int gsc_m2m_querycap(struct file *file, void *fh,
> 			   struct v4l2_capability *cap)
> {
> 	struct gsc_ctx *ctx = fh_to_ctx(fh);
> 	struct gsc_dev *gsc = ctx->gsc_dev;
>
> 	strlcpy(cap->driver, GSC_MODULE_NAME, sizeof(cap->driver));
> 	strlcpy(cap->card, GSC_MODULE_NAME " gscaler", sizeof(cap->card));
> 	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> 		 dev_name(&gsc->pdev->dev));
> 	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE |
> 		V4L2_CAP_VIDEO_CAPTURE_MPLANE |	V4L2_CAP_VIDEO_OUTPUT_MPLANE;
>
> 	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
> 	return 0;
> }
>
> See that the bus_info there is filled with:
>
> 	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", dev_name(&gsc->pdev->dev));
>
>  From the output you printed, it seems that the i.MX6 is just doing:
> 	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:");
> for some devices.

imx6 is setting bus_info string on all capture devices as:

snprintf(cap->bus_info, sizeof(cap->bus_info),
                  "platform:%s", dev_name(priv->dev));

dev_name(priv->dev) is the device name of the attached subdev.
So the bus_info string, at least for attached CSI subdevs, should
be "platform:imx-ipuv3-csi".

Maybe there is something else missing, I haven't had a chance to
look at this yet.

Steve


>
> If you change the i.MX6 driver to do the same, you'll likely be able to
> have unique names there too.
>
> Regards,
> Mauro

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v5 00/39] i.MX Media Driver Steve Longerbeam <steve_longerbeam@mentor.com> - 2017-03-14 18:10 +0100

csiph-web