Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 BF31A22D4D3 for ; Mon, 16 Feb 2026 21:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771277738; cv=none; b=BI+T8//1s7BVAdjc290hHTVMzdncLa2Hqvke7p2THUQDasxD8V0JKwQUg6BUWKPF/vLaTgJ7yeDrQGowmfE4I/tu9wN6H0/JH5gCWnpj1/MdPMlvuIKIZ63HkBV7T3N5hue1yxQXjPROFpyNfnk3BgGi3NIKT6UnRbOZzVc1dLI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771277738; c=relaxed/simple; bh=qdCcyAmNYNkDx9LB3r99m4U5Nb8nUFhzPXLVGoLKGIM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hPc0jW7o+oRB2O92B+nM1w0s3HynW9Z07OAf51iU4HlFUh12XSPvRL8vjvsXmxLNp5mBiIWhocoqUF6crpVWkFbu46RpOKZ0F7nzoqEMIByWeDAS3y/F113RV91tVVATNZaXIYCal/pzFy67LO+bQ+rUEdxIDMqcSDnxBX42ijk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=neFTG6rh; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="neFTG6rh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1771277737; x=1802813737; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=qdCcyAmNYNkDx9LB3r99m4U5Nb8nUFhzPXLVGoLKGIM=; b=neFTG6rhZevVVJ7zxBdJqrbDrv+/RWAUXv6Dll9b1cC5SzZvOgXsUYjb 46QWMDhRyvg8aRxqOZquw8WQ6RYHz097lyCFLZ3At+4OUyuujNBZJZ1xo 6swdYOLtk1D4dmgS0JPvFX3A64PqYrkh00S8aRYMmpRUXfMoR9q5lgi8e sjyf8UulEl85neIFZrWPRxed+dl1gYZwJGVPeKcFe6mGPQimFJKPJNGx0 L8UV+1raWtcABh0mogQNTd9Z1n/a/RSTh5mjW24RV/AQPJ/znSbQSzjug WnVe9biSBwqXm7yFgMcxq3MXoRr8IucPvOdFBpfsuK7RmJ7okpfEkVJ4Q Q==; X-CSE-ConnectionGUID: 0idb2j8GQ1GIwffziVmG+w== X-CSE-MsgGUID: N6OmwGviRbew+zJs9S9+Yg== X-IronPort-AV: E=McAfee;i="6800,10657,11703"; a="72349628" X-IronPort-AV: E=Sophos;i="6.21,295,1763452800"; d="scan'208";a="72349628" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2026 13:35:37 -0800 X-CSE-ConnectionGUID: kvVDMiiJQyCPp80HxP1crQ== X-CSE-MsgGUID: dT5ncaBsTDGjd9Nfa4iO9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,295,1763452800"; d="scan'208";a="212967835" Received: from fpallare-mobl4.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.245.245.46]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2026 13:35:29 -0800 Received: from kekkonen.localdomain (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id A7C6F121D2E; Mon, 16 Feb 2026 23:35:49 +0200 (EET) Date: Mon, 16 Feb 2026 23:35:49 +0200 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: Mirela Rabulea Cc: linux-media@vger.kernel.org, hans@jjverkuil.nl, laurent.pinchart@ideasonboard.com, Prabhakar , Kate Hsuan , Alexander Shiyan , Dave Stevenson , Tommaso Merciai , Benjamin Mugnier , Sylvain Petinot , Christophe JAILLET , Julien Massot , Naushir Patuck , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , Stefan Klug , =?iso-8859-1?Q?Andr=E9?= 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" Subject: Re: [PATCH v2 11/14] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops Message-ID: References: <20260211090920.1851141-1-sakari.ailus@linux.intel.com> <20260211090920.1851141-12-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 Content-Transfer-Encoding: 8bit In-Reply-To: Hi Mirela, On Mon, Feb 16, 2026 at 05:40:42PM +0200, Mirela Rabulea wrote: > Hi Sakari, > > I get build errors after applying this patch, like: > > drivers/media/i2c/imx219.c:1004:20: error: initialization of ‘int (*)(struct > v4l2_subdev *, const struct v4l2_subdev_client_info *, struct > v4l2_subdev_state *, struct v4l2_subdev_format *)’ from incompatible pointer > type ‘int (*)(struct v4l2_subdev *, struct v4l2_subdev_state *, struct > v4l2_subdev_format *)’ [-Wincompatible-pointer-types] >  1004 |         .set_fmt = imx219_set_pad_format, > > I'm not sure if it is fixed later, but after I apply all 14 patches, I still > get some build errors (I'm building for ARM64). Yes; I've noticed since posting this version I missed some required changes. I'll address this in v3. The change here (adding the client info argument) requires merging the last few patches in the set. I've kept the patches separate as there's one generated by Coccinelle entirely. > > See also one other issue below. > > On 2/11/26 11:09, Sakari Ailus wrote: > > Add a pointer to const struct v4l2_subdev_client_info to the get_fmt, > > set_fmt, get_selection and set_selection sub-device pad ops. The client > > info struct will soon be used to differentiate UAPI based on client > > capabilities. > > > > Signed-off-by: Sakari Ailus > > --- > > drivers/media/v4l2-core/v4l2-subdev.c | 63 ++++++++++++++++++--------- > > include/media/v4l2-subdev.h | 9 +++- > > 2 files changed, 51 insertions(+), 21 deletions(-) > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > index 79fb4643182a..76ab70a99e86 100644 > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > @@ -245,19 +245,21 @@ static inline int check_format(struct v4l2_subdev *sd, > > } > > > > static int call_get_fmt(struct v4l2_subdev *sd, > > + const struct v4l2_subdev_client_info *ci, > > struct v4l2_subdev_state *state, > > struct v4l2_subdev_format *format) > > { > > return check_format(sd, state, format) ? : > > - sd->ops->pad->get_fmt(sd, state, format); > > + sd->ops->pad->get_fmt(sd, ci, state, format); > > } > > > > static int call_set_fmt(struct v4l2_subdev *sd, > > + const struct v4l2_subdev_client_info *ci, > > struct v4l2_subdev_state *state, > > struct v4l2_subdev_format *format) > > { > > return check_format(sd, state, format) ? : > > - sd->ops->pad->set_fmt(sd, state, format); > > + sd->ops->pad->set_fmt(sd, ci, state, format); > > } > > > > static int call_enum_mbus_code(struct v4l2_subdev *sd, > > @@ -308,19 +310,21 @@ static inline int check_selection(struct v4l2_subdev *sd, > > } > > > > static int call_get_selection(struct v4l2_subdev *sd, > > + const struct v4l2_subdev_client_info *ci, > > struct v4l2_subdev_state *state, > > struct v4l2_subdev_selection *sel) > > { > > return check_selection(sd, state, sel) ? : > > - sd->ops->pad->get_selection(sd, state, sel); > > + sd->ops->pad->get_selection(sd, ci, state, sel); > > } > > > > static int call_set_selection(struct v4l2_subdev *sd, > > + const struct v4l2_subdev_client_info *ci, > > struct v4l2_subdev_state *state, > > struct v4l2_subdev_selection *sel) > > { > > return check_selection(sd, state, sel) ? : > > - sd->ops->pad->set_selection(sd, state, sel); > > + sd->ops->pad->set_selection(sd, ci, state, sel); > > } > > > > static inline int check_frame_interval(struct v4l2_subdev *sd, > > @@ -523,6 +527,21 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable) > > v4l2_subdev_unlock_state(state); \ > > return ret; \ > > } > > +#define DEFINE_STATE_WRAPPER_CI(f, arg_type) \ > > + static int call_##f##_state(struct v4l2_subdev *sd, \ > > + const struct v4l2_subdev_client_info *ci, \ > > + struct v4l2_subdev_state *_state, \ > > + arg_type *arg) \ > > + { \ > > + struct v4l2_subdev_state *state = _state; \ > > + int ret; \ > > + if (!_state) \ > > + state = v4l2_subdev_lock_and_get_active_state(sd); \ > > + ret = call_##f(sd, ci, state, arg); \ > > + if (!_state && state) \ > > + v4l2_subdev_unlock_state(state); \ > > + return ret; \ > > + } > > > > #else /* CONFIG_MEDIA_CONTROLLER */ > > > > @@ -536,13 +555,13 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable) > > > > #endif /* CONFIG_MEDIA_CONTROLLER */ > > > > -DEFINE_STATE_WRAPPER(get_fmt, struct v4l2_subdev_format); > > -DEFINE_STATE_WRAPPER(set_fmt, struct v4l2_subdev_format); > > +DEFINE_STATE_WRAPPER_CI(get_fmt, struct v4l2_subdev_format); > > DEFINE_STATE_WRAPPER_CI is not defined when CONFIG_MEDIA_CONTROLLER is not > defined I'll address that for v3. -- Regards, Sakari Ailus