From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B489031A061 for ; Thu, 16 Apr 2026 17:38:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776361108; cv=none; b=BqS2UkTug9C9TqCk3vL3i/DbzOvHjWJl4THkEzrdgAdzxTUDjnl7AFO4n33HslOBzcI934DzMJu/Cj2e+CREQOAZRaBMXcBybJ/sW4pypkeAIsatmLz5Lv5A/9tijgKb4l67pYaprOxaJWNQIVHSHOBfnDuvIV48O6yLnfYiYXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776361108; c=relaxed/simple; bh=uXxnWeSFVQe2mNdpYm5nYORCPcppYElJYNnh9idbTNA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MgJJ2JQwQPj5fXnrI/KWGifJWCSj3lG3vb/O2mLTCT14JU1e3u9UQNzyKtCRBq2kY3TjCS7E04BjRVdTJt8LrOB7SQHxMJDrNwNpkWPANciOZJIjXh5+EifwKugbt7kBC3h30li5HgDEyR77V++AbOyJPrhCxhM2fr58wbwm64Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=iJCLJKuQ; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="iJCLJKuQ" Received: from killaraus.ideasonboard.com (2001-14ba-703d-e500--2a1.rev.dnainternet.fi [IPv6:2001:14ba:703d:e500::2a1]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 2FFA8B5; Thu, 16 Apr 2026 19:36:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1776361009; bh=uXxnWeSFVQe2mNdpYm5nYORCPcppYElJYNnh9idbTNA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iJCLJKuQ5F/JK6Il1KACsSKXl3iEdrt8dypzhWODWJdn/fOq6KAupdhjWfhjd76um fDrZXi/BWGiMP1wxlS04Ems8hv9R7uVQbwo9Vpeeq7LFBOUyDGPxZjJC4QYyK5vgTR ejG2ZIgcl3UHAIkS2fljLFZ/sr7CjkdX5lj97wQo= Date: Thu, 16 Apr 2026 20:38:21 +0300 From: Laurent Pinchart To: Sakari Ailus Cc: linux-media@vger.kernel.org, hans@jjverkuil.nl, Prabhakar , Kate Hsuan , Dave Stevenson , Tommaso Merciai , Benjamin Mugnier , Sylvain Petinot , Christophe JAILLET , Julien Massot , Naushir Patuck , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , Stefan Klug , Mirela Rabulea , =?utf-8?B?QW5kcsOp?= Apitzsch , Heimir Thor Sverrisson , Kieran Bingham , Mehdi Djait , Ricardo Ribalda Delgado , Hans de Goede , Jacopo Mondi , Tomi Valkeinen , David Plowman , "Yu, Ong Hock" , "Ng, Khai Wen" , Jai Luthra , Rishikesh Donadkar Subject: Re: [PATCH v4 27/29] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state Message-ID: <20260416173821.GA1824072@killaraus.ideasonboard.com> References: <20260408153939.969381-1-sakari.ailus@linux.intel.com> <20260408153939.969381-28-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260408153939.969381-28-sakari.ailus@linux.intel.com> On Wed, Apr 08, 2026 at 06:39:36PM +0300, Sakari Ailus wrote: > Add v4l2_subdev_call_ci_active_state(), to call sub-device pad ops that > take struct v4l2_subdev_client_info pointer as an argument. If we drop the client info parameter from .get_fmt(), the only driver calling this new macro will be drivers/media/platform/ti/cal/cal-video.c. I would just pass NULL explicitly there and drop this patch. > Signed-off-by: Sakari Ailus > --- > include/media/v4l2-subdev.h | 49 ++++++++++++++++++++++++++++--------- > 1 file changed, 38 insertions(+), 11 deletions(-) > > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > index 1ce1c18f84a9..9b0e091c30c1 100644 > --- a/include/media/v4l2-subdev.h > +++ b/include/media/v4l2-subdev.h > @@ -1968,6 +1968,22 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; > __result; \ > }) > > +#define v4l2_subdev_call_drop_fourth(first, second, third, fourth, rest...) \ > + v4l2_subdev_call(first, second, third, ##rest) > + > +#define __v4l2_subdev_call_state_active(call, sd, o, f, args...) \ > + ({ \ > + int __result; \ > + struct v4l2_subdev_state *state; \ > + state = v4l2_subdev_get_unlocked_active_state(sd); \ > + if (state) \ > + v4l2_subdev_lock_state(state); \ > + __result = call(sd, o, f, NULL, state, ##args); \ > + if (state) \ > + v4l2_subdev_unlock_state(state); \ > + __result; \ > + }) > + > /** > * v4l2_subdev_call_state_active - call an operation of a v4l2_subdev which > * takes state as a parameter, passing the > @@ -1986,17 +2002,28 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; > * active state, lock it before calling the op and unlock it after the call. > */ > #define v4l2_subdev_call_state_active(sd, o, f, args...) \ > - ({ \ > - int __result; \ > - struct v4l2_subdev_state *state; \ > - state = v4l2_subdev_get_unlocked_active_state(sd); \ > - if (state) \ > - v4l2_subdev_lock_state(state); \ > - __result = v4l2_subdev_call(sd, o, f, state, ##args); \ > - if (state) \ > - v4l2_subdev_unlock_state(state); \ > - __result; \ > - }) > + __v4l2_subdev_call_state_active(v4l2_subdev_call_drop_fourth, \ > + sd, o, f, ##args) > + > +/** > + * v4l2_subdev_call_ci_state_active - call an operation of a v4l2_subdev which > + * takes state as a parameter, passing the > + * subdev its active state. > + * > + * @sd: pointer to the &struct v4l2_subdev > + * @o: name of the element at &struct v4l2_subdev_ops that contains @f. > + * Each element there groups a set of callbacks functions. > + * @f: callback function to be called. > + * The callback functions are defined in groups, according to > + * each element at &struct v4l2_subdev_ops. > + * @args: arguments for @f. > + * > + * This macro is just as v4l2_subdev_call_state_active(), with the exception > + * that it passes NULL as the client info to sub-device ops that need it > + * (currently pad ops get_fmt, set_fmt, get_selection and set_selection). > + */ > +#define v4l2_subdev_call_ci_state_active(sd, o, f, args...) \ > + __v4l2_subdev_call_state_active(v4l2_subdev_call, sd, o, f, ##args) > > /** > * v4l2_subdev_call_state_try - call an operation of a v4l2_subdev which > -- > 2.47.3 > -- Regards, Laurent Pinchart