From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34704 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751315AbcBMXDI (ORCPT ); Sat, 13 Feb 2016 18:03:08 -0500 Subject: Patch "[media] media/v4l2-ctrls: fix setting autocluster to manual with VIDIOC_S_CTRL" has been added to the 4.3-stable tree To: ao2@ao2.it, gregkh@linuxfoundation.org, hans.verkuil@cisco.com, mchehab@osg.samsung.com Cc: , From: Date: Sat, 13 Feb 2016 15:03:07 -0800 Message-ID: <145540458779181@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled [media] media/v4l2-ctrls: fix setting autocluster to manual with VIDIOC_S_CTRL to the 4.3-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: media-v4l2-ctrls-fix-setting-autocluster-to-manual-with-vidioc_s_ctrl.patch and it can be found in the queue-4.3 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 759b26a1d916400a1a20948eb964dea6ad0bd9e9 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 14 Oct 2015 10:57:32 -0300 Subject: [media] media/v4l2-ctrls: fix setting autocluster to manual with VIDIOC_S_CTRL From: Antonio Ospite commit 759b26a1d916400a1a20948eb964dea6ad0bd9e9 upstream. Since commit 5d0360a4f027576e5419d4a7c711c9ca0f1be8ca 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/v4l2-core/v4l2-ctrls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -3043,7 +3043,7 @@ static void update_from_auto_cluster(str { int i; - for (i = 0; i < master->ncontrols; i++) + for (i = 1; i < master->ncontrols; i++) cur_to_new(master->cluster[i]); if (!call_op(master, g_volatile_ctrl)) for (i = 1; i < master->ncontrols; i++) Patches currently in stable-queue which might be from ao2@ao2.it are queue-4.3/media-v4l2-ctrls-fix-setting-autocluster-to-manual-with-vidioc_s_ctrl.patch