From patchwork Tue Feb 17 14:41:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 5840191 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 520D49F30C for ; Tue, 17 Feb 2015 14:41:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80B68201E4 for ; Tue, 17 Feb 2015 14:41:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5259201D3 for ; Tue, 17 Feb 2015 14:41:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753212AbbBQOli (ORCPT ); Tue, 17 Feb 2015 09:41:38 -0500 Received: from mail-lb0-f171.google.com ([209.85.217.171]:42628 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752591AbbBQOlf (ORCPT ); Tue, 17 Feb 2015 09:41:35 -0500 Received: by lbiw7 with SMTP id w7so4816512lbi.9; Tue, 17 Feb 2015 06:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=aMFMTZYBpvarqX3EwLU2ALU03sLuSFlLSXHfKhgA5co=; b=aH5LBaJFYOdJL/PoJ5FPTxapLRs+8AqjCVWb2kIeivmfzCdMzSLjowNsq9broL8cBe 8I+tiNyVxAUsTlyeOF78tRiak/RRoCfxcI6Qe+ep2nHNhWT3PIi/AEB72q4lXXxLHTa2 WjI9wvEqPKfTbTSxkK2Y8kge4TfUgnas9H+gXTLOch7IKL4DxaFl3E+J9GD42ZzlAue6 99cVUNub/tswEK9LZBoVan/1fUPrvzHzwiI902lfl5VEJbdaibkK0qNHYf8j2AWwQrH7 Jz5RVCW/QBjdVyXx/dL5C5erMkBFNHWW04ZkTmg5iudHIif9nQrz2eGSuBn4+OqEh68Z ynoA== X-Received: by 10.152.4.233 with SMTP id n9mr28768403lan.61.1424184094035; Tue, 17 Feb 2015 06:41:34 -0800 (PST) Received: from neopili.fritz.box (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by mx.google.com with ESMTPSA id c1sm3600884lah.45.2015.02.17.06.41.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Feb 2015 06:41:33 -0800 (PST) From: Ricardo Ribalda Delgado To: Hans Verkuil , Mauro Carvalho Chehab , Jonathan Corbet , Arun Kumar K , Sylwester Nawrocki , Sakari Ailus , Antti Palosaari , linux-media@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH 1/2] media/v4l2-ctrls: Always run s_ctrl on volatile ctrls Date: Tue, 17 Feb 2015 15:41:29 +0100 Message-Id: <1424184090-14945-1-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Volatile controls can change their value outside the v4l-ctrl framework. We should ignore the cached written value of the ctrl when evaluating if we should run s_ctrl. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/v4l2-core/v4l2-ctrls.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 45c5b47..693a473 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1609,6 +1609,12 @@ static int cluster_changed(struct v4l2_ctrl *master) if (ctrl == NULL) continue; + + if (ctrl->flags & V4L2_CTRL_FLAG_VOLATILE) { + changed = true; + continue; + } + for (idx = 0; !ctrl_changed && idx < ctrl->elems; idx++) ctrl_changed = !ctrl->type_ops->equal(ctrl, idx, ctrl->p_cur, ctrl->p_new);