linux/drivers/media
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
..
common [media] saa7146: use swap() in sort_and_eliminate() 2015-07-06 08:25:49 -03:00
dvb-core [media] demux.h: Convert MPEG-TS demux caps to an enum 2015-10-10 10:29:08 -03:00
dvb-frontends [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
firewire [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
i2c [media] smiapp: Export OF module alias information 2015-10-20 14:32:05 -02:00
mmc [media] siano: register media controller earlier 2015-02-26 09:10:39 -03:00
pci [media] media: videobuf2: Change queue_setup argument 2015-10-20 14:48:39 -02:00
platform [media] media/vivid-osd: fix info leak in ioctl 2015-10-20 15:34:29 -02:00
radio [media] radio: Drop owner assignment from i2c_driver 2015-08-11 13:01:08 -03:00
rc media updates for v4.3-rc1 2015-09-05 18:21:14 -07:00
tuners [media] tuners: Drop owner assignment from i2c_driver 2015-08-11 13:01:32 -03:00
usb [media] hackrf: do not set human readable name for formats 2015-10-20 15:55:28 -02:00
v4l2-core [media] media/v4l2-ctrls: fix setting autocluster to manual with VIDIOC_S_CTRL 2015-10-20 15:58:29 -02:00
Kconfig media updates for v4.2-rc1 2015-06-25 17:55:48 -07:00
Makefile [media] bq/c-qcam, w9966, pms: move to staging in preparation for removal 2014-12-16 23:21:44 -02:00
media-device.c [media] media: Use strlcpy instead of custom code 2014-09-21 20:27:08 -03:00
media-devnode.c [media] media-devnode: just return 0 instead of using a var 2014-09-03 17:59:28 -03:00
media-entity.c [media] media-entity.c: get rid of var length arrays 2015-10-01 18:10:05 -03:00