Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

staging: media: tegra-video: vi: add flip controls only if no source controls are provided

Because the current Tegra video driver is video-centric, it exposes all
controls via /dev/video. If both the camera sensor and the VI provide
hflip and vflip, the driver will fail because only one control is allowed.
To address this, hflip and vflip should be added from the SoC only if the
camera sensor doesn't provide those controls.

Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # tegra20, parallel camera
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Svyatoslav Ryhel and committed by
Hans Verkuil
4c9f5dc5 8a501119

+6 -3
+6 -3
drivers/staging/media/tegra-video/vi.c
··· 962 962 } 963 963 #else 964 964 struct v4l2_subdev *subdev; 965 + struct v4l2_ctrl *hflip, *vflip; 965 966 966 967 /* custom control */ 967 968 v4l2_ctrl_new_custom(&chan->ctrl_handler, &syncpt_timeout_ctrl, NULL); ··· 988 987 return ret; 989 988 } 990 989 991 - if (chan->vi->soc->has_h_v_flip) { 990 + hflip = v4l2_ctrl_find(subdev->ctrl_handler, V4L2_CID_HFLIP); 991 + if (chan->vi->soc->has_h_v_flip && !hflip) 992 992 v4l2_ctrl_new_std(&chan->ctrl_handler, &vi_ctrl_ops, V4L2_CID_HFLIP, 0, 1, 1, 0); 993 - v4l2_ctrl_new_std(&chan->ctrl_handler, &vi_ctrl_ops, V4L2_CID_VFLIP, 0, 1, 1, 0); 994 - } 995 993 994 + vflip = v4l2_ctrl_find(subdev->ctrl_handler, V4L2_CID_VFLIP); 995 + if (chan->vi->soc->has_h_v_flip && !vflip) 996 + v4l2_ctrl_new_std(&chan->ctrl_handler, &vi_ctrl_ops, V4L2_CID_VFLIP, 0, 1, 1, 0); 996 997 #endif 997 998 998 999 /* setup the controls */