From patchwork Tue Feb 17 15:08:26 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: 5840451 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 19EDDBF440 for ; Tue, 17 Feb 2015 15:08:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6137B2012B for ; Tue, 17 Feb 2015 15:08:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 89AD62013D for ; Tue, 17 Feb 2015 15:08:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754697AbbBQPId (ORCPT ); Tue, 17 Feb 2015 10:08:33 -0500 Received: from mail-la0-f48.google.com ([209.85.215.48]:38189 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753090AbbBQPId (ORCPT ); Tue, 17 Feb 2015 10:08:33 -0500 Received: by lamq1 with SMTP id q1so36250795lam.5; Tue, 17 Feb 2015 07:08:29 -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=ttkpdeE3aAUvPCQUV7iOb/IYzjD+voq9MZHXOaKvBKQ=; b=hAn2FM9ENdKzNsgqMu5Zg0zUjKplAM4egXVW9uYj0ML4acOPOSmzbN2OAxyITn8Qfb SEHrvoxWvJLsGSzGkB3UbOqC6IAxWBTdlz3OMSocuwgnwg/A/eMCaYC6ipiDUhjIT5eL Uo0qP7+ORvnXzu4L2R1DSIAJBSyzC0Y6BSFLcUOu3+J/3z86H39BtYBUgpH7u2IX/+tc BB6WqHprfZtRu5nlWXwg0jNaRGibo/FDgyc7qSc3gq7ogZxaljQ2DWZ5UiIagg5WavAC fiqd4qHJQz5oGcrLsBWEWFyn/Z0RZkTPe3SaVoP+lQYggxt2HSZNqLOcjJgJRWZ/caIX E03A== X-Received: by 10.153.5.33 with SMTP id cj1mr20154170lad.66.1424185709156; Tue, 17 Feb 2015 07:08:29 -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 nx1sm1467239lbb.27.2015.02.17.07.08.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Feb 2015 07:08:28 -0800 (PST) From: Ricardo Ribalda Delgado To: Mauro Carvalho Chehab , Hans Verkuil , Sylwester Nawrocki , Sakari Ailus , Antti Palosaari , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH v4 1/2] media/v4l2-ctrls: Always run s_ctrl on volatile ctrls Date: Tue, 17 Feb 2015 16:08:26 +0100 Message-Id: <1424185706-16711-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=unavailable 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 --- v4: Hans Verkuil: explicity set has_changed to false. and add comment drivers/media/v4l2-core/v4l2-ctrls.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 45c5b47..f34a689 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1609,6 +1609,17 @@ static int cluster_changed(struct v4l2_ctrl *master) if (ctrl == NULL) continue; + + if (ctrl->flags & V4L2_CTRL_FLAG_VOLATILE) { + /* + * Set has_changed to false to avoid generating + * the event V4L2_EVENT_CTRL_CH_VALUE + */ + ctrl->has_changed = false; + 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);