linux-stable/drivers/media/v4l2-core
Antonio Ospite 759b26a1d9 [media] media/v4l2-ctrls: fix setting autocluster to manual with VIDIOC_S_CTRL
Since commit 5d0360a4f0 it's not possible
anymore to set auto clusters from auto to manual using VIDIOC_S_CTRL.

For example, setting autogain to manual with gspca/ov534 driver and this
sequence of commands does not work:

  v4l2-ctl --set-ctrl=gain_automatic=1
  v4l2-ctl --list-ctrls | grep gain_automatic
  # The following does not work
  v4l2-ctl --set-ctrl=gain_automatic=0
  v4l2-ctl --list-ctrls | grep gain_automatic

Changing the value using VIDIOC_S_EXT_CTRLS (like qv4l2 does) works
fine.

The apparent cause by looking at the changes in 5d0360a and comparing
with the code path for VIDIOC_S_EXT_CTRLS seems to be that the code in
v4l2-ctrls.c::set_ctrl() is not calling user_to_new() anymore after
calling update_from_auto_cluster(master).

However the root cause of the problem is that calling
update_from_auto_cluster(master) overrides also the _master_ control
state calling cur_to_new() while it was supposed to only update the
volatile controls.

Calling user_to_new() after update_from_auto_cluster(master) was just
masking the original bug by restoring the correct new value of the
master control before making the changes permanent.

Fix the original bug by making update_from_auto_cluster() not override
the new master control value.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Cc: <stable@vger.kernel.org>      # for v3.17 and up
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-20 15:58:29 -02:00
..
Kconfig [media] vb2: Provide helpers for mapping virtual addresses 2015-08-16 13:10:42 -03:00
Makefile [media] media: videobuf2: Prepare to divide videobuf2 2015-10-20 15:12:45 -02:00
tuner-core.c [media] Drop owner assignment from i2c_driver 2015-08-11 13:01:57 -03:00
v4l2-async.c v4l: async: Add a pointer to of_node to struct v4l2_subdev, match it 2015-06-15 11:37:05 -07:00
v4l2-clk.c [media] V4L: add CCF support to the v4l2_clk API 2015-04-02 18:33:42 -03:00
v4l2-common.c [media] v4l2-common: move v4l2_ctrl_check to cx2341x 2014-11-25 08:25:36 -02:00
v4l2-compat-ioctl32.c [media] v4l2: add support for SDR transmitter 2015-10-20 15:40:50 -02:00
v4l2-ctrls.c [media] media/v4l2-ctrls: fix setting autocluster to manual with VIDIOC_S_CTRL 2015-10-20 15:58:29 -02:00
v4l2-dev.c [media] v4l2: add support for SDR transmitter 2015-10-20 15:40:50 -02:00
v4l2-device.c [media] v4l2-core: remove the old .ioctl BKL replacement 2015-03-02 17:06:56 -03:00
v4l2-dv-timings.c [media] v4l2-dv-timings: print refresh rate with better precision 2015-07-06 08:25:53 -03:00
v4l2-event.c [media] v4l2-event: v4l2_event_queue: do nothing if vdev == NULL 2015-07-17 09:15:27 -03:00
v4l2-fh.c [media] media: v4l2-core: remove the use of V4L2_FL_USE_FH_PRIO flag 2014-07-04 16:14:22 -03:00
v4l2-flash-led-class.c media: Add registration helpers for V4L2 flash sub-devices 2015-06-22 13:53:16 -07:00
v4l2-ioctl.c [media] v4l: add type field to v4l2_modulator struct 2015-10-20 15:42:47 -02:00
v4l2-mem2mem.c [media] media: videobuf2: Restructure vb2_buffer 2015-10-01 09:04:43 -03:00
v4l2-of.c [media] v4l: of: Correct pclk-sample for BT656 bus 2015-06-06 07:27:04 -03:00
v4l2-subdev.c [media] Add helper function for subdev event notifications 2015-07-17 09:45:50 -03:00
v4l2-trace.c [media] media: videobuf2: Prepare to divide videobuf2 2015-10-20 15:12:45 -02:00
vb2-trace.c [media] media: videobuf2: Prepare to divide videobuf2 2015-10-20 15:12:45 -02:00
videobuf-core.c [media] v4l2: add support for SDR transmitter 2015-10-20 15:40:50 -02:00
videobuf-dma-contig.c [media] videobuf-dma-contig: set vm_pgoff to be zero to pass the sanity check in vm_iomap_memory() 2014-10-24 09:32:41 -02:00
videobuf-dma-sg.c [media] videobuf: make unused exported functions static 2015-01-27 10:01:33 -02:00
videobuf-dvb.c
videobuf-vmalloc.c [media] Revert "[media] videobuf_vm_{open,close} race fixes" 2014-02-04 06:29:46 -02:00
videobuf2-core.c [media] media: videobuf2: Move v4l2-specific stuff to videobuf2-v4l2 2015-10-20 15:14:28 -02:00
videobuf2-dma-contig.c [media] media: vb2 dma-contig: Fully cache synchronise buffers in prepare and finish 2015-10-20 14:35:52 -02:00
videobuf2-dma-sg.c [media] media: vb2 dma-sg: Fully cache synchronise buffers in prepare and finish 2015-10-20 14:36:24 -02:00
videobuf2-dvb.c [media] vb2: Add videobuf2-dvb support 2014-04-16 18:59:29 -03:00
videobuf2-internal.h [media] media: videobuf2: Move v4l2-specific stuff to videobuf2-v4l2 2015-10-20 15:14:28 -02:00
videobuf2-memops.c [media] media: videobuf2: Replace videobuf2-core with videobuf2-v4l2 2015-10-01 08:48:18 -03:00
videobuf2-v4l2.c [media] media: videobuf2: Move v4l2-specific stuff to videobuf2-v4l2 2015-10-20 15:14:28 -02:00
videobuf2-vmalloc.c [media] media: videobuf2: Replace videobuf2-core with videobuf2-v4l2 2015-10-01 08:48:18 -03:00