ivtv: fix incorrect device_caps for ivtvfb
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Sun, 6 Mar 2022 11:29:11 +0000 (12:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:21 +0000 (14:23 +0200)
commit1e77cab218e4848f2185a404a27ff6117932d1ca
tree9869a5cb60388ba673fe7a7e2111bbfb528f78a5
parenta8523efdc9463bd1f2c5a85d3ddc49b096e58739
ivtv: fix incorrect device_caps for ivtvfb

[ Upstream commit 25e94139218c0293b4375233c14f2256d7dcfaa8 ]

The VIDIOC_G_FBUF and related overlay ioctls no longer worked (-ENOTTY was
returned).

The root cause was the introduction of the caps field in ivtv-driver.h.
While loading the ivtvfb module would update the video_device device_caps
field with V4L2_CAP_VIDEO_OUTPUT_OVERLAY it would not update that caps
field, and that's what the overlay ioctls would look at.

It's a bad idea to keep information in two places, so drop the caps field
and only use vdev.device_caps.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: Martin Dauskardt <martin.dauskardt@gmx.de>
Fixes: 2161536516ed (media: media/pci: set device_caps in struct video_device)
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/pci/ivtv/ivtv-driver.h
drivers/media/pci/ivtv/ivtv-ioctl.c
drivers/media/pci/ivtv/ivtv-streams.c