]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
media: uvcvideo: Accept invalid bFormatIndex and bFrameIndex values
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 20 Dec 2020 14:11:13 +0000 (15:11 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Apr 2021 16:31:27 +0000 (18:31 +0200)
commit0e947e57451a81d8196471417169cf905e4ee85e
tree0fa7339d4154cb95580f455295f5a3fc8bd2266b
parent9d9020e15e1656b0c9eb8a2b70df9e6ff8906f9f
media: uvcvideo: Accept invalid bFormatIndex and bFrameIndex values

BugLink: https://bugs.launchpad.net/bugs/1918974
[ Upstream commit dc9455ffae02d7b7fb51ba1e007fffcb9dc5d890 ]

The Renkforce RF AC4K 300 Action Cam 4K reports invalid bFormatIndex and
bFrameIndex values when negotiating the video probe and commit controls.
The UVC descriptors report a single supported format and frame size,
with bFormatIndex and bFrameIndex both equal to 2, but the video probe
and commit controls report bFormatIndex and bFrameIndex set to 1.

The device otherwise operates correctly, but the driver rejects the
values and fails the format try operation. Fix it by ignoring the
invalid indices, and assuming that the format and frame requested by the
driver are accepted by the device.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=210767
Fixes: 8a652a17e3c0 ("media: uvcvideo: Ensure all probed info is returned to v4l2")
Reported-by: Till Dörges <doerges@pre-sense.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/media/usb/uvc/uvc_v4l2.c