media: media/pci: set device_caps in struct video_device

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 pci drivers in this patch.

Tested with cx88-blackbird and ivtv PVR-350.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
这个提交包含在:
Hans Verkuil
2019-06-17 05:36:16 -04:00
提交者 Mauro Carvalho Chehab
父节点 374d62e7aa
当前提交 2161536516
修改 27 个文件,包含 159 行新增192 行删除

查看文件

@@ -483,13 +483,8 @@ static int cobalt_querycap(struct file *file, void *priv_fh,
strscpy(vcap->card, "cobalt", sizeof(vcap->card));
snprintf(vcap->bus_info, sizeof(vcap->bus_info),
"PCIe:%s", pci_name(cobalt->pci_dev));
vcap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
if (s->is_output)
vcap->device_caps |= V4L2_CAP_VIDEO_OUTPUT;
else
vcap->device_caps |= V4L2_CAP_VIDEO_CAPTURE;
vcap->capabilities = vcap->device_caps | V4L2_CAP_DEVICE_CAPS |
V4L2_CAP_VIDEO_CAPTURE;
vcap->capabilities = V4L2_CAP_STREAMING | V4L2_CAP_READWRITE |
V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_DEVICE_CAPS;
if (cobalt->have_hsma_tx)
vcap->capabilities |= V4L2_CAP_VIDEO_OUTPUT;
return 0;
@@ -1274,6 +1269,11 @@ static int cobalt_node_register(struct cobalt *cobalt, int node)
q->lock = &s->lock;
q->dev = &cobalt->pci_dev->dev;
vdev->queue = q;
vdev->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
if (s->is_output)
vdev->device_caps |= V4L2_CAP_VIDEO_OUTPUT;
else
vdev->device_caps |= V4L2_CAP_VIDEO_CAPTURE;
video_set_drvdata(vdev, s);
ret = vb2_queue_init(q);