media: intel/ipu6: set the bus_info of the v4l2_capability
Subsystems (2)
PATCH 1/1 media: intel/ipu6: set the bus_info of the v4l2_capability
From: Bingbu Cao <[email protected]>
IPU6 isys driver missed setting the bus_info of its v4l2_capability. v4l2-ctl --all cannot show the bus_info. This patch copy the bus_info from the media device to fill the v4l2_capability.
--- drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +2 -0
@@ -146,6 +146,8 @@ static int ipu6_isys_vidioc_querycap(struct file *file, void *fh,strscpy (cap->driver,IPU6_ISYS_NAME ,sizeof (cap->driver));strscpy (cap->card, av->isys->media_dev.model,sizeof (cap->card)); +strscpy (cap->bus_info, av->isys->media_dev.bus_info, +sizeof (cap->bus_info));return 0 ; }
Signature · 1 line
2.34.1
Sakari Ailus
maintainerHi Bingbu,
Thanks for the patch.
Quoted 18 lines · On Wed, Feb 12, 2025 at 03:53:14PM +0800, [email protected] wrote:
From: Bingbu Cao <[email protected]>
IPU6 isys driver missed setting the
bus_infoof itsv4l2_capability.v4l2-ctl --allcannot show thebus_info. This patch copy thebus_infofrom the media device to fill thev4l2_capability.Fixes 3c1dfb5a69cf ("media: intel/ipu6: input system video nodes and buffer queues")Signed-off-by Hidenori Kobayashi <[email protected]>Signed-off-by Bingbu Cao <[email protected]>--- drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 2 ++ 1 file changed, 2 insertions(+)drivers/media/pci/intel/ipu6/ipu6-isys-video.c +0
-0
drivers/media/pci/intel/ipu6/ipu6-isys-video.c static int ipu6_isys_vidioc_querycap(struct file *file, void *fh, · line 150
Quoted 5 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +2
-0@@ -146,6 +146,8 @@ static int ipu6_isys_vidioc_querycap(struct file *file, void *fh,strscpy (cap->driver,IPU6_ISYS_NAME ,sizeof (cap->driver));strscpy (cap->card, av->isys->media_dev.model,sizeof (cap->card)); +strscpy (cap->bus_info, av->isys->media_dev.bus_info, +sizeof (cap->bus_info));
Is there a need to do this? The bus_info is set by the framework based on struct video_device dev_parent field and that comes from struct v4l2_device dev field.
Quoted 3 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +0
-0return 0 ; }
Signature · 3 lines
Kind regards, Sakari Ailus
Quoted 24 lines · Sakari Ailus
Hi Bingbu,
Thanks for the patch.
Quoted 19 lines · On Wed, Feb 12, 2025 at 03:53:14PM +0800, [email protected] wrote:
From: Bingbu Cao <[email protected]>
IPU6 isys driver missed setting the
bus_infoof itsv4l2_capability.v4l2-ctl --allcannot show thebus_info. This patch copy thebus_infofrom the media device to fill thev4l2_capability.Fixes 3c1dfb5a69cf ("media: intel/ipu6: input system video nodes and buffer queues")Signed-off-by Hidenori Kobayashi <[email protected]>Signed-off-by Bingbu Cao <[email protected]>--- drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 2 ++ 1 file changed, 2 insertions(+)drivers/media/pci/intel/ipu6/ipu6-isys-video.c +0
-0@@ -146,6 +146,8 @@ static int ipu6_isys_vidioc_querycap(struct file *file, void *fh,
Quoted 9 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c static int ipu6_isys_vidioc_querycap(struct file *file, void *fh, · line 150
Quoted 4 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +2
-0strscpy (cap->driver,IPU6_ISYS_NAME ,sizeof (cap->driver));strscpy (cap->card, av->isys->media_dev.model,sizeof (cap->card)); +strscpy (cap->bus_info, av->isys->media_dev.bus_info, +sizeof (cap->bus_info));Is there a need to do this? The
bus_infois set by the framework based on structvideo_devicedev_parentfield and that comes from structv4l2_devicedev field.
The v4l2_device.dev filed is set to the dev_parent which is auxdev.dev instead of pdev. So the bus_info was not set by framework.
Quoted 4 lines
Quoted 3 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +0
-0return 0 ; }
Signature · 2 lines
Best regards, Bingbu Cao
Quoted 37 lines · Bingbu Cao
Quoted 24 lines · Sakari Ailus
Hi Bingbu,
Thanks for the patch.
Quoted 19 lines · On Wed, Feb 12, 2025 at 03:53:14PM +0800, [email protected] wrote:
From: Bingbu Cao <[email protected]>
IPU6 isys driver missed setting the
bus_infoof itsv4l2_capability.v4l2-ctl --allcannot show thebus_info. This patch copy thebus_infofrom the media device to fill thev4l2_capability.Fixes 3c1dfb5a69cf ("media: intel/ipu6: input system video nodes and buffer queues")Signed-off-by Hidenori Kobayashi <[email protected]>Signed-off-by Bingbu Cao <[email protected]>--- drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 2 ++ 1 file changed, 2 insertions(+)drivers/media/pci/intel/ipu6/ipu6-isys-video.c +0
-0@@ -146,6 +146,8 @@ static int ipu6_isys_vidioc_querycap(struct file *file, void *fh,Quoted 9 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c static int ipu6_isys_vidioc_querycap(struct file *file, void *fh, · line 150
Quoted 4 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +2
-0strscpy (cap->driver,IPU6_ISYS_NAME ,sizeof (cap->driver));strscpy (cap->card, av->isys->media_dev.model,sizeof (cap->card)); +strscpy (cap->bus_info, av->isys->media_dev.bus_info, +sizeof (cap->bus_info));Is there a need to do this? The
bus_infois set by the framework based on structvideo_devicedev_parentfield and that comes from structv4l2_devicedev field.
Quoted 3 lines
The v4l2_device.dev filed is set to the
dev_parentwhich is auxdev.dev instead of pdev. So thebus_infowas not set by framework.
I remember we made a change in isys_register_devices() :
- ret = v4l2_device_register(dev->parent, &isys->v4l2_dev);
+ ret = v4l2_device_register(dev, &isys->v4l2_dev);
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +0
-0return 0 ; }
Signature · 2 lines
Best regards, Bingbu Cao
Sakari Ailus
maintainerHi Bingbu,
Quoted 45 lines · Bingbu Cao
Quoted 37 lines · Bingbu Cao
Quoted 24 lines · Sakari Ailus
Hi Bingbu,
Thanks for the patch.
Quoted 19 lines · On Wed, Feb 12, 2025 at 03:53:14PM +0800, [email protected] wrote:
From: Bingbu Cao <[email protected]>
IPU6 isys driver missed setting the
bus_infoof itsv4l2_capability.v4l2-ctl --allcannot show thebus_info. This patch copy thebus_infofrom the media device to fill thev4l2_capability.Fixes 3c1dfb5a69cf ("media: intel/ipu6: input system video nodes and buffer queues")Signed-off-by Hidenori Kobayashi <[email protected]>Signed-off-by Bingbu Cao <[email protected]>--- drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 2 ++ 1 file changed, 2 insertions(+)drivers/media/pci/intel/ipu6/ipu6-isys-video.c +0
-0@@ -146,6 +146,8 @@ static int ipu6_isys_vidioc_querycap(struct file *file, void *fh,Quoted 9 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c static int ipu6_isys_vidioc_querycap(struct file *file, void *fh, · line 150
Quoted 4 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +2
-0strscpy (cap->driver,IPU6_ISYS_NAME ,sizeof (cap->driver));strscpy (cap->card, av->isys->media_dev.model,sizeof (cap->card)); +strscpy (cap->bus_info, av->isys->media_dev.bus_info, +sizeof (cap->bus_info));Is there a need to do this? The
bus_infois set by the framework based on structvideo_devicedev_parentfield and that comes from structv4l2_devicedev field.Quoted 3 lines
The v4l2_device.dev filed is set to the
dev_parentwhich is auxdev.dev instead of pdev. So thebus_infowas not set by framework.I remember we made a change in
isys_register_devices():
Review
Quoted 2 lines
(quoted diff) +1
-1- ret = v4l2_device_register(dev->parent, &isys->v4l2_dev); + ret = v4l2_device_register(dev, &isys->v4l2_dev);
Right. I vaguely recall there were changes in device assignments over the course of upstreaming, due to the sub-device driver module refcounting. So I think this needs to stay as-is.
Instead, would assigning the dev_parent field in struct video_device achieve this or would there be side effects? The other alternative is to use media_set_bus_info().
Signature · 3 lines
Regards, Sakari Ailus
Sakari,
Quoted 55 lines · Sakari Ailus
Hi Bingbu,
Quoted 45 lines · Bingbu Cao
Quoted 37 lines · Bingbu Cao
Quoted 24 lines · Sakari Ailus
Hi Bingbu,
Thanks for the patch.
Quoted 19 lines · On Wed, Feb 12, 2025 at 03:53:14PM +0800, [email protected] wrote:
From: Bingbu Cao <[email protected]>
IPU6 isys driver missed setting the
bus_infoof itsv4l2_capability.v4l2-ctl --allcannot show thebus_info. This patch copy thebus_infofrom the media device to fill thev4l2_capability.Fixes 3c1dfb5a69cf ("media: intel/ipu6: input system video nodes and buffer queues")Signed-off-by Hidenori Kobayashi <[email protected]>Signed-off-by Bingbu Cao <[email protected]>--- drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 2 ++ 1 file changed, 2 insertions(+)drivers/media/pci/intel/ipu6/ipu6-isys-video.c +0
-0@@ -146,6 +146,8 @@ static int ipu6_isys_vidioc_querycap(struct file *file, void *fh,Quoted 9 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c static int ipu6_isys_vidioc_querycap(struct file *file, void *fh, · line 150
Quoted 4 lines
drivers/media/pci/intel/ipu6/ipu6-isys-video.c +2
-0strscpy (cap->driver,IPU6_ISYS_NAME ,sizeof (cap->driver));strscpy (cap->card, av->isys->media_dev.model,sizeof (cap->card)); +strscpy (cap->bus_info, av->isys->media_dev.bus_info, +sizeof (cap->bus_info));Is there a need to do this? The
bus_infois set by the framework based on structvideo_devicedev_parentfield and that comes from structv4l2_devicedev field.Quoted 3 lines
The v4l2_device.dev filed is set to the
dev_parentwhich is auxdev.dev instead of pdev. So thebus_infowas not set by framework.I remember we made a change in
isys_register_devices():Review
Quoted 2 lines
(quoted diff) +1
-1- ret = v4l2_device_register(dev->parent, &isys->v4l2_dev); + ret = v4l2_device_register(dev, &isys->v4l2_dev);Right. I vaguely recall there were changes in device assignments over the course of upstreaming, due to the sub-device driver module refcounting. So I think this needs to stay as-is.
Quoted 4 lines
Instead, would assigning the
dev_parentfield in structvideo_deviceachieve this or would there be side effects? The other alternative is to usemedia_set_bus_info().
I prefer assigning the dev_parent. I did some simple test and did not observe side effects. Let me do more tests and then send v2.
Signature · 2 lines
Best regards, Bingbu Cao