* [PATCH v4 00/29] Metadata series preparation
@ 2026-04-08 15:39 Sakari Ailus
2026-04-08 15:39 ` [PATCH v4 01/29] media: imx219: Rename "PIXEL_ARRAY" as "VISIBLE" Sakari Ailus
` (28 more replies)
0 siblings, 29 replies; 116+ messages in thread
From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw)
To: linux-media
Cc: hans, laurent.pinchart, 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,
André 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
Hi folks,
This smallish set contains patches that prepare for merging the metadata
series.
There are simple cleanups but also two noteworthy changes: the addition of
the VALIDATE_LATE media link flag and the addition of the new struct
v4l2_subdev_client_info struct to the get_fmt, set_fmt, get_selection and
set_selection pad operation arguments.
The series now begins with a set of imx219 patches, fixes and cleanups
accrued during the conversion of the imx219 driver to use the common raw
sensor model. I wonder if all these should be backported.
The VALIDATE_LATE allows using the link_validate callback as the way to
validate the links connected to the sink pads of video nodes on pipelines
with multiple capture video nodes. Without this flag, the entire pipeline
will be validated at the time of the first streamon, with the V4L2 pixel
(or other) format set on the other capture video nodes at the time,
requiring all formats to be set before starting streaming anywhere. But
this does generally not match with what the userspace would do, hence the
new flag. The patches in the upcoming metadata series version adds the
support for the flag to the IPU6 driver.
The new struct v4l2_subdev_client_info enables passing around file handler
specific client capability information, which is used to differentiate
UAPI between existing users and those that are aware of the new common raw
sensor model. This is effectively required if we want to add support for
the new model to existing raw sensor drivers: the new model is in a direct
conflict with how things worked before the model. There still needs to be
a single driver internal state, the different UAPIs simply offer a
different view to that state. In-kernel users that do not deal with
capabilities just use NULL when calling these ops. This also means that
whatever client capabilities are being used, there may not be a change to
inter-driver interfaces such as get_fmt() when dealing with external pads.
I'm leaving the last Coccinelle-generated patch out this time as it's more
than 200 kiB. The patch can be found here
<URL:<https://git.linuxtv.org/sailus/media_tree.git/log/?h=metadata-pre>.
Patches 19--22 will be squashed together before merging.
The Coccinelle spatch used to generate the 22nd patch is below, as is a
Perl script to generate another Coccinelle patch doing the rest of the
job:
caps.cocci
------------------8<----------------------
@ fmt @
identifier a1, a2, a3;
identifier fn;
@@
fn(struct v4l2_subdev *a1,
+ const struct v4l2_subdev_client_info *ci,
struct v4l2_subdev_state *a2, struct v4l2_subdev_format *a3) {...}
@ sel @
identifier a1, a2, a3;
identifier fn2;
@@
fn2(struct v4l2_subdev *a1,
+ const struct v4l2_subdev_client_info *ci,
struct v4l2_subdev_state *a2, struct v4l2_subdev_selection *a3) {...}
@ fmt_call @
expression a1, a2, a3;
identifier fmt.fn;
@@
fn(a1
+ , NULL
, a2, a3);
@ fmt_call2 @
expression a1, a2, a3;
identifier fmt.fn;
@@
return fn(a1
+ , NULL
, a2, a3);
@ fmt_call3 @
expression ret, a1, a2, a3;
identifier fmt.fn;
@@
ret = fn(a1
+ , NULL
, a2, a3);
@ fmt_call4 @
expression a1, a2, a3;
identifier sel.fn2;
@@
fn2(a1
+ , NULL
, a2, a3);
@ fmt_call5 @
expression a1, a2, a3;
identifier sel.fn2;
@@
return fn2(a1
+ , NULL
, a2, a3);
@ fmt_call6 @
expression ret, a1, a2, a3;
identifier sel.fn2;
@@
ret = fn2(a1
+ , NULL
, a2, a3);
------------------8<----------------------
mk-caps2.pl
------------------8<----------------------
#!/usr/bin/perl -w
my @prefix = (
"(void)",
"",
"ret = ",
"return "
);
my $state_args = [
[ "sd", "state", "fmt" ]
];
my $pad_active_args = [
[ "sd", "pad", "get_fmt", "fmt" ],
[ "sd", "pad", "set_fmt", "fmt" ],
[ "sd", "pad", "get_selection", "fmt" ],
[ "sd", "pad", "set_selection", "fmt" ],
];
my $pad_args = [
[ "sd", "pad", "get_fmt", "state", "fmt" ],
[ "sd", "pad", "set_fmt", "state", "fmt" ],
[ "sd", "pad", "get_selection", "state", "fmt" ],
[ "sd", "pad", "set_selection", "state", "fmt" ],
];
my $group_args = [
[ "dev", "group", "pad", "get_fmt", "state", "fmt" ],
[ "dev", "group", "pad", "set_fmt", "state", "fmt" ],
[ "dev", "group", "pad", "get_selection", "state", "fmt" ],
[ "dev", "group", "pad", "set_selection", "state", "fmt" ],
];
my %funcs = (
# "function_name" => [ arg ref, new arg position from the end ],
"v4l2_subdev_call" => { args => $pad_args, pos => 1 },
"v4l2_device_call_all" => { args => $group_args, pos => 1 },
"v4l2_subdev_get_fmt" => { args => $state_args, pos => 1 },
"sensor_call" => { args => $pad_args, pos => 1 },
"saa_call_all" => { args => $pad_args, pos => 1 },
"call_all" => { args => $pad_args, pos => 1 },
"v4l2_subdev_call_state_active" => { args => $pad_active_args, newname => "v4l2_subdev_call_ci_state_active" },
);
my $rule;
foreach my $p (@prefix) {
foreach my $f (keys %funcs) {
my $aref = $funcs{$f};
foreach my $i (@{$aref->{args}}) {
my $newname = $aref->{newname};
print "@ rule" . $rule++ . " @\n";
print "symbol $f;\n";
print map {
((/_/ || /^pad$/) ?
"symbol" : "expression") . " $_;\n";
} @$i;
my @pre = @$i;
my @post = splice @pre, $#pre - ($aref->{pos} // 0);
print "identifier ret;\n" if $p =~ "ret =";
print "@@\n";
if (! defined $newname) {
print " $p$f(" . join(", ", @pre) . "\n";
print "+ , NULL\n";
print " , " . join(", ", @post) . ");\n";
} else {
print " $p\n";
print "- $f(\n";
print "+ $newname(\n";
print " " . join(", ", (@pre, @post)) . ");\n";
}
}
}
}
------------------8<----------------------
since v3:
- Include the patch adding v4l2_subdev_get_frame_desc(); compared to the
version posted earlier, this one uses get_fmt() pad op.
- Removed kernel-doc documentation from sub-device ops in drivers. These
comments are redundant.
- Include v4l2_subdev_client_info changes for ov2732 and t4ka3 drivers.
- Fix setting media link flags.
- Fix the condition for skipping early validation (and doing it later).
The old condition sometimes caused the link being validated too early.
since v2:
- Include imx219 driver fixes accrued during imx219 Common Raw Sensor
Model support implementation. This includes fixes to control ranges and
the removal of the rate_factor, among other things.
- Reword documentation of the VALIDATE_LATE link flag.
- Require that VALIDATE_LATE links sink (origin entity in this case) may
have a single pad only.
- Drop the pipe argument from __media_pipeline_validate_one() as the
function doesn't use it.
- Fix MUST_CONNECT flag validation for links that also have VALIDATE_LATE
flag.
- Rename the macros to create wrapper functions, define one for "! defined
CONFIG_MEDIA_CONTROLLER" case as well.
- Call v4l2_subdev_call_waive_fourth() v4l2_subdev_call_drop_fourth() now.
- Comment the link validation code a little better.
- Fix copying the routes in the routing cleanup patch (copy the same
number of routes as before), rename the function doing it well. Make the
new function copy_routes_state_to_routing() to take just routing and
state arguments, for all callers have this information.
- Add a patch bumping the STREAMS sub-device capability bit and document
that bit 0x2 is reserved.
since v1:
- Address compilation issues. I had only tested on arm64 previously.
- Introduce v4l2_subdev_call_ci_state_active(), to call pad ops with
client info argument with active state. Getting around needing a new
function doesn't seem easy (probably requires one more layer of
indirection I'd like to do without).
Sakari Ailus (29):
media: imx219: Rename "PIXEL_ARRAY" as "VISIBLE"
media: imx219: Fix maximum frame length in lines
media: imx219: Set horizontal blanking on mode change
media: imx219: Scale the vblank limits according to rate_factor
media: imx219: Fix vertical blanking and exposure for analogue binning
media: imx219: Don't update exposure limits while setting format
media: imx219: Rename "binning" as "bin_hv" in imx219_set_pad_format
media: imx274: Remove redundant kernel-doc comments
media: imx334: Remove redundant kernel-doc comments
media: imx335: Remove redundant kernel-doc comments
media: imx412: Remove redundant kernel-doc comments
media: ov9282: Remove redundant kernel-doc comments
media: tvp514x: Remove redundant kernel-doc comments
media: Documentation: Improve LINK_FREQ documentation
media: Documentation: Improve pixel rate calculation documentation
media: v4l2-subdev: Refactor returning routes
media: v4l2-subdev: Allow accessing routes with STREAMS client
capability
media: mc: Simplify link processing in __media_pipeline_start()
media: mc: Separate single link validation into a new function
media: uapi: Bump the STREAMS bit a little
media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP
media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE
media: Improve enable_streams and disable_streams documentation
media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc()
media: v4l2-subdev: Move subdev client capabilities into a new struct
media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad
ops
media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state
media: v4l2-subdev: Perform client info changes to i2c drivers
media: v4l2-subdev: Add struct v4l2_subdev_client_info argument to pad
ops
Documentation/driver-api/media/tx-rx.rst | 9 +-
.../media/mediactl/media-ioc-setup-link.rst | 4 +
.../media/mediactl/media-types.rst | 5 +
.../media/v4l/ext-ctrls-image-process.rst | 4 +-
drivers/media/i2c/adv7170.c | 2 +
drivers/media/i2c/adv7175.c | 2 +
drivers/media/i2c/adv7180.c | 4 +-
drivers/media/i2c/adv7183.c | 4 +-
drivers/media/i2c/adv748x/adv748x-afe.c | 4 +-
drivers/media/i2c/adv748x/adv748x-csi2.c | 3 +-
drivers/media/i2c/adv748x/adv748x-hdmi.c | 4 +-
drivers/media/i2c/adv7511-v4l2.c | 2 +
drivers/media/i2c/adv7604.c | 3 +
drivers/media/i2c/adv7842.c | 4 +-
drivers/media/i2c/ak881x.c | 2 +
drivers/media/i2c/alvium-csi2.c | 3 +
drivers/media/i2c/ar0521.c | 2 +
drivers/media/i2c/ccs/ccs-core.c | 15 +-
drivers/media/i2c/cx25840/cx25840-core.c | 1 +
drivers/media/i2c/ds90ub913.c | 3 +-
drivers/media/i2c/ds90ub953.c | 3 +-
drivers/media/i2c/ds90ub960.c | 3 +-
drivers/media/i2c/et8ek8/et8ek8_driver.c | 2 +
drivers/media/i2c/gc0308.c | 1 +
drivers/media/i2c/gc0310.c | 1 +
drivers/media/i2c/gc05a2.c | 4 +-
drivers/media/i2c/gc08a3.c | 4 +-
drivers/media/i2c/gc2145.c | 2 +
drivers/media/i2c/hi556.c | 3 +
drivers/media/i2c/hi846.c | 3 +
drivers/media/i2c/hi847.c | 2 +
drivers/media/i2c/imx111.c | 1 +
drivers/media/i2c/imx208.c | 2 +
drivers/media/i2c/imx214.c | 4 +-
drivers/media/i2c/imx219.c | 98 +++-----
drivers/media/i2c/imx258.c | 3 +
drivers/media/i2c/imx274.c | 42 +---
drivers/media/i2c/imx283.c | 2 +
drivers/media/i2c/imx290.c | 4 +-
drivers/media/i2c/imx296.c | 7 +-
drivers/media/i2c/imx319.c | 2 +
drivers/media/i2c/imx334.c | 97 +-------
drivers/media/i2c/imx335.c | 91 +-------
drivers/media/i2c/imx355.c | 2 +
drivers/media/i2c/imx412.c | 86 +------
drivers/media/i2c/imx415.c | 4 +-
drivers/media/i2c/isl7998x.c | 2 +
drivers/media/i2c/lt6911uxe.c | 5 +-
drivers/media/i2c/max9286.c | 3 +-
drivers/media/i2c/max96714.c | 3 +-
drivers/media/i2c/max96717.c | 3 +-
drivers/media/i2c/ml86v7667.c | 1 +
drivers/media/i2c/mt9m001.c | 6 +-
drivers/media/i2c/mt9m111.c | 4 +
drivers/media/i2c/mt9m114.c | 6 +
drivers/media/i2c/mt9p031.c | 4 +
drivers/media/i2c/mt9t112.c | 4 +
drivers/media/i2c/mt9v011.c | 1 +
drivers/media/i2c/mt9v032.c | 4 +
drivers/media/i2c/mt9v111.c | 2 +
drivers/media/i2c/og01a1b.c | 3 +-
drivers/media/i2c/og0ve1b.c | 3 +-
drivers/media/i2c/os05b10.c | 2 +
drivers/media/i2c/ov01a10.c | 3 +
drivers/media/i2c/ov02a10.c | 4 +-
drivers/media/i2c/ov02c10.c | 1 +
drivers/media/i2c/ov02e10.c | 2 +
drivers/media/i2c/ov08d10.c | 2 +
drivers/media/i2c/ov08x40.c | 2 +
drivers/media/i2c/ov13858.c | 2 +
drivers/media/i2c/ov13b10.c | 2 +
drivers/media/i2c/ov2640.c | 3 +
drivers/media/i2c/ov2659.c | 2 +
drivers/media/i2c/ov2680.c | 4 +
drivers/media/i2c/ov2685.c | 3 +
drivers/media/i2c/ov2732.c | 4 +-
drivers/media/i2c/ov2735.c | 4 +-
drivers/media/i2c/ov2740.c | 1 +
drivers/media/i2c/ov4689.c | 2 +
drivers/media/i2c/ov5640.c | 3 +
drivers/media/i2c/ov5645.c | 4 +-
drivers/media/i2c/ov5647.c | 3 +
drivers/media/i2c/ov5648.c | 2 +
drivers/media/i2c/ov5670.c | 3 +
drivers/media/i2c/ov5675.c | 3 +
drivers/media/i2c/ov5693.c | 4 +
drivers/media/i2c/ov5695.c | 2 +
drivers/media/i2c/ov6211.c | 3 +-
drivers/media/i2c/ov64a40.c | 2 +
drivers/media/i2c/ov7251.c | 5 +-
drivers/media/i2c/ov7670.c | 2 +
drivers/media/i2c/ov772x.c | 3 +
drivers/media/i2c/ov7740.c | 2 +
drivers/media/i2c/ov8856.c | 2 +
drivers/media/i2c/ov8858.c | 3 +-
drivers/media/i2c/ov8865.c | 3 +
drivers/media/i2c/ov9282.c | 72 +-----
drivers/media/i2c/ov9640.c | 2 +
drivers/media/i2c/ov9650.c | 2 +
drivers/media/i2c/ov9734.c | 2 +
drivers/media/i2c/rdacm20.c | 1 +
drivers/media/i2c/rdacm21.c | 1 +
drivers/media/i2c/rj54n1cb0c.c | 4 +
drivers/media/i2c/s5c73m3/s5c73m3-core.c | 4 +
drivers/media/i2c/s5k3m5.c | 4 +-
drivers/media/i2c/s5k5baf.c | 4 +
drivers/media/i2c/s5k6a3.c | 2 +
drivers/media/i2c/s5kjn1.c | 4 +-
drivers/media/i2c/saa6752hs.c | 2 +
drivers/media/i2c/saa7115.c | 1 +
drivers/media/i2c/saa717x.c | 1 +
drivers/media/i2c/st-mipid02.c | 1 +
drivers/media/i2c/t4ka3.c | 3 +
drivers/media/i2c/tc358743.c | 4 +-
drivers/media/i2c/tc358746.c | 3 +-
drivers/media/i2c/tda1997x.c | 2 +
drivers/media/i2c/thp7312.c | 1 +
drivers/media/i2c/tvp514x.c | 57 +----
drivers/media/i2c/tvp5150.c | 3 +
drivers/media/i2c/tvp7002.c | 4 +-
drivers/media/i2c/tw9900.c | 2 +
drivers/media/i2c/tw9910.c | 3 +
drivers/media/i2c/vd55g1.c | 4 +-
drivers/media/i2c/vd56g3.c | 4 +-
drivers/media/i2c/vgxy61.c | 5 +-
drivers/media/mc/mc-entity.c | 161 +++++++++----
drivers/media/pci/cobalt/cobalt-driver.c | 8 +-
drivers/media/pci/cobalt/cobalt-v4l2.c | 14 +-
drivers/media/pci/cx18/cx18-av-core.c | 1 +
drivers/media/pci/cx18/cx18-controls.c | 2 +-
drivers/media/pci/cx18/cx18-ioctl.c | 2 +-
drivers/media/pci/cx23885/cx23885-video.c | 4 +-
drivers/media/pci/intel/ipu3/ipu3-cio2.c | 5 +-
drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 2 +
.../media/pci/intel/ipu6/ipu6-isys-subdev.c | 3 +-
.../media/pci/intel/ipu6/ipu6-isys-subdev.h | 1 +
drivers/media/pci/intel/ivsc/mei_csi.c | 1 +
drivers/media/pci/ivtv/ivtv-controls.c | 2 +-
drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +-
drivers/media/pci/saa7134/saa7134-empress.c | 6 +-
.../platform/amlogic/c3/isp/c3-isp-capture.c | 2 +-
.../platform/amlogic/c3/isp/c3-isp-core.c | 1 +
.../platform/amlogic/c3/isp/c3-isp-resizer.c | 3 +
.../amlogic/c3/mipi-adapter/c3-mipi-adap.c | 3 +-
.../amlogic/c3/mipi-csi2/c3-mipi-csi2.c | 3 +-
.../platform/arm/mali-c55/mali-c55-capture.c | 2 +-
.../platform/arm/mali-c55/mali-c55-isp.c | 5 +-
.../platform/arm/mali-c55/mali-c55-resizer.c | 15 +-
.../platform/arm/mali-c55/mali-c55-tpg.c | 1 +
drivers/media/platform/atmel/atmel-isi.c | 4 +-
.../media/platform/broadcom/bcm2835-unicam.c | 3 +-
drivers/media/platform/cadence/cdns-csi2rx.c | 7 +-
drivers/media/platform/cadence/cdns-csi2tx.c | 7 +-
drivers/media/platform/intel/pxa_camera.c | 6 +-
drivers/media/platform/marvell/mcam-core.c | 4 +-
.../platform/microchip/microchip-csi2dc.c | 2 +
.../platform/microchip/microchip-isc-base.c | 1 +
.../platform/microchip/microchip-isc-scaler.c | 3 +
drivers/media/platform/nxp/imx-mipi-csis.c | 5 +-
drivers/media/platform/nxp/imx7-media-csi.c | 3 +-
.../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 3 +-
.../platform/nxp/imx8-isi/imx8-isi-pipe.c | 3 +
drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 3 +-
.../media/platform/qcom/camss/camss-csid.c | 4 +-
.../media/platform/qcom/camss/camss-csiphy.c | 4 +-
.../media/platform/qcom/camss/camss-ispif.c | 4 +-
drivers/media/platform/qcom/camss/camss-vfe.c | 17 +-
.../media/platform/qcom/camss/camss-video.c | 2 +-
.../media/platform/raspberrypi/rp1-cfe/csi2.c | 1 +
.../platform/raspberrypi/rp1-cfe/pisp-fe.c | 3 +-
drivers/media/platform/renesas/rcar-csi2.c | 3 +-
.../media/platform/renesas/rcar-isp/csisp.c | 3 +-
.../platform/renesas/rcar-vin/rcar-v4l2.c | 2 +-
drivers/media/platform/renesas/renesas-ceu.c | 7 +-
.../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 3 +-
.../platform/renesas/rzg2l-cru/rzg2l-ip.c | 3 +-
.../platform/renesas/rzg2l-cru/rzg2l-video.c | 2 +-
.../renesas/rzv2h-ivc/rzv2h-ivc-subdev.c | 3 +-
.../media/platform/renesas/vsp1/vsp1_brx.c | 3 +
.../media/platform/renesas/vsp1/vsp1_drm.c | 26 ++-
.../media/platform/renesas/vsp1/vsp1_entity.c | 4 +-
.../media/platform/renesas/vsp1/vsp1_histo.c | 9 +-
.../media/platform/renesas/vsp1/vsp1_hsit.c | 1 +
.../media/platform/renesas/vsp1/vsp1_rwpf.c | 3 +
.../media/platform/renesas/vsp1/vsp1_sru.c | 1 +
.../media/platform/renesas/vsp1/vsp1_uds.c | 1 +
.../media/platform/renesas/vsp1/vsp1_video.c | 2 +-
.../media/platform/renesas/vsp1/vsp1_vspx.c | 3 +-
.../platform/rockchip/rkcif/rkcif-interface.c | 5 +-
.../platform/rockchip/rkisp1/rkisp1-capture.c | 2 +-
.../platform/rockchip/rkisp1/rkisp1-csi.c | 3 +-
.../platform/rockchip/rkisp1/rkisp1-isp.c | 3 +
.../platform/rockchip/rkisp1/rkisp1-resizer.c | 3 +
.../samsung/exynos4-is/fimc-capture.c | 13 +-
.../samsung/exynos4-is/fimc-isp-video.c | 5 +-
.../platform/samsung/exynos4-is/fimc-isp.c | 2 +
.../platform/samsung/exynos4-is/fimc-lite.c | 8 +-
.../platform/samsung/exynos4-is/mipi-csis.c | 2 +
.../samsung/s3c-camif/camif-capture.c | 7 +-
.../platform/samsung/s3c-camif/camif-core.c | 4 +-
drivers/media/platform/st/stm32/stm32-csi.c | 1 +
drivers/media/platform/st/stm32/stm32-dcmi.c | 6 +-
.../st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 3 +-
.../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 3 +
.../st/stm32/stm32-dcmipp/dcmipp-input.c | 1 +
.../platform/sunxi/sun4i-csi/sun4i_v4l2.c | 2 +
.../sunxi/sun6i-csi/sun6i_csi_bridge.c | 2 +
.../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 2 +
.../sun8i_a83t_mipi_csi2.c | 2 +
.../media/platform/synopsys/dw-mipi-csi2rx.c | 3 +-
.../media/platform/ti/am437x/am437x-vpfe.c | 4 +-
drivers/media/platform/ti/cal/cal-camerarx.c | 3 +-
drivers/media/platform/ti/cal/cal-video.c | 6 +-
.../media/platform/ti/davinci/vpif_capture.c | 2 +-
.../platform/ti/j721e-csi2rx/j721e-csi2rx.c | 2 +-
drivers/media/platform/ti/omap3isp/ispccdc.c | 6 +-
drivers/media/platform/ti/omap3isp/ispccp2.c | 4 +-
drivers/media/platform/ti/omap3isp/ispcsi2.c | 4 +-
.../media/platform/ti/omap3isp/isppreview.c | 6 +-
.../media/platform/ti/omap3isp/ispresizer.c | 6 +-
drivers/media/platform/ti/omap3isp/ispvideo.c | 12 +-
drivers/media/platform/ti/vpe/vip.c | 7 +-
drivers/media/platform/via/via-camera.c | 4 +-
drivers/media/platform/video-mux.c | 1 +
.../media/platform/xilinx/xilinx-csi2rxss.c | 2 +
drivers/media/platform/xilinx/xilinx-dma.c | 2 +-
drivers/media/platform/xilinx/xilinx-tpg.c | 2 +
drivers/media/test-drivers/vimc/vimc-common.c | 2 +-
.../media/test-drivers/vimc/vimc-debayer.c | 3 +-
drivers/media/test-drivers/vimc/vimc-scaler.c | 3 +
drivers/media/test-drivers/vimc/vimc-sensor.c | 1 +
drivers/media/usb/cx231xx/cx231xx-417.c | 2 +-
drivers/media/usb/cx231xx/cx231xx-video.c | 4 +-
drivers/media/usb/dvb-usb/cxusb-analog.c | 6 +-
drivers/media/usb/em28xx/em28xx-camera.c | 2 +-
drivers/media/usb/go7007/go7007-v4l2.c | 2 +-
drivers/media/usb/go7007/s2250-board.c | 1 +
drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +-
drivers/media/v4l2-core/v4l2-subdev.c | 216 ++++++++++++++----
.../media/atomisp/i2c/atomisp-gc2235.c | 2 +
.../media/atomisp/i2c/atomisp-ov2722.c | 2 +
.../staging/media/atomisp/pci/atomisp_cmd.c | 16 +-
.../staging/media/atomisp/pci/atomisp_csi2.c | 2 +
.../media/atomisp/pci/atomisp_subdev.c | 4 +
.../staging/media/atomisp/pci/atomisp_v4l2.c | 8 +-
.../media/deprecated/atmel/atmel-isc-base.c | 4 +-
drivers/staging/media/imx/imx-ic-prp.c | 2 +
drivers/staging/media/imx/imx-ic-prpencvf.c | 2 +
drivers/staging/media/imx/imx-media-capture.c | 14 +-
drivers/staging/media/imx/imx-media-csi.c | 4 +
drivers/staging/media/imx/imx-media-utils.c | 2 +-
drivers/staging/media/imx/imx-media-vdic.c | 2 +
drivers/staging/media/imx/imx6-mipi-csi2.c | 2 +
drivers/staging/media/ipu3/ipu3-v4l2.c | 4 +
drivers/staging/media/ipu7/ipu7-isys-csi2.c | 2 +
drivers/staging/media/ipu7/ipu7-isys-subdev.c | 3 +-
.../media/sunxi/sun6i-isp/sun6i_isp_proc.c | 2 +
drivers/staging/media/tegra-video/csi.c | 2 +
drivers/staging/media/tegra-video/vi.c | 12 +-
include/media/v4l2-subdev.h | 97 ++++++--
include/uapi/linux/media.h | 1 +
include/uapi/linux/v4l2-subdev.h | 5 +-
262 files changed, 1117 insertions(+), 794 deletions(-)
--
2.47.3
^ permalink raw reply [flat|nested] 116+ messages in thread* [PATCH v4 01/29] media: imx219: Rename "PIXEL_ARRAY" as "VISIBLE" 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-16 13:14 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 02/29] media: imx219: Fix maximum frame length in lines Sakari Ailus ` (27 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 The imx219 driver uses macros for denoting the size of the pixel array. The values reflect the area of manufacturer-designated visible pixels, reflect this in the naming by calling it "VISIBLE" instead of "PIXEL_ARRAY". Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/imx219.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 7da02ce5da15..cbd151d4af5f 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -142,10 +142,10 @@ /* IMX219 native and active pixel array size. */ #define IMX219_NATIVE_WIDTH 3296U #define IMX219_NATIVE_HEIGHT 2480U -#define IMX219_PIXEL_ARRAY_LEFT 8U -#define IMX219_PIXEL_ARRAY_TOP 8U -#define IMX219_PIXEL_ARRAY_WIDTH 3280U -#define IMX219_PIXEL_ARRAY_HEIGHT 2464U +#define IMX219_VISIBLE_LEFT 8U +#define IMX219_VISIBLE_TOP 8U +#define IMX219_VISIBLE_WIDTH 3280U +#define IMX219_VISIBLE_HEIGHT 2464U /* Mode : resolution and related config&values */ struct imx219_mode { @@ -675,13 +675,13 @@ static int imx219_set_framefmt(struct imx219 *imx219, bpp = imx219_get_format_bpp(format); cci_write(imx219->regmap, IMX219_REG_X_ADD_STA_A, - crop->left - IMX219_PIXEL_ARRAY_LEFT, &ret); + crop->left - IMX219_VISIBLE_LEFT, &ret); cci_write(imx219->regmap, IMX219_REG_X_ADD_END_A, - crop->left - IMX219_PIXEL_ARRAY_LEFT + crop->width - 1, &ret); + crop->left - IMX219_VISIBLE_LEFT + crop->width - 1, &ret); cci_write(imx219->regmap, IMX219_REG_Y_ADD_STA_A, - crop->top - IMX219_PIXEL_ARRAY_TOP, &ret); + crop->top - IMX219_VISIBLE_TOP, &ret); cci_write(imx219->regmap, IMX219_REG_Y_ADD_END_A, - crop->top - IMX219_PIXEL_ARRAY_TOP + crop->height - 1, &ret); + crop->top - IMX219_VISIBLE_TOP + crop->height - 1, &ret); imx219_get_binning(state, &bin_h, &bin_v); cci_write(imx219->regmap, IMX219_REG_BINNING_MODE_H, bin_h, &ret); @@ -867,8 +867,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, * Use binning to maximize the crop rectangle size, and centre it in the * sensor. */ - bin_h = min(IMX219_PIXEL_ARRAY_WIDTH / format->width, 2U); - bin_v = min(IMX219_PIXEL_ARRAY_HEIGHT / format->height, 2U); + bin_h = min(IMX219_VISIBLE_WIDTH / format->width, 2U); + bin_v = min(IMX219_VISIBLE_HEIGHT / format->height, 2U); /* Ensure bin_h and bin_v are same to avoid 1:2 or 2:1 stretching */ binning = min(bin_h, bin_v); @@ -967,10 +967,10 @@ static int imx219_get_selection(struct v4l2_subdev *sd, case V4L2_SEL_TGT_CROP_DEFAULT: case V4L2_SEL_TGT_CROP_BOUNDS: - sel->r.top = IMX219_PIXEL_ARRAY_TOP; - sel->r.left = IMX219_PIXEL_ARRAY_LEFT; - sel->r.width = IMX219_PIXEL_ARRAY_WIDTH; - sel->r.height = IMX219_PIXEL_ARRAY_HEIGHT; + sel->r.top = IMX219_VISIBLE_TOP; + sel->r.left = IMX219_VISIBLE_LEFT; + sel->r.width = IMX219_VISIBLE_WIDTH; + sel->r.height = IMX219_VISIBLE_HEIGHT; return 0; } -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 01/29] media: imx219: Rename "PIXEL_ARRAY" as "VISIBLE" 2026-04-08 15:39 ` [PATCH v4 01/29] media: imx219: Rename "PIXEL_ARRAY" as "VISIBLE" Sakari Ailus @ 2026-04-16 13:14 ` Laurent Pinchart 0 siblings, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 13:14 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:10PM +0300, Sakari Ailus wrote: > The imx219 driver uses macros for denoting the size of the pixel array. > The values reflect the area of manufacturer-designated visible pixels, > reflect this in the naming by calling it "VISIBLE" instead of > "PIXEL_ARRAY". The name "pixel array" is indeed bad. I'm not sure if "visible" is the best name though. The datasheet documents those pixels as "active area". The same name seems to be used in the documentation of other Sony sensors, so we could standardize on that. How about naming the macros IMX219_ACTIVE_AREA_* ? If you agree, Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > --- > drivers/media/i2c/imx219.c | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > index 7da02ce5da15..cbd151d4af5f 100644 > --- a/drivers/media/i2c/imx219.c > +++ b/drivers/media/i2c/imx219.c > @@ -142,10 +142,10 @@ > /* IMX219 native and active pixel array size. */ > #define IMX219_NATIVE_WIDTH 3296U > #define IMX219_NATIVE_HEIGHT 2480U > -#define IMX219_PIXEL_ARRAY_LEFT 8U > -#define IMX219_PIXEL_ARRAY_TOP 8U > -#define IMX219_PIXEL_ARRAY_WIDTH 3280U > -#define IMX219_PIXEL_ARRAY_HEIGHT 2464U > +#define IMX219_VISIBLE_LEFT 8U > +#define IMX219_VISIBLE_TOP 8U > +#define IMX219_VISIBLE_WIDTH 3280U > +#define IMX219_VISIBLE_HEIGHT 2464U > > /* Mode : resolution and related config&values */ > struct imx219_mode { > @@ -675,13 +675,13 @@ static int imx219_set_framefmt(struct imx219 *imx219, > bpp = imx219_get_format_bpp(format); > > cci_write(imx219->regmap, IMX219_REG_X_ADD_STA_A, > - crop->left - IMX219_PIXEL_ARRAY_LEFT, &ret); > + crop->left - IMX219_VISIBLE_LEFT, &ret); > cci_write(imx219->regmap, IMX219_REG_X_ADD_END_A, > - crop->left - IMX219_PIXEL_ARRAY_LEFT + crop->width - 1, &ret); > + crop->left - IMX219_VISIBLE_LEFT + crop->width - 1, &ret); > cci_write(imx219->regmap, IMX219_REG_Y_ADD_STA_A, > - crop->top - IMX219_PIXEL_ARRAY_TOP, &ret); > + crop->top - IMX219_VISIBLE_TOP, &ret); > cci_write(imx219->regmap, IMX219_REG_Y_ADD_END_A, > - crop->top - IMX219_PIXEL_ARRAY_TOP + crop->height - 1, &ret); > + crop->top - IMX219_VISIBLE_TOP + crop->height - 1, &ret); > > imx219_get_binning(state, &bin_h, &bin_v); > cci_write(imx219->regmap, IMX219_REG_BINNING_MODE_H, bin_h, &ret); > @@ -867,8 +867,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > * Use binning to maximize the crop rectangle size, and centre it in the > * sensor. > */ > - bin_h = min(IMX219_PIXEL_ARRAY_WIDTH / format->width, 2U); > - bin_v = min(IMX219_PIXEL_ARRAY_HEIGHT / format->height, 2U); > + bin_h = min(IMX219_VISIBLE_WIDTH / format->width, 2U); > + bin_v = min(IMX219_VISIBLE_HEIGHT / format->height, 2U); > > /* Ensure bin_h and bin_v are same to avoid 1:2 or 2:1 stretching */ > binning = min(bin_h, bin_v); > @@ -967,10 +967,10 @@ static int imx219_get_selection(struct v4l2_subdev *sd, > > case V4L2_SEL_TGT_CROP_DEFAULT: > case V4L2_SEL_TGT_CROP_BOUNDS: > - sel->r.top = IMX219_PIXEL_ARRAY_TOP; > - sel->r.left = IMX219_PIXEL_ARRAY_LEFT; > - sel->r.width = IMX219_PIXEL_ARRAY_WIDTH; > - sel->r.height = IMX219_PIXEL_ARRAY_HEIGHT; > + sel->r.top = IMX219_VISIBLE_TOP; > + sel->r.left = IMX219_VISIBLE_LEFT; > + sel->r.width = IMX219_VISIBLE_WIDTH; > + sel->r.height = IMX219_VISIBLE_HEIGHT; > > return 0; > } -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 02/29] media: imx219: Fix maximum frame length in lines 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 01/29] media: imx219: Rename "PIXEL_ARRAY" as "VISIBLE" Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-16 13:56 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 03/29] media: imx219: Set horizontal blanking on mode change Sakari Ailus ` (26 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 The driver used the maximum frame length in lines value of 0xffff, but the maximum appears to be 0xfffe instead. Fix it. Fixes: 1283b3b8f82b ("media: i2c: Add driver for Sony IMX219 sensor") Cc: stable@vger.kernel.org Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> --- drivers/media/i2c/imx219.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index cbd151d4af5f..89061dc1842d 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -72,7 +72,7 @@ /* V_TIMING internal */ #define IMX219_REG_FRM_LENGTH_A CCI_REG16(0x0160) -#define IMX219_FLL_MAX 0xffff +#define IMX219_FLL_MAX 0xfffe #define IMX219_VBLANK_MIN 32 #define IMX219_REG_LINE_LENGTH_A CCI_REG16(0x0162) #define IMX219_LLP_MIN 0x0d78 -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 02/29] media: imx219: Fix maximum frame length in lines 2026-04-08 15:39 ` [PATCH v4 02/29] media: imx219: Fix maximum frame length in lines Sakari Ailus @ 2026-04-16 13:56 ` Laurent Pinchart 0 siblings, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 13:56 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:11PM +0300, Sakari Ailus wrote: > The driver used the maximum frame length in lines value of 0xffff, but the > maximum appears to be 0xfffe instead. Fix it. > > Fixes: 1283b3b8f82b ("media: i2c: Add driver for Sony IMX219 sensor") > Cc: stable@vger.kernel.org > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/media/i2c/imx219.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > index cbd151d4af5f..89061dc1842d 100644 > --- a/drivers/media/i2c/imx219.c > +++ b/drivers/media/i2c/imx219.c > @@ -72,7 +72,7 @@ > > /* V_TIMING internal */ > #define IMX219_REG_FRM_LENGTH_A CCI_REG16(0x0160) > -#define IMX219_FLL_MAX 0xffff > +#define IMX219_FLL_MAX 0xfffe > #define IMX219_VBLANK_MIN 32 > #define IMX219_REG_LINE_LENGTH_A CCI_REG16(0x0162) > #define IMX219_LLP_MIN 0x0d78 -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 03/29] media: imx219: Set horizontal blanking on mode change 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 01/29] media: imx219: Rename "PIXEL_ARRAY" as "VISIBLE" Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 02/29] media: imx219: Fix maximum frame length in lines Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 7:27 ` Jacopo Mondi 2026-04-08 15:39 ` [PATCH v4 04/29] media: imx219: Scale the vblank limits according to rate_factor Sakari Ailus ` (25 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 The driver UAPI is mode-based, allowing the user to choose a mode from a small list based on the output size. The vertical blanking is set based on the mode, do the same for horizontal blanking so the frame rate obtained is constant. Additionally, it's best to use a known-good horizontal blanking value as choosing the value freely may affect image quality. While the minimum value may not be the best value for horizontal blanking, at least it is constant rather than a minimum value of a different configuration. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> --- drivers/media/i2c/imx219.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 89061dc1842d..62a23541b1dc 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -837,11 +837,9 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *format; struct v4l2_rect *crop; u8 bin_h, bin_v, binning; - u32 prev_line_len; int ret; format = v4l2_subdev_state_get_format(state, 0); - prev_line_len = format->width + imx219->hblank->val; /* * Adjust the requested format to match the closest mode. The Bayer @@ -882,7 +880,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { int exposure_max; int exposure_def; - int hblank, llp_min; + int llp_min; int pixel_rate; /* Update limits and set FPS to default */ @@ -924,15 +922,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, llp_min - mode->width); if (ret) return ret; - /* - * Retain PPL setting from previous mode so that the - * line time does not change on a mode change. - * Limits have to be recomputed as the controls define - * the blanking only, so PPL values need to have the - * mode width subtracted. - */ - hblank = prev_line_len - mode->width; - ret = __v4l2_ctrl_s_ctrl(imx219->hblank, hblank); + + ret = __v4l2_ctrl_s_ctrl(imx219->hblank, llp_min - mode->width); if (ret) return ret; -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 03/29] media: imx219: Set horizontal blanking on mode change 2026-04-08 15:39 ` [PATCH v4 03/29] media: imx219: Set horizontal blanking on mode change Sakari Ailus @ 2026-04-10 7:27 ` Jacopo Mondi 2026-04-16 14:22 ` Laurent Pinchart 2026-04-16 14:38 ` Dave Stevenson 0 siblings, 2 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 7:27 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:12PM +0300, Sakari Ailus wrote: > The driver UAPI is mode-based, allowing the user to choose a mode from a > small list based on the output size. The vertical blanking is set based on > the mode, do the same for horizontal blanking so the frame rate obtained > is constant. > > Additionally, it's best to use a known-good horizontal blanking value as > choosing the value freely may affect image quality. While the minimum > value may not be the best value for horizontal blanking, at least it is > constant rather than a minimum value of a different configuration. As Dave suggested, we should probably better define the desired behaviour. As far as I can see the driver doesn't specify a line lenght in the supported_modes array, and I guess we're always running with the min valid blanking. From a libcamera perspective only RPi changes the HBLANK control value, all other pipelines use the default, so if Dave's fine with this, I'm fine as well. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/i2c/imx219.c | 15 +++------------ > 1 file changed, 3 insertions(+), 12 deletions(-) > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > index 89061dc1842d..62a23541b1dc 100644 > --- a/drivers/media/i2c/imx219.c > +++ b/drivers/media/i2c/imx219.c > @@ -837,11 +837,9 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_mbus_framefmt *format; > struct v4l2_rect *crop; > u8 bin_h, bin_v, binning; > - u32 prev_line_len; > int ret; > > format = v4l2_subdev_state_get_format(state, 0); > - prev_line_len = format->width + imx219->hblank->val; > > /* > * Adjust the requested format to match the closest mode. The Bayer > @@ -882,7 +880,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > int exposure_max; > int exposure_def; > - int hblank, llp_min; > + int llp_min; > int pixel_rate; > > /* Update limits and set FPS to default */ > @@ -924,15 +922,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > llp_min - mode->width); > if (ret) > return ret; > - /* > - * Retain PPL setting from previous mode so that the > - * line time does not change on a mode change. > - * Limits have to be recomputed as the controls define > - * the blanking only, so PPL values need to have the > - * mode width subtracted. > - */ > - hblank = prev_line_len - mode->width; > - ret = __v4l2_ctrl_s_ctrl(imx219->hblank, hblank); > + > + ret = __v4l2_ctrl_s_ctrl(imx219->hblank, llp_min - mode->width); > if (ret) > return ret; > > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 03/29] media: imx219: Set horizontal blanking on mode change 2026-04-10 7:27 ` Jacopo Mondi @ 2026-04-16 14:22 ` Laurent Pinchart 2026-04-16 14:38 ` Dave Stevenson 1 sibling, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 14:22 UTC (permalink / raw) To: Jacopo Mondi Cc: Sakari Ailus, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Fri, Apr 10, 2026 at 09:27:34AM +0200, Jacopo Mondi wrote: > On Wed, Apr 08, 2026 at 06:39:12PM +0300, Sakari Ailus wrote: > > The driver UAPI is mode-based, allowing the user to choose a mode from a > > small list based on the output size. The vertical blanking is set based on > > the mode, do the same for horizontal blanking so the frame rate obtained > > is constant. > > > > Additionally, it's best to use a known-good horizontal blanking value as > > choosing the value freely may affect image quality. While the minimum > > value may not be the best value for horizontal blanking, at least it is > > constant rather than a minimum value of a different configuration. > > As Dave suggested, we should probably better define the desired behaviour. > > As far as I can see the driver doesn't specify a line lenght in the > supported_modes array, and I guess we're always running with the min > valid blanking. From a libcamera perspective only RPi changes the > HBLANK control value, all other pipelines use the default, so if > Dave's fine with this, I'm fine as well. Interactions between formats and controls are notoriously badly specified, so I'm all for improving that. That being said, this patch simplifies the behaviour of the driver and leads to more predictable results, so, until we have a formal spec, Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > > --- > > drivers/media/i2c/imx219.c | 15 +++------------ > > 1 file changed, 3 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > > index 89061dc1842d..62a23541b1dc 100644 > > --- a/drivers/media/i2c/imx219.c > > +++ b/drivers/media/i2c/imx219.c > > @@ -837,11 +837,9 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > struct v4l2_mbus_framefmt *format; > > struct v4l2_rect *crop; > > u8 bin_h, bin_v, binning; > > - u32 prev_line_len; > > int ret; > > > > format = v4l2_subdev_state_get_format(state, 0); > > - prev_line_len = format->width + imx219->hblank->val; > > > > /* > > * Adjust the requested format to match the closest mode. The Bayer > > @@ -882,7 +880,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > > int exposure_max; > > int exposure_def; > > - int hblank, llp_min; > > + int llp_min; > > int pixel_rate; > > > > /* Update limits and set FPS to default */ > > @@ -924,15 +922,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > llp_min - mode->width); > > if (ret) > > return ret; > > - /* > > - * Retain PPL setting from previous mode so that the > > - * line time does not change on a mode change. > > - * Limits have to be recomputed as the controls define > > - * the blanking only, so PPL values need to have the > > - * mode width subtracted. > > - */ > > - hblank = prev_line_len - mode->width; > > - ret = __v4l2_ctrl_s_ctrl(imx219->hblank, hblank); > > + > > + ret = __v4l2_ctrl_s_ctrl(imx219->hblank, llp_min - mode->width); > > if (ret) > > return ret; > > -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 03/29] media: imx219: Set horizontal blanking on mode change 2026-04-10 7:27 ` Jacopo Mondi 2026-04-16 14:22 ` Laurent Pinchart @ 2026-04-16 14:38 ` Dave Stevenson 1 sibling, 0 replies; 116+ messages in thread From: Dave Stevenson @ 2026-04-16 14:38 UTC (permalink / raw) To: Jacopo Mondi Cc: Sakari Ailus, linux-media, hans, laurent.pinchart, Prabhakar, Kate Hsuan, Tommaso Merciai, Benjamin Mugnier, Sylvain Petinot, Christophe JAILLET, Julien Massot, Naushir Patuck, Yan, Dongcheng, Cao, Bingbu, Qiu, Tian Shu, Stefan Klug, Mirela Rabulea, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Sakari and Jacopo On Fri, 10 Apr 2026 at 08:27, Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote: > > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:12PM +0300, Sakari Ailus wrote: > > The driver UAPI is mode-based, allowing the user to choose a mode from a > > small list based on the output size. The vertical blanking is set based on > > the mode, do the same for horizontal blanking so the frame rate obtained > > is constant. > > > > Additionally, it's best to use a known-good horizontal blanking value as > > choosing the value freely may affect image quality. While the minimum > > value may not be the best value for horizontal blanking, at least it is > > constant rather than a minimum value of a different configuration. > > As Dave suggested, we should probably better define the desired behaviour. > > As far as I can see the driver doesn't specify a line lenght in the > supported_modes array, and I guess we're always running with the min > valid blanking. From a libcamera perspective only RPi changes the > HBLANK control value, all other pipelines use the default, so if > Dave's fine with this, I'm fine as well. The folks that it's more likely to catch out are those that are driving the sensor directly with V4L2 in a video-device centred world, not those using libcamera. They are in a definite minority though. Overall I'm happy enough that it won't cause any real issues. I've already given a Reviewed-by tag. Dave > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > > --- > > drivers/media/i2c/imx219.c | 15 +++------------ > > 1 file changed, 3 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > > index 89061dc1842d..62a23541b1dc 100644 > > --- a/drivers/media/i2c/imx219.c > > +++ b/drivers/media/i2c/imx219.c > > @@ -837,11 +837,9 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > struct v4l2_mbus_framefmt *format; > > struct v4l2_rect *crop; > > u8 bin_h, bin_v, binning; > > - u32 prev_line_len; > > int ret; > > > > format = v4l2_subdev_state_get_format(state, 0); > > - prev_line_len = format->width + imx219->hblank->val; > > > > /* > > * Adjust the requested format to match the closest mode. The Bayer > > @@ -882,7 +880,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > > int exposure_max; > > int exposure_def; > > - int hblank, llp_min; > > + int llp_min; > > int pixel_rate; > > > > /* Update limits and set FPS to default */ > > @@ -924,15 +922,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > llp_min - mode->width); > > if (ret) > > return ret; > > - /* > > - * Retain PPL setting from previous mode so that the > > - * line time does not change on a mode change. > > - * Limits have to be recomputed as the controls define > > - * the blanking only, so PPL values need to have the > > - * mode width subtracted. > > - */ > > - hblank = prev_line_len - mode->width; > > - ret = __v4l2_ctrl_s_ctrl(imx219->hblank, hblank); > > + > > + ret = __v4l2_ctrl_s_ctrl(imx219->hblank, llp_min - mode->width); > > if (ret) > > return ret; > > > > -- > > 2.47.3 > > > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 04/29] media: imx219: Scale the vblank limits according to rate_factor 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (2 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 03/29] media: imx219: Set horizontal blanking on mode change Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 8:28 ` Jacopo Mondi 2026-04-08 15:39 ` [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning Sakari Ailus ` (24 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 The limits for vertical blanking (and frame length in pixels) is related to the properties of the hardware, it's not in half-line units the driver uses. Multiply the vertical blanking limits by the rate_factor to satisty hardware requirements. Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") Cc: stable@vger.kernel.org Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/imx219.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 62a23541b1dc..6819a2fa3262 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -878,14 +878,17 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { + unsigned int rate_factor = imx219_get_rate_factor(state); int exposure_max; int exposure_def; int llp_min; int pixel_rate; /* Update limits and set FPS to default */ - ret = __v4l2_ctrl_modify_range(imx219->vblank, IMX219_VBLANK_MIN, - IMX219_FLL_MAX - mode->height, 1, + ret = __v4l2_ctrl_modify_range(imx219->vblank, + IMX219_VBLANK_MIN * rate_factor, + (IMX219_FLL_MAX - mode->height) * + rate_factor, rate_factor, mode->fll_def - mode->height); if (ret) return ret; @@ -928,8 +931,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, return ret; /* Scale the pixel rate based on the mode specific factor */ - pixel_rate = imx219_get_pixel_rate(imx219) * - imx219_get_rate_factor(state); + pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, pixel_rate, 1, pixel_rate); if (ret) -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 04/29] media: imx219: Scale the vblank limits according to rate_factor 2026-04-08 15:39 ` [PATCH v4 04/29] media: imx219: Scale the vblank limits according to rate_factor Sakari Ailus @ 2026-04-10 8:28 ` Jacopo Mondi 2026-04-10 8:41 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 8:28 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:13PM +0300, Sakari Ailus wrote: > The limits for vertical blanking (and frame length in pixels) is related > to the properties of the hardware, it's not in half-line units the driver > uses. Multiply the vertical blanking limits by the rate_factor to satisty > hardware requirements. > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > Cc: stable@vger.kernel.org > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> I'm not sure I understand this change. I think we have clarified the imx219 has a "special" binning mode where the ADC consumes two lines at a time, allowing an higher framerate. The driver accounts for that by doubling the PIXEL_RATE control value and halving the VBLANK and EXPOSURE controls values when writing them to registers. Userspace is not concerned with the special binning mode and is not required to halve the values it writes to the VBLANK and EXPOSURE controls. Doesn't the same apply to the limits ? Also, I presume but special binning mode is not well documented, the actual maximum register value for the frame length is still 0xfffe. What have I missed ? > --- > drivers/media/i2c/imx219.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > index 62a23541b1dc..6819a2fa3262 100644 > --- a/drivers/media/i2c/imx219.c > +++ b/drivers/media/i2c/imx219.c > @@ -878,14 +878,17 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > + unsigned int rate_factor = imx219_get_rate_factor(state); > int exposure_max; > int exposure_def; > int llp_min; > int pixel_rate; > > /* Update limits and set FPS to default */ > - ret = __v4l2_ctrl_modify_range(imx219->vblank, IMX219_VBLANK_MIN, > - IMX219_FLL_MAX - mode->height, 1, > + ret = __v4l2_ctrl_modify_range(imx219->vblank, > + IMX219_VBLANK_MIN * rate_factor, > + (IMX219_FLL_MAX - mode->height) * > + rate_factor, rate_factor, > mode->fll_def - mode->height); > if (ret) > return ret; > @@ -928,8 +931,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > return ret; > > /* Scale the pixel rate based on the mode specific factor */ > - pixel_rate = imx219_get_pixel_rate(imx219) * > - imx219_get_rate_factor(state); > + pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; > ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, > pixel_rate, 1, pixel_rate); > if (ret) > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 04/29] media: imx219: Scale the vblank limits according to rate_factor 2026-04-10 8:28 ` Jacopo Mondi @ 2026-04-10 8:41 ` Sakari Ailus 2026-04-10 9:01 ` Jacopo Mondi 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-10 8:41 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Jacopo, On Fri, Apr 10, 2026 at 10:28:27AM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:13PM +0300, Sakari Ailus wrote: > > The limits for vertical blanking (and frame length in pixels) is related > > to the properties of the hardware, it's not in half-line units the driver > > uses. Multiply the vertical blanking limits by the rate_factor to satisty > > hardware requirements. > > > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > Cc: stable@vger.kernel.org > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > I'm not sure I understand this change. > > I think we have clarified the imx219 has a "special" binning mode > where the ADC consumes two lines at a time, allowing an higher > framerate. > > The driver accounts for that by doubling the PIXEL_RATE control value > and halving the VBLANK and EXPOSURE controls values when writing them > to registers. > > Userspace is not concerned with the special binning mode and is not > required to halve the values it writes to the VBLANK and EXPOSURE controls. > > Doesn't the same apply to the limits ? Also, I presume but special > binning mode is not well documented, the actual maximum register value > for the frame length is still 0xfffe. > > What have I missed ? This patch indeed changes the limits of the VBLANK control. The maximum frame length (in hardware) indeed is 0xfffe but the driver only allowed frames up to 0x7fff lines before this patch. > > > --- > > drivers/media/i2c/imx219.c | 10 ++++++---- > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > > index 62a23541b1dc..6819a2fa3262 100644 > > --- a/drivers/media/i2c/imx219.c > > +++ b/drivers/media/i2c/imx219.c > > @@ -878,14 +878,17 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > > + unsigned int rate_factor = imx219_get_rate_factor(state); > > int exposure_max; > > int exposure_def; > > int llp_min; > > int pixel_rate; > > > > /* Update limits and set FPS to default */ > > - ret = __v4l2_ctrl_modify_range(imx219->vblank, IMX219_VBLANK_MIN, > > - IMX219_FLL_MAX - mode->height, 1, > > + ret = __v4l2_ctrl_modify_range(imx219->vblank, > > + IMX219_VBLANK_MIN * rate_factor, > > + (IMX219_FLL_MAX - mode->height) * > > + rate_factor, rate_factor, > > mode->fll_def - mode->height); > > if (ret) > > return ret; > > @@ -928,8 +931,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > return ret; > > > > /* Scale the pixel rate based on the mode specific factor */ > > - pixel_rate = imx219_get_pixel_rate(imx219) * > > - imx219_get_rate_factor(state); > > + pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; > > ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, > > pixel_rate, 1, pixel_rate); > > if (ret) -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 04/29] media: imx219: Scale the vblank limits according to rate_factor 2026-04-10 8:41 ` Sakari Ailus @ 2026-04-10 9:01 ` Jacopo Mondi 2026-04-20 21:08 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 9:01 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Fri, Apr 10, 2026 at 11:41:45AM +0300, Sakari Ailus wrote: > Hi Jacopo, > > On Fri, Apr 10, 2026 at 10:28:27AM +0200, Jacopo Mondi wrote: > > Hi Sakari > > > > On Wed, Apr 08, 2026 at 06:39:13PM +0300, Sakari Ailus wrote: > > > The limits for vertical blanking (and frame length in pixels) is related > > > to the properties of the hardware, it's not in half-line units the driver > > > uses. Multiply the vertical blanking limits by the rate_factor to satisty > > > hardware requirements. > > > > > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > > Cc: stable@vger.kernel.org > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > I'm not sure I understand this change. > > > > I think we have clarified the imx219 has a "special" binning mode > > where the ADC consumes two lines at a time, allowing an higher > > framerate. > > > > The driver accounts for that by doubling the PIXEL_RATE control value > > and halving the VBLANK and EXPOSURE controls values when writing them > > to registers. > > > > Userspace is not concerned with the special binning mode and is not > > required to halve the values it writes to the VBLANK and EXPOSURE controls. > > > > Doesn't the same apply to the limits ? Also, I presume but special > > binning mode is not well documented, the actual maximum register value > > for the frame length is still 0xfffe. > > > > What have I missed ? > > This patch indeed changes the limits of the VBLANK control. The maximum > frame length (in hardware) indeed is 0xfffe but the driver only allowed > frames up to 0x7fff lines before this patch. > Isn't userspace still allowed to write values up to 0xfffe ? What ends up in registers is halved because, again in my speculative understanding of the special binning mode, when using this special mode two lines at the time are sampled. Anyway, provided you've tested all the use cases we tested when implementing support for the special binning mode, and that Dave is fine being him the maintainer of this driver, I'll be happy to shut up. > > > > > --- > > > drivers/media/i2c/imx219.c | 10 ++++++---- > > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > > > index 62a23541b1dc..6819a2fa3262 100644 > > > --- a/drivers/media/i2c/imx219.c > > > +++ b/drivers/media/i2c/imx219.c > > > @@ -878,14 +878,17 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > > > > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > > > + unsigned int rate_factor = imx219_get_rate_factor(state); > > > int exposure_max; > > > int exposure_def; > > > int llp_min; > > > int pixel_rate; > > > > > > /* Update limits and set FPS to default */ > > > - ret = __v4l2_ctrl_modify_range(imx219->vblank, IMX219_VBLANK_MIN, > > > - IMX219_FLL_MAX - mode->height, 1, > > > + ret = __v4l2_ctrl_modify_range(imx219->vblank, > > > + IMX219_VBLANK_MIN * rate_factor, > > > + (IMX219_FLL_MAX - mode->height) * > > > + rate_factor, rate_factor, > > > mode->fll_def - mode->height); > > > if (ret) > > > return ret; > > > @@ -928,8 +931,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > return ret; > > > > > > /* Scale the pixel rate based on the mode specific factor */ > > > - pixel_rate = imx219_get_pixel_rate(imx219) * > > > - imx219_get_rate_factor(state); > > > + pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; > > > ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, > > > pixel_rate, 1, pixel_rate); > > > if (ret) > > -- > Regards, > > Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 04/29] media: imx219: Scale the vblank limits according to rate_factor 2026-04-10 9:01 ` Jacopo Mondi @ 2026-04-20 21:08 ` Sakari Ailus 0 siblings, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-20 21:08 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Jacopo, On Fri, Apr 10, 2026 at 11:01:02AM +0200, Jacopo Mondi wrote: > On Fri, Apr 10, 2026 at 11:41:45AM +0300, Sakari Ailus wrote: > > Hi Jacopo, > > > > On Fri, Apr 10, 2026 at 10:28:27AM +0200, Jacopo Mondi wrote: > > > Hi Sakari > > > > > > On Wed, Apr 08, 2026 at 06:39:13PM +0300, Sakari Ailus wrote: > > > > The limits for vertical blanking (and frame length in pixels) is related > > > > to the properties of the hardware, it's not in half-line units the driver > > > > uses. Multiply the vertical blanking limits by the rate_factor to satisty > > > > hardware requirements. > > > > > > > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > > > Cc: stable@vger.kernel.org > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > > > I'm not sure I understand this change. > > > > > > I think we have clarified the imx219 has a "special" binning mode > > > where the ADC consumes two lines at a time, allowing an higher > > > framerate. > > > > > > The driver accounts for that by doubling the PIXEL_RATE control value > > > and halving the VBLANK and EXPOSURE controls values when writing them > > > to registers. > > > > > > Userspace is not concerned with the special binning mode and is not > > > required to halve the values it writes to the VBLANK and EXPOSURE controls. > > > > > > Doesn't the same apply to the limits ? Also, I presume but special > > > binning mode is not well documented, the actual maximum register value > > > for the frame length is still 0xfffe. > > > > > > What have I missed ? > > > > This patch indeed changes the limits of the VBLANK control. The maximum > > frame length (in hardware) indeed is 0xfffe but the driver only allowed > > frames up to 0x7fff lines before this patch. > > > > Isn't userspace still allowed to write values up to 0xfffe ? > > What ends up in registers is halved because, again in my speculative > understanding of the special binning mode, when using this special > mode two lines at the time are sampled. Two rows of pixels are indeed sampled at the same time, but after the analogue binning, these are a single line of samples for the digital processing steps of the sensor. The maximum value of the frame length in lines registers is thus unaffected by analogue binning. -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (3 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 04/29] media: imx219: Scale the vblank limits according to rate_factor Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 8:42 ` Jacopo Mondi 2026-04-15 17:15 ` Jai Luthra 2026-04-08 15:39 ` [PATCH v4 06/29] media: imx219: Don't update exposure limits while setting format Sakari Ailus ` (23 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 When vertical analogue binning is in use, the minimum frame length in lines decreases to around half of the normal. In relation to the sensor's output size this means vertical blanking can be negative but that's not an issue as control values are signed. Remove the workaround for this non-issue that doubled the pixel rate, frame length in lines and exposure time. The resulting change also fixes the minimum, the maximum and the step values for the control. Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/imx219.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 6819a2fa3262..a72630ad1561 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -420,15 +420,6 @@ static void imx219_get_binning(struct v4l2_subdev_state *state, u8 *bin_h, } -static inline u32 imx219_get_rate_factor(struct v4l2_subdev_state *state) -{ - u8 bin_h, bin_v; - - imx219_get_binning(state, &bin_h, &bin_v); - - return (bin_h & bin_v) == IMX219_BINNING_X2_ANALOG ? 2 : 1; -} - /* ----------------------------------------------------------------------------- * Controls */ @@ -440,12 +431,10 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd); const struct v4l2_mbus_framefmt *format; struct v4l2_subdev_state *state; - u32 rate_factor; int ret = 0; state = v4l2_subdev_get_locked_active_state(&imx219->sd); format = v4l2_subdev_state_get_format(state, 0); - rate_factor = imx219_get_rate_factor(state); if (ctrl->id == V4L2_CID_VBLANK) { int exposure_max, exposure_def; @@ -478,7 +467,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) break; case V4L2_CID_EXPOSURE: cci_write(imx219->regmap, IMX219_REG_EXPOSURE, - ctrl->val / rate_factor, &ret); + ctrl->val, &ret); break; case V4L2_CID_DIGITAL_GAIN: cci_write(imx219->regmap, IMX219_REG_DIGITAL_GAIN, @@ -495,7 +484,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) break; case V4L2_CID_VBLANK: cci_write(imx219->regmap, IMX219_REG_FRM_LENGTH_A, - (format->height + ctrl->val) / rate_factor, &ret); + format->height + ctrl->val, &ret); break; case V4L2_CID_HBLANK: cci_write(imx219->regmap, IMX219_REG_LINE_LENGTH_A, @@ -878,7 +867,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { - unsigned int rate_factor = imx219_get_rate_factor(state); int exposure_max; int exposure_def; int llp_min; @@ -886,15 +874,16 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, /* Update limits and set FPS to default */ ret = __v4l2_ctrl_modify_range(imx219->vblank, - IMX219_VBLANK_MIN * rate_factor, - (IMX219_FLL_MAX - mode->height) * - rate_factor, rate_factor, - mode->fll_def - mode->height); + (int)(mode->height / binning), + IMX219_FLL_MAX - mode->height, 1, + (int)(mode->fll_def / binning) - + (int)mode->height); if (ret) return ret; ret = __v4l2_ctrl_s_ctrl(imx219->vblank, - mode->fll_def - mode->height); + (int)(mode->fll_def / binning) - + (int)mode->height); if (ret) return ret; @@ -931,7 +920,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, return ret; /* Scale the pixel rate based on the mode specific factor */ - pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; + pixel_rate = imx219_get_pixel_rate(imx219); ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, pixel_rate, 1, pixel_rate); if (ret) -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning 2026-04-08 15:39 ` [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning Sakari Ailus @ 2026-04-10 8:42 ` Jacopo Mondi 2026-04-10 8:46 ` Sakari Ailus 2026-04-15 14:38 ` Jai Luthra 2026-04-15 17:15 ` Jai Luthra 1 sibling, 2 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 8:42 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:14PM +0300, Sakari Ailus wrote: > When vertical analogue binning is in use, the minimum frame length in > lines decreases to around half of the normal. In relation to the sensor's > output size this means vertical blanking can be negative but that's not an > issue as control values are signed. Remove the workaround for this > non-issue that doubled the pixel rate, frame length in lines and exposure > time. I don't think this was a workaround. Doubling the pixel rate and halving the values written to registers for EXPOSURE and VBLANK allowed userspace to maintain a consistent view while the driver accounts for the special binning mode where, at least in my latest understanding, the sensor averages two lines before passing them to the ADC. I am missing in which case, with the current driver implementation, the vertical blanking can be negative. > > The resulting change also fixes the minimum, the maximum and the step > values for the control. > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Jai, and others including Dave and me, have spent quite some time testing and implementing proper support for the special analogue binning mode for this sensor. Of course we might have missed something obvious, but I'm still missing what you're trying to fix here. > --- > drivers/media/i2c/imx219.c | 29 +++++++++-------------------- > 1 file changed, 9 insertions(+), 20 deletions(-) > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > index 6819a2fa3262..a72630ad1561 100644 > --- a/drivers/media/i2c/imx219.c > +++ b/drivers/media/i2c/imx219.c > @@ -420,15 +420,6 @@ static void imx219_get_binning(struct v4l2_subdev_state *state, u8 *bin_h, > > } > > -static inline u32 imx219_get_rate_factor(struct v4l2_subdev_state *state) > -{ > - u8 bin_h, bin_v; > - > - imx219_get_binning(state, &bin_h, &bin_v); > - > - return (bin_h & bin_v) == IMX219_BINNING_X2_ANALOG ? 2 : 1; > -} > - > /* ----------------------------------------------------------------------------- > * Controls > */ > @@ -440,12 +431,10 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd); > const struct v4l2_mbus_framefmt *format; > struct v4l2_subdev_state *state; > - u32 rate_factor; > int ret = 0; > > state = v4l2_subdev_get_locked_active_state(&imx219->sd); > format = v4l2_subdev_state_get_format(state, 0); > - rate_factor = imx219_get_rate_factor(state); > > if (ctrl->id == V4L2_CID_VBLANK) { > int exposure_max, exposure_def; > @@ -478,7 +467,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > break; > case V4L2_CID_EXPOSURE: > cci_write(imx219->regmap, IMX219_REG_EXPOSURE, > - ctrl->val / rate_factor, &ret); > + ctrl->val, &ret); > break; > case V4L2_CID_DIGITAL_GAIN: > cci_write(imx219->regmap, IMX219_REG_DIGITAL_GAIN, > @@ -495,7 +484,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > break; > case V4L2_CID_VBLANK: > cci_write(imx219->regmap, IMX219_REG_FRM_LENGTH_A, > - (format->height + ctrl->val) / rate_factor, &ret); > + format->height + ctrl->val, &ret); > break; > case V4L2_CID_HBLANK: > cci_write(imx219->regmap, IMX219_REG_LINE_LENGTH_A, > @@ -878,7 +867,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > - unsigned int rate_factor = imx219_get_rate_factor(state); > int exposure_max; > int exposure_def; > int llp_min; > @@ -886,15 +874,16 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > /* Update limits and set FPS to default */ > ret = __v4l2_ctrl_modify_range(imx219->vblank, > - IMX219_VBLANK_MIN * rate_factor, > - (IMX219_FLL_MAX - mode->height) * > - rate_factor, rate_factor, > - mode->fll_def - mode->height); > + (int)(mode->height / binning), > + IMX219_FLL_MAX - mode->height, 1, > + (int)(mode->fll_def / binning) - > + (int)mode->height); > if (ret) > return ret; > > ret = __v4l2_ctrl_s_ctrl(imx219->vblank, > - mode->fll_def - mode->height); > + (int)(mode->fll_def / binning) - > + (int)mode->height); > if (ret) > return ret; > > @@ -931,7 +920,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > return ret; > > /* Scale the pixel rate based on the mode specific factor */ > - pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; > + pixel_rate = imx219_get_pixel_rate(imx219); > ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, > pixel_rate, 1, pixel_rate); > if (ret) > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning 2026-04-10 8:42 ` Jacopo Mondi @ 2026-04-10 8:46 ` Sakari Ailus 2026-04-10 8:56 ` Jacopo Mondi 2026-04-15 14:38 ` Jai Luthra 1 sibling, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-10 8:46 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Jacopo, On Fri, Apr 10, 2026 at 10:42:22AM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:14PM +0300, Sakari Ailus wrote: > > When vertical analogue binning is in use, the minimum frame length in > > lines decreases to around half of the normal. In relation to the sensor's > > output size this means vertical blanking can be negative but that's not an > > issue as control values are signed. Remove the workaround for this > > non-issue that doubled the pixel rate, frame length in lines and exposure > > time. > > I don't think this was a workaround. Doubling the pixel rate and You could also call it a bug. :-) If you look what the driver does with PLL, you can see the PLL configuration is always the same independently of any binning configuration. > halving the values written to registers for EXPOSURE and VBLANK > allowed userspace to maintain a consistent view while the driver > accounts for the special binning mode where, at least in my latest > understanding, the sensor averages two lines before passing them to > the ADC. > > I am missing in which case, with the current driver implementation, > the vertical blanking can be negative. > > > > > The resulting change also fixes the minimum, the maximum and the step > > values for the control. > > > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > Jai, and others including Dave and me, have spent quite some time > testing and implementing proper support for the special analogue > binning mode for this sensor. Of course we might have missed something > obvious, but I'm still missing what you're trying to fix here. > > > --- > > drivers/media/i2c/imx219.c | 29 +++++++++-------------------- > > 1 file changed, 9 insertions(+), 20 deletions(-) > > > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > > index 6819a2fa3262..a72630ad1561 100644 > > --- a/drivers/media/i2c/imx219.c > > +++ b/drivers/media/i2c/imx219.c > > @@ -420,15 +420,6 @@ static void imx219_get_binning(struct v4l2_subdev_state *state, u8 *bin_h, > > > > } > > > > -static inline u32 imx219_get_rate_factor(struct v4l2_subdev_state *state) > > -{ > > - u8 bin_h, bin_v; > > - > > - imx219_get_binning(state, &bin_h, &bin_v); > > - > > - return (bin_h & bin_v) == IMX219_BINNING_X2_ANALOG ? 2 : 1; > > -} > > - > > /* ----------------------------------------------------------------------------- > > * Controls > > */ > > @@ -440,12 +431,10 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd); > > const struct v4l2_mbus_framefmt *format; > > struct v4l2_subdev_state *state; > > - u32 rate_factor; > > int ret = 0; > > > > state = v4l2_subdev_get_locked_active_state(&imx219->sd); > > format = v4l2_subdev_state_get_format(state, 0); > > - rate_factor = imx219_get_rate_factor(state); > > > > if (ctrl->id == V4L2_CID_VBLANK) { > > int exposure_max, exposure_def; > > @@ -478,7 +467,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > break; > > case V4L2_CID_EXPOSURE: > > cci_write(imx219->regmap, IMX219_REG_EXPOSURE, > > - ctrl->val / rate_factor, &ret); > > + ctrl->val, &ret); > > break; > > case V4L2_CID_DIGITAL_GAIN: > > cci_write(imx219->regmap, IMX219_REG_DIGITAL_GAIN, > > @@ -495,7 +484,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > break; > > case V4L2_CID_VBLANK: > > cci_write(imx219->regmap, IMX219_REG_FRM_LENGTH_A, > > - (format->height + ctrl->val) / rate_factor, &ret); > > + format->height + ctrl->val, &ret); > > break; > > case V4L2_CID_HBLANK: > > cci_write(imx219->regmap, IMX219_REG_LINE_LENGTH_A, > > @@ -878,7 +867,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > > - unsigned int rate_factor = imx219_get_rate_factor(state); > > int exposure_max; > > int exposure_def; > > int llp_min; > > @@ -886,15 +874,16 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > > /* Update limits and set FPS to default */ > > ret = __v4l2_ctrl_modify_range(imx219->vblank, > > - IMX219_VBLANK_MIN * rate_factor, > > - (IMX219_FLL_MAX - mode->height) * > > - rate_factor, rate_factor, > > - mode->fll_def - mode->height); > > + (int)(mode->height / binning), > > + IMX219_FLL_MAX - mode->height, 1, > > + (int)(mode->fll_def / binning) - > > + (int)mode->height); > > if (ret) > > return ret; > > > > ret = __v4l2_ctrl_s_ctrl(imx219->vblank, > > - mode->fll_def - mode->height); > > + (int)(mode->fll_def / binning) - > > + (int)mode->height); > > if (ret) > > return ret; > > > > @@ -931,7 +920,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > return ret; > > > > /* Scale the pixel rate based on the mode specific factor */ > > - pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; > > + pixel_rate = imx219_get_pixel_rate(imx219); > > ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, > > pixel_rate, 1, pixel_rate); > > if (ret) -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning 2026-04-10 8:46 ` Sakari Ailus @ 2026-04-10 8:56 ` Jacopo Mondi 2026-04-10 9:04 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 8:56 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Sakari On Fri, Apr 10, 2026 at 11:46:49AM +0300, Sakari Ailus wrote: > Hi Jacopo, > > On Fri, Apr 10, 2026 at 10:42:22AM +0200, Jacopo Mondi wrote: > > Hi Sakari > > > > On Wed, Apr 08, 2026 at 06:39:14PM +0300, Sakari Ailus wrote: > > > When vertical analogue binning is in use, the minimum frame length in > > > lines decreases to around half of the normal. In relation to the sensor's > > > output size this means vertical blanking can be negative but that's not an > > > issue as control values are signed. Remove the workaround for this > > > non-issue that doubled the pixel rate, frame length in lines and exposure > > > time. > > > > I don't think this was a workaround. Doubling the pixel rate and > > You could also call it a bug. :-) If you look what the driver does with > PLL, you can see the PLL configuration is always the same independently of > any binning configuration. Are you suggesting doubling the PIXEL_RATE is not accurate as the PLL config doesn't change ? I might be very wrong, but in my understanding this is partially why the "special" binning mode is special. We don't have documentation for it and I'm maybe speculating here. Is doubling the VBLANK limit to a number larger of the register maximum value more accurate ? > > > halving the values written to registers for EXPOSURE and VBLANK > > allowed userspace to maintain a consistent view while the driver > > accounts for the special binning mode where, at least in my latest > > understanding, the sensor averages two lines before passing them to > > the ADC. > > > > I am missing in which case, with the current driver implementation, > > the vertical blanking can be negative. > > > > > > > > The resulting change also fixes the minimum, the maximum and the step > > > values for the control. > > > > > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > Jai, and others including Dave and me, have spent quite some time > > testing and implementing proper support for the special analogue > > binning mode for this sensor. Of course we might have missed something > > obvious, but I'm still missing what you're trying to fix here. > > still not sure what you're trying to fix here > > > --- > > > drivers/media/i2c/imx219.c | 29 +++++++++-------------------- > > > 1 file changed, 9 insertions(+), 20 deletions(-) > > > > > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > > > index 6819a2fa3262..a72630ad1561 100644 > > > --- a/drivers/media/i2c/imx219.c > > > +++ b/drivers/media/i2c/imx219.c > > > @@ -420,15 +420,6 @@ static void imx219_get_binning(struct v4l2_subdev_state *state, u8 *bin_h, > > > > > > } > > > > > > -static inline u32 imx219_get_rate_factor(struct v4l2_subdev_state *state) > > > -{ > > > - u8 bin_h, bin_v; > > > - > > > - imx219_get_binning(state, &bin_h, &bin_v); > > > - > > > - return (bin_h & bin_v) == IMX219_BINNING_X2_ANALOG ? 2 : 1; > > > -} > > > - > > > /* ----------------------------------------------------------------------------- > > > * Controls > > > */ > > > @@ -440,12 +431,10 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > > struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd); > > > const struct v4l2_mbus_framefmt *format; > > > struct v4l2_subdev_state *state; > > > - u32 rate_factor; > > > int ret = 0; > > > > > > state = v4l2_subdev_get_locked_active_state(&imx219->sd); > > > format = v4l2_subdev_state_get_format(state, 0); > > > - rate_factor = imx219_get_rate_factor(state); > > > > > > if (ctrl->id == V4L2_CID_VBLANK) { > > > int exposure_max, exposure_def; > > > @@ -478,7 +467,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > > break; > > > case V4L2_CID_EXPOSURE: > > > cci_write(imx219->regmap, IMX219_REG_EXPOSURE, > > > - ctrl->val / rate_factor, &ret); > > > + ctrl->val, &ret); > > > break; > > > case V4L2_CID_DIGITAL_GAIN: > > > cci_write(imx219->regmap, IMX219_REG_DIGITAL_GAIN, > > > @@ -495,7 +484,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > > break; > > > case V4L2_CID_VBLANK: > > > cci_write(imx219->regmap, IMX219_REG_FRM_LENGTH_A, > > > - (format->height + ctrl->val) / rate_factor, &ret); > > > + format->height + ctrl->val, &ret); > > > break; > > > case V4L2_CID_HBLANK: > > > cci_write(imx219->regmap, IMX219_REG_LINE_LENGTH_A, > > > @@ -878,7 +867,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > > > > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > > > - unsigned int rate_factor = imx219_get_rate_factor(state); > > > int exposure_max; > > > int exposure_def; > > > int llp_min; > > > @@ -886,15 +874,16 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > > > > /* Update limits and set FPS to default */ > > > ret = __v4l2_ctrl_modify_range(imx219->vblank, > > > - IMX219_VBLANK_MIN * rate_factor, > > > - (IMX219_FLL_MAX - mode->height) * > > > - rate_factor, rate_factor, > > > - mode->fll_def - mode->height); > > > + (int)(mode->height / binning), > > > + IMX219_FLL_MAX - mode->height, 1, > > > + (int)(mode->fll_def / binning) - > > > + (int)mode->height); > > > if (ret) > > > return ret; > > > > > > ret = __v4l2_ctrl_s_ctrl(imx219->vblank, > > > - mode->fll_def - mode->height); > > > + (int)(mode->fll_def / binning) - > > > + (int)mode->height); > > > if (ret) > > > return ret; > > > > > > @@ -931,7 +920,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > return ret; > > > > > > /* Scale the pixel rate based on the mode specific factor */ > > > - pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; > > > + pixel_rate = imx219_get_pixel_rate(imx219); > > > ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, > > > pixel_rate, 1, pixel_rate); > > > if (ret) > > -- > Regards, > > Sakari Ailus > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning 2026-04-10 8:56 ` Jacopo Mondi @ 2026-04-10 9:04 ` Sakari Ailus 2026-04-10 13:38 ` Jacopo Mondi 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-10 9:04 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Jacopo, On Fri, Apr 10, 2026 at 10:56:46AM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Fri, Apr 10, 2026 at 11:46:49AM +0300, Sakari Ailus wrote: > > Hi Jacopo, > > > > On Fri, Apr 10, 2026 at 10:42:22AM +0200, Jacopo Mondi wrote: > > > Hi Sakari > > > > > > On Wed, Apr 08, 2026 at 06:39:14PM +0300, Sakari Ailus wrote: > > > > When vertical analogue binning is in use, the minimum frame length in > > > > lines decreases to around half of the normal. In relation to the sensor's > > > > output size this means vertical blanking can be negative but that's not an > > > > issue as control values are signed. Remove the workaround for this > > > > non-issue that doubled the pixel rate, frame length in lines and exposure > > > > time. > > > > > > I don't think this was a workaround. Doubling the pixel rate and > > > > You could also call it a bug. :-) If you look what the driver does with > > PLL, you can see the PLL configuration is always the same independently of > > any binning configuration. > > Are you suggesting doubling the PIXEL_RATE is not accurate as the PLL > config doesn't change ? I might be very wrong, but in my understanding > this is partially why the "special" binning mode is special. We don't > have documentation for it and I'm maybe speculating here. I guess this comes down to the definition of PIXEL_RATE. I checked the control's documentation and I think it's indeed possible to understand it the way you suggest above. The control's value indeed was meant to reflect the actual frequency the pixels are read in the sensor's pixel array. The fact that the sensor uses analogue binning to sample two (or in some cases more) pixels into one output pixel in a single cycle doesn't change the frequency. > > Is doubling the VBLANK limit to a number larger of the register > maximum value more accurate ? > > > > > > halving the values written to registers for EXPOSURE and VBLANK > > > allowed userspace to maintain a consistent view while the driver > > > accounts for the special binning mode where, at least in my latest > > > understanding, the sensor averages two lines before passing them to > > > the ADC. > > > > > > I am missing in which case, with the current driver implementation, > > > the vertical blanking can be negative. > > > > > > > > > > > The resulting change also fixes the minimum, the maximum and the step > > > > values for the control. > > > > > > > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > > > Jai, and others including Dave and me, have spent quite some time > > > testing and implementing proper support for the special analogue > > > binning mode for this sensor. Of course we might have missed something > > > obvious, but I'm still missing what you're trying to fix here. > > > > > still not sure what you're trying to fix here > > > > > --- > > > > drivers/media/i2c/imx219.c | 29 +++++++++-------------------- > > > > 1 file changed, 9 insertions(+), 20 deletions(-) > > > > > > > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > > > > index 6819a2fa3262..a72630ad1561 100644 > > > > --- a/drivers/media/i2c/imx219.c > > > > +++ b/drivers/media/i2c/imx219.c > > > > @@ -420,15 +420,6 @@ static void imx219_get_binning(struct v4l2_subdev_state *state, u8 *bin_h, > > > > > > > > } > > > > > > > > -static inline u32 imx219_get_rate_factor(struct v4l2_subdev_state *state) > > > > -{ > > > > - u8 bin_h, bin_v; > > > > - > > > > - imx219_get_binning(state, &bin_h, &bin_v); > > > > - > > > > - return (bin_h & bin_v) == IMX219_BINNING_X2_ANALOG ? 2 : 1; > > > > -} > > > > - > > > > /* ----------------------------------------------------------------------------- > > > > * Controls > > > > */ > > > > @@ -440,12 +431,10 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > > > struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd); > > > > const struct v4l2_mbus_framefmt *format; > > > > struct v4l2_subdev_state *state; > > > > - u32 rate_factor; > > > > int ret = 0; > > > > > > > > state = v4l2_subdev_get_locked_active_state(&imx219->sd); > > > > format = v4l2_subdev_state_get_format(state, 0); > > > > - rate_factor = imx219_get_rate_factor(state); > > > > > > > > if (ctrl->id == V4L2_CID_VBLANK) { > > > > int exposure_max, exposure_def; > > > > @@ -478,7 +467,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > > > break; > > > > case V4L2_CID_EXPOSURE: > > > > cci_write(imx219->regmap, IMX219_REG_EXPOSURE, > > > > - ctrl->val / rate_factor, &ret); > > > > + ctrl->val, &ret); > > > > break; > > > > case V4L2_CID_DIGITAL_GAIN: > > > > cci_write(imx219->regmap, IMX219_REG_DIGITAL_GAIN, > > > > @@ -495,7 +484,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > > > break; > > > > case V4L2_CID_VBLANK: > > > > cci_write(imx219->regmap, IMX219_REG_FRM_LENGTH_A, > > > > - (format->height + ctrl->val) / rate_factor, &ret); > > > > + format->height + ctrl->val, &ret); > > > > break; > > > > case V4L2_CID_HBLANK: > > > > cci_write(imx219->regmap, IMX219_REG_LINE_LENGTH_A, > > > > @@ -878,7 +867,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > > > > > > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > > > > - unsigned int rate_factor = imx219_get_rate_factor(state); > > > > int exposure_max; > > > > int exposure_def; > > > > int llp_min; > > > > @@ -886,15 +874,16 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > > > > > > /* Update limits and set FPS to default */ > > > > ret = __v4l2_ctrl_modify_range(imx219->vblank, > > > > - IMX219_VBLANK_MIN * rate_factor, > > > > - (IMX219_FLL_MAX - mode->height) * > > > > - rate_factor, rate_factor, > > > > - mode->fll_def - mode->height); > > > > + (int)(mode->height / binning), > > > > + IMX219_FLL_MAX - mode->height, 1, > > > > + (int)(mode->fll_def / binning) - > > > > + (int)mode->height); > > > > if (ret) > > > > return ret; > > > > > > > > ret = __v4l2_ctrl_s_ctrl(imx219->vblank, > > > > - mode->fll_def - mode->height); > > > > + (int)(mode->fll_def / binning) - > > > > + (int)mode->height); > > > > if (ret) > > > > return ret; > > > > > > > > @@ -931,7 +920,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > > return ret; > > > > > > > > /* Scale the pixel rate based on the mode specific factor */ > > > > - pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; > > > > + pixel_rate = imx219_get_pixel_rate(imx219); > > > > ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, > > > > pixel_rate, 1, pixel_rate); > > > > if (ret) > > > > -- > > Regards, > > > > Sakari Ailus > > -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning 2026-04-10 9:04 ` Sakari Ailus @ 2026-04-10 13:38 ` Jacopo Mondi 0 siblings, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 13:38 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Sakari On Fri, Apr 10, 2026 at 12:04:10PM +0300, Sakari Ailus wrote: > Hi Jacopo, > > On Fri, Apr 10, 2026 at 10:56:46AM +0200, Jacopo Mondi wrote: > > Hi Sakari > > > > On Fri, Apr 10, 2026 at 11:46:49AM +0300, Sakari Ailus wrote: > > > Hi Jacopo, > > > > > > On Fri, Apr 10, 2026 at 10:42:22AM +0200, Jacopo Mondi wrote: > > > > Hi Sakari > > > > > > > > On Wed, Apr 08, 2026 at 06:39:14PM +0300, Sakari Ailus wrote: > > > > > When vertical analogue binning is in use, the minimum frame length in > > > > > lines decreases to around half of the normal. In relation to the sensor's > > > > > output size this means vertical blanking can be negative but that's not an > > > > > issue as control values are signed. Remove the workaround for this > > > > > non-issue that doubled the pixel rate, frame length in lines and exposure > > > > > time. > > > > > > > > I don't think this was a workaround. Doubling the pixel rate and > > > > > > You could also call it a bug. :-) If you look what the driver does with > > > PLL, you can see the PLL configuration is always the same independently of > > > any binning configuration. > > > > Are you suggesting doubling the PIXEL_RATE is not accurate as the PLL > > config doesn't change ? I might be very wrong, but in my understanding > > this is partially why the "special" binning mode is special. We don't > > have documentation for it and I'm maybe speculating here. > > I guess this comes down to the definition of PIXEL_RATE. I checked the > control's documentation and I think it's indeed possible to understand it > the way you suggest above. > > The control's value indeed was meant to reflect the actual frequency the > pixels are read in the sensor's pixel array. The fact that the sensor uses > analogue binning to sample two (or in some cases more) pixels into one > output pixel in a single cycle doesn't change the frequency. > Not sure, I feel like we're talking details :) To be honest I value consistency towards userspace more than exposing the exact details of the sensor's configuration. It might be argued that the sole purpose of PIXEL_RATE is to allow userspace to calculate the frame duration instead of reporting the exact PLL configuration. I'll defer the call to you and Dave, but I suggst to test this carefully because getting it right hasn't been easy as Jai can confirm > > > > Is doubling the VBLANK limit to a number larger of the register > > maximum value more accurate ? > > > > > > > > > halving the values written to registers for EXPOSURE and VBLANK > > > > allowed userspace to maintain a consistent view while the driver > > > > accounts for the special binning mode where, at least in my latest > > > > understanding, the sensor averages two lines before passing them to > > > > the ADC. > > > > > > > > I am missing in which case, with the current driver implementation, > > > > the vertical blanking can be negative. > > > > > > > > > > > > > > The resulting change also fixes the minimum, the maximum and the step > > > > > values for the control. > > > > > > > > > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > > > > > Jai, and others including Dave and me, have spent quite some time > > > > testing and implementing proper support for the special analogue > > > > binning mode for this sensor. Of course we might have missed something > > > > obvious, but I'm still missing what you're trying to fix here. > > > > > > > > still not sure what you're trying to fix here > > > > > > > --- > > > > > drivers/media/i2c/imx219.c | 29 +++++++++-------------------- > > > > > 1 file changed, 9 insertions(+), 20 deletions(-) > > > > > > > > > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > > > > > index 6819a2fa3262..a72630ad1561 100644 > > > > > --- a/drivers/media/i2c/imx219.c > > > > > +++ b/drivers/media/i2c/imx219.c > > > > > @@ -420,15 +420,6 @@ static void imx219_get_binning(struct v4l2_subdev_state *state, u8 *bin_h, > > > > > > > > > > } > > > > > > > > > > -static inline u32 imx219_get_rate_factor(struct v4l2_subdev_state *state) > > > > > -{ > > > > > - u8 bin_h, bin_v; > > > > > - > > > > > - imx219_get_binning(state, &bin_h, &bin_v); > > > > > - > > > > > - return (bin_h & bin_v) == IMX219_BINNING_X2_ANALOG ? 2 : 1; > > > > > -} > > > > > - > > > > > /* ----------------------------------------------------------------------------- > > > > > * Controls > > > > > */ > > > > > @@ -440,12 +431,10 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > > > > struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd); > > > > > const struct v4l2_mbus_framefmt *format; > > > > > struct v4l2_subdev_state *state; > > > > > - u32 rate_factor; > > > > > int ret = 0; > > > > > > > > > > state = v4l2_subdev_get_locked_active_state(&imx219->sd); > > > > > format = v4l2_subdev_state_get_format(state, 0); > > > > > - rate_factor = imx219_get_rate_factor(state); > > > > > > > > > > if (ctrl->id == V4L2_CID_VBLANK) { > > > > > int exposure_max, exposure_def; > > > > > @@ -478,7 +467,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > > > > break; > > > > > case V4L2_CID_EXPOSURE: > > > > > cci_write(imx219->regmap, IMX219_REG_EXPOSURE, > > > > > - ctrl->val / rate_factor, &ret); > > > > > + ctrl->val, &ret); > > > > > break; > > > > > case V4L2_CID_DIGITAL_GAIN: > > > > > cci_write(imx219->regmap, IMX219_REG_DIGITAL_GAIN, > > > > > @@ -495,7 +484,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > > > > break; > > > > > case V4L2_CID_VBLANK: > > > > > cci_write(imx219->regmap, IMX219_REG_FRM_LENGTH_A, > > > > > - (format->height + ctrl->val) / rate_factor, &ret); > > > > > + format->height + ctrl->val, &ret); > > > > > break; > > > > > case V4L2_CID_HBLANK: > > > > > cci_write(imx219->regmap, IMX219_REG_LINE_LENGTH_A, > > > > > @@ -878,7 +867,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > > > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > > > > > > > > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > > > > > - unsigned int rate_factor = imx219_get_rate_factor(state); > > > > > int exposure_max; > > > > > int exposure_def; > > > > > int llp_min; > > > > > @@ -886,15 +874,16 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > > > > > > > > /* Update limits and set FPS to default */ > > > > > ret = __v4l2_ctrl_modify_range(imx219->vblank, > > > > > - IMX219_VBLANK_MIN * rate_factor, > > > > > - (IMX219_FLL_MAX - mode->height) * > > > > > - rate_factor, rate_factor, > > > > > - mode->fll_def - mode->height); > > > > > + (int)(mode->height / binning), > > > > > + IMX219_FLL_MAX - mode->height, 1, > > > > > + (int)(mode->fll_def / binning) - > > > > > + (int)mode->height); > > > > > if (ret) > > > > > return ret; > > > > > > > > > > ret = __v4l2_ctrl_s_ctrl(imx219->vblank, > > > > > - mode->fll_def - mode->height); > > > > > + (int)(mode->fll_def / binning) - > > > > > + (int)mode->height); > > > > > if (ret) > > > > > return ret; > > > > > > > > > > @@ -931,7 +920,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > > > return ret; > > > > > > > > > > /* Scale the pixel rate based on the mode specific factor */ > > > > > - pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; > > > > > + pixel_rate = imx219_get_pixel_rate(imx219); > > > > > ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, > > > > > pixel_rate, 1, pixel_rate); > > > > > if (ret) > > > > > > -- > > > Regards, > > > > > > Sakari Ailus > > > > > -- > Regards, > > Sakari Ailus > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning 2026-04-10 8:42 ` Jacopo Mondi 2026-04-10 8:46 ` Sakari Ailus @ 2026-04-15 14:38 ` Jai Luthra 2026-04-20 21:02 ` Sakari Ailus 1 sibling, 1 reply; 116+ messages in thread From: Jai Luthra @ 2026-04-15 14:38 UTC (permalink / raw) To: Jacopo Mondi, Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Jacopo Mondi Hi Sakari Thank you for the patch, and sorry for the late response. I finally got time to test this out, there are some significant issues. Did you test the behaviour with an IMX219 sensor before and after this series? What I see is the following before this series: | Mode | HBLANK | VBLANK | Pixel Rate | Observed FPS | Formula FPS | Error % | |---|---:|---:|---:|---:|---:|---:| | 640x480 | 2920 | 1227 | 364800000 | 60.07 | 60.03 | 0.07 | | 640x480 | 4000 | 1227 | 364800000 | 46.09 | 46.06 | 0.07 | | 640x480 | 6000 | 1227 | 364800000 | 32.20 | 32.18 | 0.05 | | 640x480 | 2920 | 2000 | 364800000 | 41.32 | 41.32 | 0.00 | | 640x480 | 2920 | 3000 | 364800000 | 29.45 | 29.45 | 0.01 | | 1640x1232 | 1920 | 475 | 364800000 | 60.07 | 60.03 | 0.07 | | 1640x1232 | 3000 | 475 | 364800000 | 46.09 | 46.06 | 0.07 | | 1640x1232 | 5000 | 475 | 364800000 | 32.20 | 32.18 | 0.05 | | 1640x1232 | 1920 | 1000 | 364800000 | 45.91 | 45.91 | -0.00 | | 1640x1232 | 1920 | 2000 | 364800000 | 31.71 | 31.71 | 0.01 | | 1920x1080 | 1528 | 683 | 182400000 | 30.01 | 30.01 | 0.01 | | 1920x1080 | 2500 | 683 | 182400000 | 23.43 | 23.41 | 0.10 | | 1920x1080 | 4000 | 683 | 182400000 | 17.48 | 17.48 | 0.02 | | 1920x1080 | 1528 | 1200 | 182400000 | 23.20 | 23.20 | -0.01 | | 1920x1080 | 1528 | 2000 | 182400000 | 17.18 | 17.18 | 0.03 | And after this series | Mode | HBLANK | VBLANK | Pixel Rate | Observed FPS | Formula FPS | Error % | |---|---:|---:|---:|---:|---:|---:| | 640x480 | 2920 | 1227 | 182400000 | 30.02 | 30.02 | 0.02 | | 640x480 | 4000 | 1227 | 182400000 | 23.03 | 23.03 | 0.00 | | 640x480 | 6000 | 1227 | 182400000 | 16.09 | 16.09 | -0.02 | | 640x480 | 2920 | 2000 | 182400000 | 20.66 | 20.66 | 0.00 | | 640x480 | 2920 | 3000 | 182400000 | 14.72 | 14.72 | -0.02 | So while the "formula" still works, we can't achieve high FPS capture we could before. With minimum blankings I could get around ~190 FPS capture before. Now it's just ~70 FPS. And I couldn't even stream the any other mode than 640x480, because S_FMT on the sensor gives an error: $ media-ctl -V '"imx219 1-0010":0 [fmt:SRGGB10_1X10/1920x1080 field:none]' Unable to setup formats: Numerical result out of range (34) This patch sets vblank ranges and default values which don't work out: - 1920x1080: min = 1080, default = 683 - 1640x1232: min = 616, default = -379 Quoting Jacopo Mondi (2026-04-10 14:12:22) > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:14PM +0300, Sakari Ailus wrote: > > When vertical analogue binning is in use, the minimum frame length in > > lines decreases to around half of the normal. In relation to the sensor's > > output size this means vertical blanking can be negative but that's not an > > issue as control values are signed. Remove the workaround for this > > non-issue that doubled the pixel rate, frame length in lines and exposure > > time. > > I don't think this was a workaround. Doubling the pixel rate and > halving the values written to registers for EXPOSURE and VBLANK > allowed userspace to maintain a consistent view while the driver > accounts for the special binning mode where, at least in my latest > understanding, the sensor averages two lines before passing them to > the ADC. > > I am missing in which case, with the current driver implementation, > the vertical blanking can be negative. > > > > > The resulting change also fixes the minimum, the maximum and the step > > values for the control. > > > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > Jai, and others including Dave and me, have spent quite some time > testing and implementing proper support for the special analogue > binning mode for this sensor. Of course we might have missed something > obvious, but I'm still missing what you're trying to fix here. > So, I tend to agree with Jacopo here. There's been a lot of effort to get this sensor give correct and high FPS frames. As we discussed offline, I don't mind the model where we have negative values for blankings, but the sensor should still work the same way, i.e. the same FPS range is supported with the new blanking and pixel rate model. Otherwise that would count as breaking the userspace, especially for probably the most widely used sensor out there :/ Thanks, Jai > > --- > > drivers/media/i2c/imx219.c | 29 +++++++++-------------------- > > 1 file changed, 9 insertions(+), 20 deletions(-) > > [snip] ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning 2026-04-15 14:38 ` Jai Luthra @ 2026-04-20 21:02 ` Sakari Ailus 0 siblings, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-20 21:02 UTC (permalink / raw) To: Jai Luthra Cc: Jacopo Mondi, linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Rishikesh Donadkar Hi Jai, On Wed, Apr 15, 2026 at 08:08:31PM +0530, Jai Luthra wrote: > Hi Sakari > > Thank you for the patch, and sorry for the late response. I finally got > time to test this out, there are some significant issues. > > Did you test the behaviour with an IMX219 sensor before and after this > series? > > What I see is the following before this series: > > | Mode | HBLANK | VBLANK | Pixel Rate | Observed FPS | Formula FPS | Error > % | > |---|---:|---:|---:|---:|---:|---:| > | 640x480 | 2920 | 1227 | 364800000 | 60.07 | 60.03 | 0.07 | > | 640x480 | 4000 | 1227 | 364800000 | 46.09 | 46.06 | 0.07 | > | 640x480 | 6000 | 1227 | 364800000 | 32.20 | 32.18 | 0.05 | > | 640x480 | 2920 | 2000 | 364800000 | 41.32 | 41.32 | 0.00 | > | 640x480 | 2920 | 3000 | 364800000 | 29.45 | 29.45 | 0.01 | > | 1640x1232 | 1920 | 475 | 364800000 | 60.07 | 60.03 | 0.07 | > | 1640x1232 | 3000 | 475 | 364800000 | 46.09 | 46.06 | 0.07 | > | 1640x1232 | 5000 | 475 | 364800000 | 32.20 | 32.18 | 0.05 | > | 1640x1232 | 1920 | 1000 | 364800000 | 45.91 | 45.91 | -0.00 | > | 1640x1232 | 1920 | 2000 | 364800000 | 31.71 | 31.71 | 0.01 | > | 1920x1080 | 1528 | 683 | 182400000 | 30.01 | 30.01 | 0.01 | > | 1920x1080 | 2500 | 683 | 182400000 | 23.43 | 23.41 | 0.10 | > | 1920x1080 | 4000 | 683 | 182400000 | 17.48 | 17.48 | 0.02 | > | 1920x1080 | 1528 | 1200 | 182400000 | 23.20 | 23.20 | -0.01 | > | 1920x1080 | 1528 | 2000 | 182400000 | 17.18 | 17.18 | 0.03 | > > > And after this series > > | Mode | HBLANK | VBLANK | Pixel Rate | Observed FPS | Formula FPS | Error > % | > |---|---:|---:|---:|---:|---:|---:| > | 640x480 | 2920 | 1227 | 182400000 | 30.02 | 30.02 | 0.02 | > | 640x480 | 4000 | 1227 | 182400000 | 23.03 | 23.03 | 0.00 | > | 640x480 | 6000 | 1227 | 182400000 | 16.09 | 16.09 | -0.02 | > | 640x480 | 2920 | 2000 | 182400000 | 20.66 | 20.66 | 0.00 | > | 640x480 | 2920 | 3000 | 182400000 | 14.72 | 14.72 | -0.02 | > > So while the "formula" still works, we can't achieve high FPS capture we > could before. Could you test again with my metadata-pre branch, please? > > With minimum blankings I could get around ~190 FPS capture before. Now it's > just ~70 FPS. > > And I couldn't even stream the any other mode than 640x480, because S_FMT > on the sensor gives an error: > > $ media-ctl -V '"imx219 1-0010":0 [fmt:SRGGB10_1X10/1920x1080 field:none]' > Unable to setup formats: Numerical result out of range (34) > > This patch sets vblank ranges and default values which don't work out: > - 1920x1080: min = 1080, default = 683 > - 1640x1232: min = 616, default = -379 > > Quoting Jacopo Mondi (2026-04-10 14:12:22) > > Hi Sakari > > > > On Wed, Apr 08, 2026 at 06:39:14PM +0300, Sakari Ailus wrote: > > > When vertical analogue binning is in use, the minimum frame length in > > > lines decreases to around half of the normal. In relation to the sensor's > > > output size this means vertical blanking can be negative but that's not an > > > issue as control values are signed. Remove the workaround for this > > > non-issue that doubled the pixel rate, frame length in lines and exposure > > > time. > > > > I don't think this was a workaround. Doubling the pixel rate and > > halving the values written to registers for EXPOSURE and VBLANK > > allowed userspace to maintain a consistent view while the driver > > accounts for the special binning mode where, at least in my latest > > understanding, the sensor averages two lines before passing them to > > the ADC. > > > > I am missing in which case, with the current driver implementation, > > the vertical blanking can be negative. > > > > > > > > The resulting change also fixes the minimum, the maximum and the step > > > values for the control. > > > > > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > Jai, and others including Dave and me, have spent quite some time > > testing and implementing proper support for the special analogue > > binning mode for this sensor. Of course we might have missed something > > obvious, but I'm still missing what you're trying to fix here. > > > > So, I tend to agree with Jacopo here. There's been a lot of effort to get > this sensor give correct and high FPS frames. Yet bugs seem to have remained -- see the beginning of the series. Which I think indeed proves it's just hard to get these things right. The imx219 is one of the most scrutinised drivers albeit the configurability it offers still means there may be corner cases. The metadata series indeed makes the driver freely configurable. I tested earlier all configurations that have modes appear to be reachable through the new APIs but not much more than that. > > As we discussed offline, I don't mind the model where we have negative > values for blankings, but the sensor should still work the same way, i.e. > the same FPS range is supported with the new blanking and pixel rate model. > > Otherwise that would count as breaking the userspace, especially for > probably the most widely used sensor out there :/ I agree. And this is why we test and review code, right? :-) -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning 2026-04-08 15:39 ` [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning Sakari Ailus 2026-04-10 8:42 ` Jacopo Mondi @ 2026-04-15 17:15 ` Jai Luthra 2026-04-20 20:54 ` Sakari Ailus 1 sibling, 1 reply; 116+ messages in thread From: Jai Luthra @ 2026-04-15 17:15 UTC (permalink / raw) To: Sakari Ailus, linux-media Cc: hans, laurent.pinchart, 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, André 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, Rishikesh Donadkar Quoting Sakari Ailus (2026-04-08 21:09:14) > When vertical analogue binning is in use, the minimum frame length in > lines decreases to around half of the normal. In relation to the sensor's > output size this means vertical blanking can be negative but that's not an > issue as control values are signed. Remove the workaround for this > non-issue that doubled the pixel rate, frame length in lines and exposure > time. > > The resulting change also fixes the minimum, the maximum and the step > values for the control. > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > --- > drivers/media/i2c/imx219.c | 29 +++++++++-------------------- > 1 file changed, 9 insertions(+), 20 deletions(-) > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > index 6819a2fa3262..a72630ad1561 100644 > --- a/drivers/media/i2c/imx219.c > +++ b/drivers/media/i2c/imx219.c > @@ -420,15 +420,6 @@ static void imx219_get_binning(struct v4l2_subdev_state *state, u8 *bin_h, > > } > > -static inline u32 imx219_get_rate_factor(struct v4l2_subdev_state *state) > -{ > - u8 bin_h, bin_v; > - > - imx219_get_binning(state, &bin_h, &bin_v); > - > - return (bin_h & bin_v) == IMX219_BINNING_X2_ANALOG ? 2 : 1; > -} > - > /* ----------------------------------------------------------------------------- > * Controls > */ > @@ -440,12 +431,10 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd); > const struct v4l2_mbus_framefmt *format; > struct v4l2_subdev_state *state; > - u32 rate_factor; > int ret = 0; > > state = v4l2_subdev_get_locked_active_state(&imx219->sd); > format = v4l2_subdev_state_get_format(state, 0); > - rate_factor = imx219_get_rate_factor(state); > > if (ctrl->id == V4L2_CID_VBLANK) { > int exposure_max, exposure_def; > @@ -478,7 +467,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > break; > case V4L2_CID_EXPOSURE: > cci_write(imx219->regmap, IMX219_REG_EXPOSURE, > - ctrl->val / rate_factor, &ret); > + ctrl->val, &ret); > break; > case V4L2_CID_DIGITAL_GAIN: > cci_write(imx219->regmap, IMX219_REG_DIGITAL_GAIN, > @@ -495,7 +484,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > break; > case V4L2_CID_VBLANK: > cci_write(imx219->regmap, IMX219_REG_FRM_LENGTH_A, > - (format->height + ctrl->val) / rate_factor, &ret); > + format->height + ctrl->val, &ret); > break; > case V4L2_CID_HBLANK: > cci_write(imx219->regmap, IMX219_REG_LINE_LENGTH_A, > @@ -878,7 +867,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > - unsigned int rate_factor = imx219_get_rate_factor(state); > int exposure_max; > int exposure_def; > int llp_min; > @@ -886,15 +874,16 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > /* Update limits and set FPS to default */ > ret = __v4l2_ctrl_modify_range(imx219->vblank, > - IMX219_VBLANK_MIN * rate_factor, > - (IMX219_FLL_MAX - mode->height) * > - rate_factor, rate_factor, > - mode->fll_def - mode->height); > + (int)(mode->height / binning), This line seems to be the crux of the issue causing modes other than VGA to not work, and also restricting the FPS. Vertical blanking control is defined relative to the output height. While the minimum value for FLL for analogue binning mode is: min_FLL = (mode->height / binning) + IMX219_VBLANK_MIN So the minimum control value for vblank should be: vblank_min = min_FLL - mode->height Making that change I get the correct range for VBLANK control that leads to high FPS capture. So we finally have something working. Now the debate is between these two models: 1. PIXEL_RATE means the output rate of the PLL for the sensor's internal pixel clock. That would mean this special binning mode leads to negative blanking values, which breaks intuition for what blanking means, but lines up well with exposing sensor FLL/LLP registers directly for the new raw sensor model. 2. H/V_BLANK are always positive and defined w.r.t source pad width/height. Thus special binning mode would need to have "double" the PIXEL_RATE, even though the sensor PLL is configured the same way. This aligns with what applications expect today. Even "normal" binning mode on IMX219 and many other sensors does binning in the Analogue domain for one dimension. As we discussed before in [1]. Which makes the former a cleaner model to adopt for future. Now what we should do for existing sensors is a question that needs more discussion. I am fine with both approaches, but this does mean fixing libcamera to work with negative blanking values (which it doesn't currently at least in my short test today) and breaks intuition for what blanking means (which is annoying). Jacopo & Laurent, what do you think? Thanks, Jai [1]: https://lore.kernel.org/all/20260225-media-fps-docs-v2-1-5cb222d41e4d@ideasonboard.com/ > + IMX219_FLL_MAX - mode->height, 1, > + (int)(mode->fll_def / binning) - > + (int)mode->height); > if (ret) > return ret; > > ret = __v4l2_ctrl_s_ctrl(imx219->vblank, > - mode->fll_def - mode->height); > + (int)(mode->fll_def / binning) - > + (int)mode->height); > if (ret) > return ret; > > @@ -931,7 +920,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > return ret; > > /* Scale the pixel rate based on the mode specific factor */ > - pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; > + pixel_rate = imx219_get_pixel_rate(imx219); > ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, > pixel_rate, 1, pixel_rate); > if (ret) > -- > 2.47.3 > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning 2026-04-15 17:15 ` Jai Luthra @ 2026-04-20 20:54 ` Sakari Ailus 0 siblings, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-20 20:54 UTC (permalink / raw) To: Jai Luthra Cc: linux-media, hans, laurent.pinchart, 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, André 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, Rishikesh Donadkar Hi Jai, On Wed, Apr 15, 2026 at 10:45:31PM +0530, Jai Luthra wrote: > Quoting Sakari Ailus (2026-04-08 21:09:14) > > When vertical analogue binning is in use, the minimum frame length in > > lines decreases to around half of the normal. In relation to the sensor's > > output size this means vertical blanking can be negative but that's not an > > issue as control values are signed. Remove the workaround for this > > non-issue that doubled the pixel rate, frame length in lines and exposure > > time. > > > > The resulting change also fixes the minimum, the maximum and the step > > values for the control. > > > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > --- > > drivers/media/i2c/imx219.c | 29 +++++++++-------------------- > > 1 file changed, 9 insertions(+), 20 deletions(-) > > > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > > index 6819a2fa3262..a72630ad1561 100644 > > --- a/drivers/media/i2c/imx219.c > > +++ b/drivers/media/i2c/imx219.c > > @@ -420,15 +420,6 @@ static void imx219_get_binning(struct v4l2_subdev_state *state, u8 *bin_h, > > > > } > > > > -static inline u32 imx219_get_rate_factor(struct v4l2_subdev_state *state) > > -{ > > - u8 bin_h, bin_v; > > - > > - imx219_get_binning(state, &bin_h, &bin_v); > > - > > - return (bin_h & bin_v) == IMX219_BINNING_X2_ANALOG ? 2 : 1; > > -} > > - > > /* ----------------------------------------------------------------------------- > > * Controls > > */ > > @@ -440,12 +431,10 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd); > > const struct v4l2_mbus_framefmt *format; > > struct v4l2_subdev_state *state; > > - u32 rate_factor; > > int ret = 0; > > > > state = v4l2_subdev_get_locked_active_state(&imx219->sd); > > format = v4l2_subdev_state_get_format(state, 0); > > - rate_factor = imx219_get_rate_factor(state); > > > > if (ctrl->id == V4L2_CID_VBLANK) { > > int exposure_max, exposure_def; > > @@ -478,7 +467,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > break; > > case V4L2_CID_EXPOSURE: > > cci_write(imx219->regmap, IMX219_REG_EXPOSURE, > > - ctrl->val / rate_factor, &ret); > > + ctrl->val, &ret); > > break; > > case V4L2_CID_DIGITAL_GAIN: > > cci_write(imx219->regmap, IMX219_REG_DIGITAL_GAIN, > > @@ -495,7 +484,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > break; > > case V4L2_CID_VBLANK: > > cci_write(imx219->regmap, IMX219_REG_FRM_LENGTH_A, > > - (format->height + ctrl->val) / rate_factor, &ret); > > + format->height + ctrl->val, &ret); > > break; > > case V4L2_CID_HBLANK: > > cci_write(imx219->regmap, IMX219_REG_LINE_LENGTH_A, > > @@ -878,7 +867,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > > - unsigned int rate_factor = imx219_get_rate_factor(state); > > int exposure_max; > > int exposure_def; > > int llp_min; > > @@ -886,15 +874,16 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > > > /* Update limits and set FPS to default */ > > ret = __v4l2_ctrl_modify_range(imx219->vblank, > > - IMX219_VBLANK_MIN * rate_factor, > > - (IMX219_FLL_MAX - mode->height) * > > - rate_factor, rate_factor, > > - mode->fll_def - mode->height); > > + (int)(mode->height / binning), > > This line seems to be the crux of the issue causing modes other than VGA to > not work, and also restricting the FPS. > > Vertical blanking control is defined relative to the output height. While > the minimum value for FLL for analogue binning mode is: > > min_FLL = (mode->height / binning) + IMX219_VBLANK_MIN > > So the minimum control value for vblank should be: > > vblank_min = min_FLL - mode->height I had done most testing on top of the metadata series and it seems some bugs were still hidden in the earlier patches. I took another look at the patches and indeed there were issues in calculating the lower limit of vertical blanking. I've pushed the changes to metadata-pre (and metadata) branches to my linuxtv.org tree while this series can be found in metadata-pre-v4 tag and the recently posted metadata series in metadata-v12 tag. The changes also resulted in a new patch, namely one that fixes the maximum exposure limit before removing the rate_factor. The table below contains the list of modes and their minimum vertical blankings and the fps at that vertical blanking value. The patches between references 1 and 2 make subtle changes to the frame rate due to changes that ensure that the sensor is operated within its limits. The default mode frame rate is 15, 30, 60 and 60 fps, respectively, beginning from reference 2. \ ref 1 2 3 4 m vb fps vb fps vb fps vb fps 3280x2464 32 20.526 32 21.194 32 21.194 32 21.194 1920x1080 32 46.079 32 47.574 32 47.571 32 47.569 1640x1232 32 81.162 64 79.070 -584 79.064 -584 79.070 640x480 32 198.610 64 188.359 -208 188.359 -208 188.359 [1] current upstream state; default fps varies [2] up to "media: imx219: Account rate_factor in setting upper exposure limit" [3] up to "media: imx219: Fix vertical blanking and exposure for analogue binning" [4] on top of the metadata branch I can post the updates to the list after addressing the rest of the comments. > > Making that change I get the correct range for VBLANK control that leads to > high FPS capture. > > So we finally have something working. Now the debate is between these two > models: > > 1. PIXEL_RATE means the output rate of the PLL for the sensor's internal > pixel clock. That would mean this special binning mode leads to negative > blanking values, which breaks intuition for what blanking means, but lines > up well with exposing sensor FLL/LLP registers directly for the new raw > sensor model. On the other hand, without removing the rate_factor we'd still need to multiply the FLL (likely?) value, plus many others, by the same factor, as the sensor only has a single PIXEL_RATE control value. Getting it right is hard and I didn't even try address bugs in control step configuration, only those that affected sensor timing. > > 2. H/V_BLANK are always positive and defined w.r.t source pad width/height. > Thus special binning mode would need to have "double" the PIXEL_RATE, even > though the sensor PLL is configured the same way. This aligns with what > applications expect today. Even in this case the blanking values do not express blanking correctly as they are bound to the output size, not the analogue crop rectangle. Thus they are no more useful in determining actual blanking. > > Even "normal" binning mode on IMX219 and many other sensors does binning in > the Analogue domain for one dimension. As we discussed before in [1]. > > Which makes the former a cleaner model to adopt for future. Now what we > should do for existing sensors is a question that needs more discussion. > > I am fine with both approaches, but this does mean fixing libcamera to work > with negative blanking values (which it doesn't currently at least in my > short test today) and breaks intuition for what blanking means (which is > annoying). Ouch. > > Jacopo & Laurent, what do you think? -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 06/29] media: imx219: Don't update exposure limits while setting format 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (4 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 8:44 ` Jacopo Mondi 2026-04-08 15:39 ` [PATCH v4 07/29] media: imx219: Rename "binning" as "bin_hv" in imx219_set_pad_format Sakari Ailus ` (22 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Don't update exposure limits explicitly while setting format. This is already done through the s_ctrl() callback. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/imx219.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index a72630ad1561..ca6a5939773d 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -867,8 +867,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { - int exposure_max; - int exposure_def; int llp_min; int pixel_rate; @@ -887,18 +885,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, if (ret) return ret; - /* Update max exposure while meeting expected vblanking */ - exposure_max = mode->fll_def - IMX219_EXPOSURE_OFFSET; - exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ? - exposure_max : IMX219_EXPOSURE_DEFAULT; - ret = __v4l2_ctrl_modify_range(imx219->exposure, - imx219->exposure->minimum, - exposure_max, - imx219->exposure->step, - exposure_def); - if (ret) - return ret; - /* * With analog binning the default minimum line length of 3448 * can cause artefacts with RAW10 formats, because the ADC -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 06/29] media: imx219: Don't update exposure limits while setting format 2026-04-08 15:39 ` [PATCH v4 06/29] media: imx219: Don't update exposure limits while setting format Sakari Ailus @ 2026-04-10 8:44 ` Jacopo Mondi 2026-04-10 10:14 ` Sakari Ailus 2026-04-10 10:29 ` Sakari Ailus 0 siblings, 2 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 8:44 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:15PM +0300, Sakari Ailus wrote: > Don't update exposure limits explicitly while setting format. This is > already done through the s_ctrl() callback. already done through the s_ctrl() callback for the VBLANK control. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/i2c/imx219.c | 14 -------------- > 1 file changed, 14 deletions(-) > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > index a72630ad1561..ca6a5939773d 100644 > --- a/drivers/media/i2c/imx219.c > +++ b/drivers/media/i2c/imx219.c > @@ -867,8 +867,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { > - int exposure_max; > - int exposure_def; > int llp_min; > int pixel_rate; > > @@ -887,18 +885,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > if (ret) > return ret; > > - /* Update max exposure while meeting expected vblanking */ > - exposure_max = mode->fll_def - IMX219_EXPOSURE_OFFSET; > - exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ? > - exposure_max : IMX219_EXPOSURE_DEFAULT; > - ret = __v4l2_ctrl_modify_range(imx219->exposure, > - imx219->exposure->minimum, > - exposure_max, > - imx219->exposure->step, > - exposure_def); > - if (ret) > - return ret; > - > /* > * With analog binning the default minimum line length of 3448 > * can cause artefacts with RAW10 formats, because the ADC > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 06/29] media: imx219: Don't update exposure limits while setting format 2026-04-10 8:44 ` Jacopo Mondi @ 2026-04-10 10:14 ` Sakari Ailus 2026-04-10 10:29 ` Sakari Ailus 1 sibling, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-10 10:14 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Jacopo, On Fri, Apr 10, 2026 at 10:44:33AM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:15PM +0300, Sakari Ailus wrote: > > Don't update exposure limits explicitly while setting format. This is > > already done through the s_ctrl() callback. > > already done through the s_ctrl() callback for the VBLANK control. > Thanks for the review! I now recall Dave noted that the limits might still need updating even if the control's value doesn't change. This patch can be safely applied only when the driver natively uses FLL/LLP instead so I at least postpone it. -- Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 06/29] media: imx219: Don't update exposure limits while setting format 2026-04-10 8:44 ` Jacopo Mondi 2026-04-10 10:14 ` Sakari Ailus @ 2026-04-10 10:29 ` Sakari Ailus 1 sibling, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-10 10:29 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Fri, Apr 10, 2026 at 10:44:33AM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:15PM +0300, Sakari Ailus wrote: > > Don't update exposure limits explicitly while setting format. This is > > already done through the s_ctrl() callback. > > already done through the s_ctrl() callback for the VBLANK control. I squashed this to the patch that adds LLP and FLL controls. -- Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 07/29] media: imx219: Rename "binning" as "bin_hv" in imx219_set_pad_format 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (5 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 06/29] media: imx219: Don't update exposure limits while setting format Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-16 14:25 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 08/29] media: imx274: Remove redundant kernel-doc comments Sakari Ailus ` (21 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Rename "binning" as "bin_hv" in anticipation of having a variable called "binning" for another purpose. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/imx219.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index ca6a5939773d..5a85d76af65a 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -825,7 +825,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, const struct imx219_mode *mode; struct v4l2_mbus_framefmt *format; struct v4l2_rect *crop; - u8 bin_h, bin_v, binning; + u8 bin_h, bin_v, bin_hv; int ret; format = v4l2_subdev_state_get_format(state, 0); @@ -858,11 +858,11 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, bin_v = min(IMX219_VISIBLE_HEIGHT / format->height, 2U); /* Ensure bin_h and bin_v are same to avoid 1:2 or 2:1 stretching */ - binning = min(bin_h, bin_v); + bin_hv = min(bin_h, bin_v); crop = v4l2_subdev_state_get_crop(state, 0); - crop->width = format->width * binning; - crop->height = format->height * binning; + crop->width = format->width * bin_hv; + crop->height = format->height * bin_hv; crop->left = (IMX219_NATIVE_WIDTH - crop->width) / 2; crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; @@ -872,15 +872,15 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, /* Update limits and set FPS to default */ ret = __v4l2_ctrl_modify_range(imx219->vblank, - (int)(mode->height / binning), + (int)(mode->height / bin_hv), IMX219_FLL_MAX - mode->height, 1, - (int)(mode->fll_def / binning) - + (int)(mode->fll_def / bin_hv) - (int)mode->height); if (ret) return ret; ret = __v4l2_ctrl_s_ctrl(imx219->vblank, - (int)(mode->fll_def / binning) - + (int)(mode->fll_def / bin_hv) - (int)mode->height); if (ret) return ret; -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 07/29] media: imx219: Rename "binning" as "bin_hv" in imx219_set_pad_format 2026-04-08 15:39 ` [PATCH v4 07/29] media: imx219: Rename "binning" as "bin_hv" in imx219_set_pad_format Sakari Ailus @ 2026-04-16 14:25 ` Laurent Pinchart 0 siblings, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 14:25 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 Hi Sakari, Thank you for the patch. On Wed, Apr 08, 2026 at 06:39:16PM +0300, Sakari Ailus wrote: > Rename "binning" as "bin_hv" in anticipation of having a variable called > "binning" for another purpose. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/media/i2c/imx219.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > index ca6a5939773d..5a85d76af65a 100644 > --- a/drivers/media/i2c/imx219.c > +++ b/drivers/media/i2c/imx219.c > @@ -825,7 +825,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > const struct imx219_mode *mode; > struct v4l2_mbus_framefmt *format; > struct v4l2_rect *crop; > - u8 bin_h, bin_v, binning; > + u8 bin_h, bin_v, bin_hv; > int ret; > > format = v4l2_subdev_state_get_format(state, 0); > @@ -858,11 +858,11 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > bin_v = min(IMX219_VISIBLE_HEIGHT / format->height, 2U); > > /* Ensure bin_h and bin_v are same to avoid 1:2 or 2:1 stretching */ > - binning = min(bin_h, bin_v); > + bin_hv = min(bin_h, bin_v); > > crop = v4l2_subdev_state_get_crop(state, 0); > - crop->width = format->width * binning; > - crop->height = format->height * binning; > + crop->width = format->width * bin_hv; > + crop->height = format->height * bin_hv; > crop->left = (IMX219_NATIVE_WIDTH - crop->width) / 2; > crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2; > > @@ -872,15 +872,15 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, > > /* Update limits and set FPS to default */ > ret = __v4l2_ctrl_modify_range(imx219->vblank, > - (int)(mode->height / binning), > + (int)(mode->height / bin_hv), > IMX219_FLL_MAX - mode->height, 1, > - (int)(mode->fll_def / binning) - > + (int)(mode->fll_def / bin_hv) - > (int)mode->height); > if (ret) > return ret; > > ret = __v4l2_ctrl_s_ctrl(imx219->vblank, > - (int)(mode->fll_def / binning) - > + (int)(mode->fll_def / bin_hv) - > (int)mode->height); > if (ret) > return ret; -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 08/29] media: imx274: Remove redundant kernel-doc comments 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (6 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 07/29] media: imx219: Rename "binning" as "bin_hv" in imx219_set_pad_format Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 8:48 ` Jacopo Mondi 2026-04-16 14:26 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 09/29] media: imx334: " Sakari Ailus ` (20 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Remove kernel-doc comments from regular callback functions. These comments have no information value. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/imx274.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c index 8ec78b60bea6..241821572e03 100644 --- a/drivers/media/i2c/imx274.c +++ b/drivers/media/i2c/imx274.c @@ -897,14 +897,6 @@ static int imx274_regulators_get(struct device *dev, struct stimx274 *imx274) imx274->supplies); } -/** - * imx274_s_ctrl - This is used to set the imx274 V4L2 controls - * @ctrl: V4L2 control to be set - * - * This function is used to set the V4L2 controls for the imx274 sensor. - * - * Return: 0 on success, errors otherwise - */ static int imx274_s_ctrl(struct v4l2_ctrl *ctrl) { struct v4l2_subdev *sd = ctrl_to_sd(ctrl); @@ -1059,16 +1051,6 @@ static int __imx274_change_compose(struct stimx274 *imx274, return 0; } -/** - * imx274_get_fmt - Get the pad format - * @sd: Pointer to V4L2 Sub device structure - * @sd_state: Pointer to sub device state structure - * @fmt: Pointer to pad level media bus format - * - * This function is used to get the pad format information. - * - * Return: 0 on success - */ static int imx274_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) @@ -1081,16 +1063,6 @@ static int imx274_get_fmt(struct v4l2_subdev *sd, return 0; } -/** - * imx274_set_fmt - This is used to set the pad format - * @sd: Pointer to V4L2 Sub device structure - * @sd_state: Pointer to sub device state information structure - * @format: Pointer to pad level media bus format - * - * This function is used to set the pad format. - * - * Return: 0 on success - */ static int imx274_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) @@ -1423,16 +1395,6 @@ static void imx274_load_default(struct stimx274 *priv) priv->ctrls.test_pattern->val = TEST_PATTERN_DISABLED; } -/** - * imx274_s_stream - It is used to start/stop the streaming. - * @sd: V4L2 Sub device - * @on: Flag (True / False) - * - * This function controls the start or stop of streaming for the - * imx274 sensor. - * - * Return: 0 on success, errors otherwise - */ static int imx274_s_stream(struct v4l2_subdev *sd, int on) { struct stimx274 *imx274 = to_imx274(sd); -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 08/29] media: imx274: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 08/29] media: imx274: Remove redundant kernel-doc comments Sakari Ailus @ 2026-04-10 8:48 ` Jacopo Mondi 2026-04-10 8:54 ` Sakari Ailus 2026-04-16 14:26 ` Laurent Pinchart 1 sibling, 1 reply; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 8:48 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:17PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These > comments have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> This might be easy, but how is this related to metadata ? This is a 29 patch series that prepares for an 89 patch series. review time is not free, piling stuff over stuff is a recipe for making sure we'll never merge this. Anyway Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/i2c/imx274.c | 38 -------------------------------------- > 1 file changed, 38 deletions(-) > > diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c > index 8ec78b60bea6..241821572e03 100644 > --- a/drivers/media/i2c/imx274.c > +++ b/drivers/media/i2c/imx274.c > @@ -897,14 +897,6 @@ static int imx274_regulators_get(struct device *dev, struct stimx274 *imx274) > imx274->supplies); > } > > -/** > - * imx274_s_ctrl - This is used to set the imx274 V4L2 controls > - * @ctrl: V4L2 control to be set > - * > - * This function is used to set the V4L2 controls for the imx274 sensor. > - * > - * Return: 0 on success, errors otherwise > - */ > static int imx274_s_ctrl(struct v4l2_ctrl *ctrl) > { > struct v4l2_subdev *sd = ctrl_to_sd(ctrl); > @@ -1059,16 +1051,6 @@ static int __imx274_change_compose(struct stimx274 *imx274, > return 0; > } > > -/** > - * imx274_get_fmt - Get the pad format > - * @sd: Pointer to V4L2 Sub device structure > - * @sd_state: Pointer to sub device state structure > - * @fmt: Pointer to pad level media bus format > - * > - * This function is used to get the pad format information. > - * > - * Return: 0 on success > - */ > static int imx274_get_fmt(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -1081,16 +1063,6 @@ static int imx274_get_fmt(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx274_set_fmt - This is used to set the pad format > - * @sd: Pointer to V4L2 Sub device structure > - * @sd_state: Pointer to sub device state information structure > - * @format: Pointer to pad level media bus format > - * > - * This function is used to set the pad format. > - * > - * Return: 0 on success > - */ > static int imx274_set_fmt(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *format) > @@ -1423,16 +1395,6 @@ static void imx274_load_default(struct stimx274 *priv) > priv->ctrls.test_pattern->val = TEST_PATTERN_DISABLED; > } > > -/** > - * imx274_s_stream - It is used to start/stop the streaming. > - * @sd: V4L2 Sub device > - * @on: Flag (True / False) > - * > - * This function controls the start or stop of streaming for the > - * imx274 sensor. > - * > - * Return: 0 on success, errors otherwise > - */ > static int imx274_s_stream(struct v4l2_subdev *sd, int on) > { > struct stimx274 *imx274 = to_imx274(sd); > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 08/29] media: imx274: Remove redundant kernel-doc comments 2026-04-10 8:48 ` Jacopo Mondi @ 2026-04-10 8:54 ` Sakari Ailus 2026-04-10 9:02 ` Jacopo Mondi 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-10 8:54 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Jacopo, Thank you for the review. On Fri, Apr 10, 2026 at 10:48:24AM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:17PM +0300, Sakari Ailus wrote: > > Remove kernel-doc comments from regular callback functions. These > > comments have no information value. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > This might be easy, but how is this related to metadata ? > This is a 29 patch series that prepares for an 89 patch series. Not directly, but not doing this now will require documenting the new arguments soon or we'd start getting warnings from the build. Writing documentation that shouldn't exist would be entirely non-productive work. > > review time is not free, piling stuff over stuff is a recipe for > making sure we'll never merge this. > > Anyway > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Thank you. -- Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 08/29] media: imx274: Remove redundant kernel-doc comments 2026-04-10 8:54 ` Sakari Ailus @ 2026-04-10 9:02 ` Jacopo Mondi 0 siblings, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 9:02 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Sakari On Fri, Apr 10, 2026 at 11:54:34AM +0300, Sakari Ailus wrote: > Hi Jacopo, > > Thank you for the review. > > On Fri, Apr 10, 2026 at 10:48:24AM +0200, Jacopo Mondi wrote: > > Hi Sakari > > > > On Wed, Apr 08, 2026 at 06:39:17PM +0300, Sakari Ailus wrote: > > > Remove kernel-doc comments from regular callback functions. These > > > comments have no information value. > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > This might be easy, but how is this related to metadata ? > > This is a 29 patch series that prepares for an 89 patch series. > > Not directly, but not doing this now will require documenting the new > arguments soon or we'd start getting warnings from the build. Writing > documentation that shouldn't exist would be entirely non-productive work. > I see. Thanks for explaining > > > > review time is not free, piling stuff over stuff is a recipe for > > making sure we'll never merge this. > > > > Anyway > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > Thank you. > > -- > Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 08/29] media: imx274: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 08/29] media: imx274: Remove redundant kernel-doc comments Sakari Ailus 2026-04-10 8:48 ` Jacopo Mondi @ 2026-04-16 14:26 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 14:26 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:17PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These > comments have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/media/i2c/imx274.c | 38 -------------------------------------- > 1 file changed, 38 deletions(-) > > diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c > index 8ec78b60bea6..241821572e03 100644 > --- a/drivers/media/i2c/imx274.c > +++ b/drivers/media/i2c/imx274.c > @@ -897,14 +897,6 @@ static int imx274_regulators_get(struct device *dev, struct stimx274 *imx274) > imx274->supplies); > } > > -/** > - * imx274_s_ctrl - This is used to set the imx274 V4L2 controls > - * @ctrl: V4L2 control to be set > - * > - * This function is used to set the V4L2 controls for the imx274 sensor. > - * > - * Return: 0 on success, errors otherwise > - */ > static int imx274_s_ctrl(struct v4l2_ctrl *ctrl) > { > struct v4l2_subdev *sd = ctrl_to_sd(ctrl); > @@ -1059,16 +1051,6 @@ static int __imx274_change_compose(struct stimx274 *imx274, > return 0; > } > > -/** > - * imx274_get_fmt - Get the pad format > - * @sd: Pointer to V4L2 Sub device structure > - * @sd_state: Pointer to sub device state structure > - * @fmt: Pointer to pad level media bus format > - * > - * This function is used to get the pad format information. > - * > - * Return: 0 on success > - */ > static int imx274_get_fmt(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -1081,16 +1063,6 @@ static int imx274_get_fmt(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx274_set_fmt - This is used to set the pad format > - * @sd: Pointer to V4L2 Sub device structure > - * @sd_state: Pointer to sub device state information structure > - * @format: Pointer to pad level media bus format > - * > - * This function is used to set the pad format. > - * > - * Return: 0 on success > - */ > static int imx274_set_fmt(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *format) > @@ -1423,16 +1395,6 @@ static void imx274_load_default(struct stimx274 *priv) > priv->ctrls.test_pattern->val = TEST_PATTERN_DISABLED; > } > > -/** > - * imx274_s_stream - It is used to start/stop the streaming. > - * @sd: V4L2 Sub device > - * @on: Flag (True / False) > - * > - * This function controls the start or stop of streaming for the > - * imx274 sensor. > - * > - * Return: 0 on success, errors otherwise > - */ > static int imx274_s_stream(struct v4l2_subdev *sd, int on) > { > struct stimx274 *imx274 = to_imx274(sd); -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 09/29] media: imx334: Remove redundant kernel-doc comments 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (7 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 08/29] media: imx274: Remove redundant kernel-doc comments Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 9:02 ` Jacopo Mondi 2026-04-16 14:27 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 10/29] media: imx335: " Sakari Ailus ` (19 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Remove kernel-doc comments from regular callback functions. These comments have no information value. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/imx334.c | 93 -------------------------------------- 1 file changed, 93 deletions(-) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index 9654f9268056..553a16b84f4d 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -566,18 +566,6 @@ static int imx334_update_exp_gain(struct imx334 *imx334, u32 exposure, u32 gain) return ret; } -/** - * imx334_set_ctrl() - Set subdevice control - * @ctrl: pointer to v4l2_ctrl structure - * - * Supported controls: - * - V4L2_CID_VBLANK - * - cluster controls: - * - V4L2_CID_ANALOGUE_GAIN - * - V4L2_CID_EXPOSURE - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_set_ctrl(struct v4l2_ctrl *ctrl) { struct imx334 *imx334 = @@ -678,14 +666,6 @@ static int imx334_get_format_code(struct imx334 *imx334, u32 code) return imx334_mbus_codes[0]; } -/** - * imx334_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes - * @sd: pointer to imx334 V4L2 sub-device structure - * @sd_state: V4L2 sub-device state - * @code: V4L2 sub-device code enumeration need to be filled - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_enum_mbus_code(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_mbus_code_enum *code) @@ -698,14 +678,6 @@ static int imx334_enum_mbus_code(struct v4l2_subdev *sd, return 0; } -/** - * imx334_enum_frame_size() - Enumerate V4L2 sub-device frame sizes - * @sd: pointer to imx334 V4L2 sub-device structure - * @sd_state: V4L2 sub-device state - * @fsize: V4L2 sub-device size enumeration need to be filled - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_enum_frame_size(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_frame_size_enum *fsize) @@ -749,14 +721,6 @@ static void imx334_fill_pad_format(struct imx334 *imx334, fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; } -/** - * imx334_get_pad_format() - Get subdevice pad format - * @sd: pointer to imx334 V4L2 sub-device structure - * @sd_state: V4L2 sub-device state - * @fmt: V4L2 sub-device format need to be set - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_get_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) @@ -776,14 +740,6 @@ static int imx334_get_pad_format(struct v4l2_subdev *sd, return 0; } -/** - * imx334_set_pad_format() - Set subdevice pad format - * @sd: pointer to imx334 V4L2 sub-device structure - * @sd_state: V4L2 sub-device state - * @fmt: V4L2 sub-device format need to be set - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) @@ -815,13 +771,6 @@ static int imx334_set_pad_format(struct v4l2_subdev *sd, return ret; } -/** - * imx334_init_state() - Initialize sub-device state - * @sd: pointer to imx334 V4L2 sub-device structure - * @sd_state: V4L2 sub-device state - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_init_state(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state) { @@ -856,15 +805,6 @@ static int imx334_set_framefmt(struct imx334 *imx334) return -EINVAL; } -/** - * imx334_enable_streams() - Enable specified streams for the sensor - * @sd: pointer to the V4L2 subdevice - * @state: pointer to the subdevice state - * @pad: pad number for which streams are enabled - * @streams_mask: bitmask specifying the streams to enable - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_enable_streams(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, u32 pad, u64 streams_mask) @@ -929,15 +869,6 @@ static int imx334_enable_streams(struct v4l2_subdev *sd, return ret; } -/** - * imx334_disable_streams() - Enable specified streams for the sensor - * @sd: pointer to the V4L2 subdevice - * @state: pointer to the subdevice state - * @pad: pad number for which streams are disabled - * @streams_mask: bitmask specifying the streams to disable - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_disable_streams(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, u32 pad, u64 streams_mask) @@ -1067,12 +998,6 @@ static const struct v4l2_subdev_internal_ops imx334_internal_ops = { .init_state = imx334_init_state, }; -/** - * imx334_power_on() - Sensor power on sequence - * @dev: pointer to i2c device - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_power_on(struct device *dev) { struct v4l2_subdev *sd = dev_get_drvdata(dev); @@ -1101,12 +1026,6 @@ static int imx334_power_on(struct device *dev) return ret; } -/** - * imx334_power_off() - Sensor power off sequence - * @dev: pointer to i2c device - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_power_off(struct device *dev) { struct v4l2_subdev *sd = dev_get_drvdata(dev); @@ -1206,12 +1125,6 @@ static int imx334_init_controls(struct imx334 *imx334) return 0; } -/** - * imx334_probe() - I2C client device binding - * @client: pointer to i2c client device - * - * Return: 0 if successful, error code otherwise. - */ static int imx334_probe(struct i2c_client *client) { struct imx334 *imx334; @@ -1311,12 +1224,6 @@ static int imx334_probe(struct i2c_client *client) return ret; } -/** - * imx334_remove() - I2C client device unbinding - * @client: pointer to I2C client device - * - * Return: 0 if successful, error code otherwise. - */ static void imx334_remove(struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 09/29] media: imx334: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 09/29] media: imx334: " Sakari Ailus @ 2026-04-10 9:02 ` Jacopo Mondi 2026-04-16 14:27 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 9:02 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:18PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These comments > have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/i2c/imx334.c | 93 -------------------------------------- > 1 file changed, 93 deletions(-) > > diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c > index 9654f9268056..553a16b84f4d 100644 > --- a/drivers/media/i2c/imx334.c > +++ b/drivers/media/i2c/imx334.c > @@ -566,18 +566,6 @@ static int imx334_update_exp_gain(struct imx334 *imx334, u32 exposure, u32 gain) > return ret; > } > > -/** > - * imx334_set_ctrl() - Set subdevice control > - * @ctrl: pointer to v4l2_ctrl structure > - * > - * Supported controls: > - * - V4L2_CID_VBLANK > - * - cluster controls: > - * - V4L2_CID_ANALOGUE_GAIN > - * - V4L2_CID_EXPOSURE > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_set_ctrl(struct v4l2_ctrl *ctrl) > { > struct imx334 *imx334 = > @@ -678,14 +666,6 @@ static int imx334_get_format_code(struct imx334 *imx334, u32 code) > return imx334_mbus_codes[0]; > } > > -/** > - * imx334_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes > - * @sd: pointer to imx334 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device state > - * @code: V4L2 sub-device code enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_mbus_code_enum *code) > @@ -698,14 +678,6 @@ static int imx334_enum_mbus_code(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx334_enum_frame_size() - Enumerate V4L2 sub-device frame sizes > - * @sd: pointer to imx334 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device state > - * @fsize: V4L2 sub-device size enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_enum_frame_size(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_frame_size_enum *fsize) > @@ -749,14 +721,6 @@ static void imx334_fill_pad_format(struct imx334 *imx334, > fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; > } > > -/** > - * imx334_get_pad_format() - Get subdevice pad format > - * @sd: pointer to imx334 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device state > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_get_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -776,14 +740,6 @@ static int imx334_get_pad_format(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx334_set_pad_format() - Set subdevice pad format > - * @sd: pointer to imx334 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device state > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -815,13 +771,6 @@ static int imx334_set_pad_format(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * imx334_init_state() - Initialize sub-device state > - * @sd: pointer to imx334 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device state > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_init_state(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state) > { > @@ -856,15 +805,6 @@ static int imx334_set_framefmt(struct imx334 *imx334) > return -EINVAL; > } > > -/** > - * imx334_enable_streams() - Enable specified streams for the sensor > - * @sd: pointer to the V4L2 subdevice > - * @state: pointer to the subdevice state > - * @pad: pad number for which streams are enabled > - * @streams_mask: bitmask specifying the streams to enable > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_enable_streams(struct v4l2_subdev *sd, > struct v4l2_subdev_state *state, u32 pad, > u64 streams_mask) > @@ -929,15 +869,6 @@ static int imx334_enable_streams(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * imx334_disable_streams() - Enable specified streams for the sensor > - * @sd: pointer to the V4L2 subdevice > - * @state: pointer to the subdevice state > - * @pad: pad number for which streams are disabled > - * @streams_mask: bitmask specifying the streams to disable > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_disable_streams(struct v4l2_subdev *sd, > struct v4l2_subdev_state *state, u32 pad, > u64 streams_mask) > @@ -1067,12 +998,6 @@ static const struct v4l2_subdev_internal_ops imx334_internal_ops = { > .init_state = imx334_init_state, > }; > > -/** > - * imx334_power_on() - Sensor power on sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_power_on(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1101,12 +1026,6 @@ static int imx334_power_on(struct device *dev) > return ret; > } > > -/** > - * imx334_power_off() - Sensor power off sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_power_off(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1206,12 +1125,6 @@ static int imx334_init_controls(struct imx334 *imx334) > return 0; > } > > -/** > - * imx334_probe() - I2C client device binding > - * @client: pointer to i2c client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_probe(struct i2c_client *client) > { > struct imx334 *imx334; > @@ -1311,12 +1224,6 @@ static int imx334_probe(struct i2c_client *client) > return ret; > } > > -/** > - * imx334_remove() - I2C client device unbinding > - * @client: pointer to I2C client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static void imx334_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 09/29] media: imx334: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 09/29] media: imx334: " Sakari Ailus 2026-04-10 9:02 ` Jacopo Mondi @ 2026-04-16 14:27 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 14:27 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:18PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These comments > have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/media/i2c/imx334.c | 93 -------------------------------------- > 1 file changed, 93 deletions(-) > > diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c > index 9654f9268056..553a16b84f4d 100644 > --- a/drivers/media/i2c/imx334.c > +++ b/drivers/media/i2c/imx334.c > @@ -566,18 +566,6 @@ static int imx334_update_exp_gain(struct imx334 *imx334, u32 exposure, u32 gain) > return ret; > } > > -/** > - * imx334_set_ctrl() - Set subdevice control > - * @ctrl: pointer to v4l2_ctrl structure > - * > - * Supported controls: > - * - V4L2_CID_VBLANK > - * - cluster controls: > - * - V4L2_CID_ANALOGUE_GAIN > - * - V4L2_CID_EXPOSURE > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_set_ctrl(struct v4l2_ctrl *ctrl) > { > struct imx334 *imx334 = > @@ -678,14 +666,6 @@ static int imx334_get_format_code(struct imx334 *imx334, u32 code) > return imx334_mbus_codes[0]; > } > > -/** > - * imx334_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes > - * @sd: pointer to imx334 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device state > - * @code: V4L2 sub-device code enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_mbus_code_enum *code) > @@ -698,14 +678,6 @@ static int imx334_enum_mbus_code(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx334_enum_frame_size() - Enumerate V4L2 sub-device frame sizes > - * @sd: pointer to imx334 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device state > - * @fsize: V4L2 sub-device size enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_enum_frame_size(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_frame_size_enum *fsize) > @@ -749,14 +721,6 @@ static void imx334_fill_pad_format(struct imx334 *imx334, > fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; > } > > -/** > - * imx334_get_pad_format() - Get subdevice pad format > - * @sd: pointer to imx334 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device state > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_get_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -776,14 +740,6 @@ static int imx334_get_pad_format(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx334_set_pad_format() - Set subdevice pad format > - * @sd: pointer to imx334 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device state > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -815,13 +771,6 @@ static int imx334_set_pad_format(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * imx334_init_state() - Initialize sub-device state > - * @sd: pointer to imx334 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device state > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_init_state(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state) > { > @@ -856,15 +805,6 @@ static int imx334_set_framefmt(struct imx334 *imx334) > return -EINVAL; > } > > -/** > - * imx334_enable_streams() - Enable specified streams for the sensor > - * @sd: pointer to the V4L2 subdevice > - * @state: pointer to the subdevice state > - * @pad: pad number for which streams are enabled > - * @streams_mask: bitmask specifying the streams to enable > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_enable_streams(struct v4l2_subdev *sd, > struct v4l2_subdev_state *state, u32 pad, > u64 streams_mask) > @@ -929,15 +869,6 @@ static int imx334_enable_streams(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * imx334_disable_streams() - Enable specified streams for the sensor > - * @sd: pointer to the V4L2 subdevice > - * @state: pointer to the subdevice state > - * @pad: pad number for which streams are disabled > - * @streams_mask: bitmask specifying the streams to disable > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_disable_streams(struct v4l2_subdev *sd, > struct v4l2_subdev_state *state, u32 pad, > u64 streams_mask) > @@ -1067,12 +998,6 @@ static const struct v4l2_subdev_internal_ops imx334_internal_ops = { > .init_state = imx334_init_state, > }; > > -/** > - * imx334_power_on() - Sensor power on sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_power_on(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1101,12 +1026,6 @@ static int imx334_power_on(struct device *dev) > return ret; > } > > -/** > - * imx334_power_off() - Sensor power off sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_power_off(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1206,12 +1125,6 @@ static int imx334_init_controls(struct imx334 *imx334) > return 0; > } > > -/** > - * imx334_probe() - I2C client device binding > - * @client: pointer to i2c client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx334_probe(struct i2c_client *client) > { > struct imx334 *imx334; > @@ -1311,12 +1224,6 @@ static int imx334_probe(struct i2c_client *client) > return ret; > } > > -/** > - * imx334_remove() - I2C client device unbinding > - * @client: pointer to I2C client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static void imx334_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 10/29] media: imx335: Remove redundant kernel-doc comments 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (8 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 09/29] media: imx334: " Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 9:02 ` Jacopo Mondi 2026-04-16 14:27 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 11/29] media: imx412: " Sakari Ailus ` (18 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Remove kernel-doc comments from regular callback functions. These comments have no information value. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/imx335.c | 87 -------------------------------------- 1 file changed, 87 deletions(-) diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c index 5790aa4fabeb..1f777a1a8192 100644 --- a/drivers/media/i2c/imx335.c +++ b/drivers/media/i2c/imx335.c @@ -698,18 +698,6 @@ static int imx335_update_test_pattern(struct imx335 *imx335, u32 pattern_index) return ret; } -/** - * imx335_set_ctrl() - Set subdevice control - * @ctrl: pointer to v4l2_ctrl structure - * - * Supported controls: - * - V4L2_CID_VBLANK - * - cluster controls: - * - V4L2_CID_ANALOGUE_GAIN - * - V4L2_CID_EXPOSURE - * - * Return: 0 if successful, error code otherwise. - */ static int imx335_set_ctrl(struct v4l2_ctrl *ctrl) { struct imx335 *imx335 = @@ -800,14 +788,6 @@ static int imx335_get_format_code(struct imx335 *imx335, u32 code) return imx335_mbus_codes[0]; } -/** - * imx335_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes - * @sd: pointer to imx335 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @code: V4L2 sub-device code enumeration need to be filled - * - * Return: 0 if successful, error code otherwise. - */ static int imx335_enum_mbus_code(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_mbus_code_enum *code) @@ -820,14 +800,6 @@ static int imx335_enum_mbus_code(struct v4l2_subdev *sd, return 0; } -/** - * imx335_enum_frame_size() - Enumerate V4L2 sub-device frame sizes - * @sd: pointer to imx335 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @fsize: V4L2 sub-device size enumeration need to be filled - * - * Return: 0 if successful, error code otherwise. - */ static int imx335_enum_frame_size(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_frame_size_enum *fsize) @@ -871,14 +843,6 @@ static void imx335_fill_pad_format(struct imx335 *imx335, fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; } -/** - * imx335_set_pad_format() - Set subdevice pad format - * @sd: pointer to imx335 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @fmt: V4L2 sub-device format need to be set - * - * Return: 0 if successful, error code otherwise. - */ static int imx335_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) @@ -923,13 +887,6 @@ static int imx335_set_pad_format(struct v4l2_subdev *sd, return ret; } -/** - * imx335_init_state() - Initialize sub-device state - * @sd: pointer to imx335 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * - * Return: 0 if successful, error code otherwise. - */ static int imx335_init_state(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state) { @@ -947,14 +904,6 @@ static int imx335_init_state(struct v4l2_subdev *sd, return imx335_set_pad_format(sd, sd_state, &fmt); } -/** - * imx335_get_selection() - Selection API - * @sd: pointer to imx335 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @sel: V4L2 selection info - * - * Return: 0 if successful, error code otherwise. - */ static int imx335_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) @@ -1011,15 +960,6 @@ static int imx335_set_framefmt(struct imx335 *imx335) return ret; } -/** - * imx335_enable_streams() - Enable sensor streams - * @sd: V4L2 subdevice - * @state: V4L2 subdevice state - * @pad: The pad to enable - * @streams_mask: Bitmask of streams to enable - * - * Return: 0 if successful, error code otherwise. - */ static int imx335_enable_streams(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, u32 pad, u64 streams_mask) @@ -1097,15 +1037,6 @@ static int imx335_enable_streams(struct v4l2_subdev *sd, return ret; } -/** - * imx335_disable_streams() - Disable sensor streams - * @sd: V4L2 subdevice - * @state: V4L2 subdevice state - * @pad: The pad to disable - * @streams_mask: Bitmask of streams to disable - * - * Return: 0 if successful, error code otherwise. - */ static int imx335_disable_streams(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, u32 pad, u64 streams_mask) @@ -1299,12 +1230,6 @@ static int imx335_power_on(struct device *dev) return ret; } -/** - * imx335_power_off() - Sensor power off sequence - * @dev: pointer to i2c device - * - * Return: 0 if successful, error code otherwise. - */ static int imx335_power_off(struct device *dev) { struct v4l2_subdev *sd = dev_get_drvdata(dev); @@ -1430,12 +1355,6 @@ static int imx335_init_controls(struct imx335 *imx335) return 0; } -/** - * imx335_probe() - I2C client device binding - * @client: pointer to i2c client device - * - * Return: 0 if successful, error code otherwise. - */ static int imx335_probe(struct i2c_client *client) { struct imx335 *imx335; @@ -1530,12 +1449,6 @@ static int imx335_probe(struct i2c_client *client) return ret; } -/** - * imx335_remove() - I2C client device unbinding - * @client: pointer to I2C client device - * - * Return: 0 if successful, error code otherwise. - */ static void imx335_remove(struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 10/29] media: imx335: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 10/29] media: imx335: " Sakari Ailus @ 2026-04-10 9:02 ` Jacopo Mondi 2026-04-16 14:27 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 9:02 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:19PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These comments > have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/i2c/imx335.c | 87 -------------------------------------- > 1 file changed, 87 deletions(-) > > diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c > index 5790aa4fabeb..1f777a1a8192 100644 > --- a/drivers/media/i2c/imx335.c > +++ b/drivers/media/i2c/imx335.c > @@ -698,18 +698,6 @@ static int imx335_update_test_pattern(struct imx335 *imx335, u32 pattern_index) > return ret; > } > > -/** > - * imx335_set_ctrl() - Set subdevice control > - * @ctrl: pointer to v4l2_ctrl structure > - * > - * Supported controls: > - * - V4L2_CID_VBLANK > - * - cluster controls: > - * - V4L2_CID_ANALOGUE_GAIN > - * - V4L2_CID_EXPOSURE > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_set_ctrl(struct v4l2_ctrl *ctrl) > { > struct imx335 *imx335 = > @@ -800,14 +788,6 @@ static int imx335_get_format_code(struct imx335 *imx335, u32 code) > return imx335_mbus_codes[0]; > } > > -/** > - * imx335_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes > - * @sd: pointer to imx335 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @code: V4L2 sub-device code enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_mbus_code_enum *code) > @@ -820,14 +800,6 @@ static int imx335_enum_mbus_code(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx335_enum_frame_size() - Enumerate V4L2 sub-device frame sizes > - * @sd: pointer to imx335 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fsize: V4L2 sub-device size enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_enum_frame_size(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_frame_size_enum *fsize) > @@ -871,14 +843,6 @@ static void imx335_fill_pad_format(struct imx335 *imx335, > fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; > } > > -/** > - * imx335_set_pad_format() - Set subdevice pad format > - * @sd: pointer to imx335 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -923,13 +887,6 @@ static int imx335_set_pad_format(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * imx335_init_state() - Initialize sub-device state > - * @sd: pointer to imx335 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_init_state(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state) > { > @@ -947,14 +904,6 @@ static int imx335_init_state(struct v4l2_subdev *sd, > return imx335_set_pad_format(sd, sd_state, &fmt); > } > > -/** > - * imx335_get_selection() - Selection API > - * @sd: pointer to imx335 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @sel: V4L2 selection info > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_get_selection(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_selection *sel) > @@ -1011,15 +960,6 @@ static int imx335_set_framefmt(struct imx335 *imx335) > return ret; > } > > -/** > - * imx335_enable_streams() - Enable sensor streams > - * @sd: V4L2 subdevice > - * @state: V4L2 subdevice state > - * @pad: The pad to enable > - * @streams_mask: Bitmask of streams to enable > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_enable_streams(struct v4l2_subdev *sd, > struct v4l2_subdev_state *state, u32 pad, > u64 streams_mask) > @@ -1097,15 +1037,6 @@ static int imx335_enable_streams(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * imx335_disable_streams() - Disable sensor streams > - * @sd: V4L2 subdevice > - * @state: V4L2 subdevice state > - * @pad: The pad to disable > - * @streams_mask: Bitmask of streams to disable > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_disable_streams(struct v4l2_subdev *sd, > struct v4l2_subdev_state *state, u32 pad, > u64 streams_mask) > @@ -1299,12 +1230,6 @@ static int imx335_power_on(struct device *dev) > return ret; > } > > -/** > - * imx335_power_off() - Sensor power off sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_power_off(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1430,12 +1355,6 @@ static int imx335_init_controls(struct imx335 *imx335) > return 0; > } > > -/** > - * imx335_probe() - I2C client device binding > - * @client: pointer to i2c client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_probe(struct i2c_client *client) > { > struct imx335 *imx335; > @@ -1530,12 +1449,6 @@ static int imx335_probe(struct i2c_client *client) > return ret; > } > > -/** > - * imx335_remove() - I2C client device unbinding > - * @client: pointer to I2C client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static void imx335_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 10/29] media: imx335: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 10/29] media: imx335: " Sakari Ailus 2026-04-10 9:02 ` Jacopo Mondi @ 2026-04-16 14:27 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 14:27 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:19PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These comments > have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/media/i2c/imx335.c | 87 -------------------------------------- > 1 file changed, 87 deletions(-) > > diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c > index 5790aa4fabeb..1f777a1a8192 100644 > --- a/drivers/media/i2c/imx335.c > +++ b/drivers/media/i2c/imx335.c > @@ -698,18 +698,6 @@ static int imx335_update_test_pattern(struct imx335 *imx335, u32 pattern_index) > return ret; > } > > -/** > - * imx335_set_ctrl() - Set subdevice control > - * @ctrl: pointer to v4l2_ctrl structure > - * > - * Supported controls: > - * - V4L2_CID_VBLANK > - * - cluster controls: > - * - V4L2_CID_ANALOGUE_GAIN > - * - V4L2_CID_EXPOSURE > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_set_ctrl(struct v4l2_ctrl *ctrl) > { > struct imx335 *imx335 = > @@ -800,14 +788,6 @@ static int imx335_get_format_code(struct imx335 *imx335, u32 code) > return imx335_mbus_codes[0]; > } > > -/** > - * imx335_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes > - * @sd: pointer to imx335 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @code: V4L2 sub-device code enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_mbus_code_enum *code) > @@ -820,14 +800,6 @@ static int imx335_enum_mbus_code(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx335_enum_frame_size() - Enumerate V4L2 sub-device frame sizes > - * @sd: pointer to imx335 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fsize: V4L2 sub-device size enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_enum_frame_size(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_frame_size_enum *fsize) > @@ -871,14 +843,6 @@ static void imx335_fill_pad_format(struct imx335 *imx335, > fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; > } > > -/** > - * imx335_set_pad_format() - Set subdevice pad format > - * @sd: pointer to imx335 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -923,13 +887,6 @@ static int imx335_set_pad_format(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * imx335_init_state() - Initialize sub-device state > - * @sd: pointer to imx335 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_init_state(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state) > { > @@ -947,14 +904,6 @@ static int imx335_init_state(struct v4l2_subdev *sd, > return imx335_set_pad_format(sd, sd_state, &fmt); > } > > -/** > - * imx335_get_selection() - Selection API > - * @sd: pointer to imx335 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @sel: V4L2 selection info > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_get_selection(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_selection *sel) > @@ -1011,15 +960,6 @@ static int imx335_set_framefmt(struct imx335 *imx335) > return ret; > } > > -/** > - * imx335_enable_streams() - Enable sensor streams > - * @sd: V4L2 subdevice > - * @state: V4L2 subdevice state > - * @pad: The pad to enable > - * @streams_mask: Bitmask of streams to enable > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_enable_streams(struct v4l2_subdev *sd, > struct v4l2_subdev_state *state, u32 pad, > u64 streams_mask) > @@ -1097,15 +1037,6 @@ static int imx335_enable_streams(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * imx335_disable_streams() - Disable sensor streams > - * @sd: V4L2 subdevice > - * @state: V4L2 subdevice state > - * @pad: The pad to disable > - * @streams_mask: Bitmask of streams to disable > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_disable_streams(struct v4l2_subdev *sd, > struct v4l2_subdev_state *state, u32 pad, > u64 streams_mask) > @@ -1299,12 +1230,6 @@ static int imx335_power_on(struct device *dev) > return ret; > } > > -/** > - * imx335_power_off() - Sensor power off sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_power_off(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1430,12 +1355,6 @@ static int imx335_init_controls(struct imx335 *imx335) > return 0; > } > > -/** > - * imx335_probe() - I2C client device binding > - * @client: pointer to i2c client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx335_probe(struct i2c_client *client) > { > struct imx335 *imx335; > @@ -1530,12 +1449,6 @@ static int imx335_probe(struct i2c_client *client) > return ret; > } > > -/** > - * imx335_remove() - I2C client device unbinding > - * @client: pointer to I2C client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static void imx335_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 11/29] media: imx412: Remove redundant kernel-doc comments 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (9 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 10/29] media: imx335: " Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 9:03 ` Jacopo Mondi 2026-04-16 14:28 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 12/29] media: ov9282: " Sakari Ailus ` (17 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Remove kernel-doc comments from regular callback functions. These comments have no information value. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/imx412.c | 82 -------------------------------------- 1 file changed, 82 deletions(-) diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c index e25e0a9ff65c..2705af2f16c0 100644 --- a/drivers/media/i2c/imx412.c +++ b/drivers/media/i2c/imx412.c @@ -570,18 +570,6 @@ static int imx412_update_exp_gain(struct imx412 *imx412, u32 exposure, u32 gain) return ret; } -/** - * imx412_set_ctrl() - Set subdevice control - * @ctrl: pointer to v4l2_ctrl structure - * - * Supported controls: - * - V4L2_CID_VBLANK - * - cluster controls: - * - V4L2_CID_ANALOGUE_GAIN - * - V4L2_CID_EXPOSURE - * - * Return: 0 if successful, error code otherwise. - */ static int imx412_set_ctrl(struct v4l2_ctrl *ctrl) { struct imx412 *imx412 = @@ -634,14 +622,6 @@ static const struct v4l2_ctrl_ops imx412_ctrl_ops = { .s_ctrl = imx412_set_ctrl, }; -/** - * imx412_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes - * @sd: pointer to imx412 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @code: V4L2 sub-device code enumeration need to be filled - * - * Return: 0 if successful, error code otherwise. - */ static int imx412_enum_mbus_code(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_mbus_code_enum *code) @@ -654,14 +634,6 @@ static int imx412_enum_mbus_code(struct v4l2_subdev *sd, return 0; } -/** - * imx412_enum_frame_size() - Enumerate V4L2 sub-device frame sizes - * @sd: pointer to imx412 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @fsize: V4L2 sub-device size enumeration need to be filled - * - * Return: 0 if successful, error code otherwise. - */ static int imx412_enum_frame_size(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_frame_size_enum *fsize) @@ -701,14 +673,6 @@ static void imx412_fill_pad_format(struct imx412 *imx412, fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; } -/** - * imx412_get_pad_format() - Get subdevice pad format - * @sd: pointer to imx412 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @fmt: V4L2 sub-device format need to be set - * - * Return: 0 if successful, error code otherwise. - */ static int imx412_get_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) @@ -731,14 +695,6 @@ static int imx412_get_pad_format(struct v4l2_subdev *sd, return 0; } -/** - * imx412_set_pad_format() - Set subdevice pad format - * @sd: pointer to imx412 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @fmt: V4L2 sub-device format need to be set - * - * Return: 0 if successful, error code otherwise. - */ static int imx412_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) @@ -768,13 +724,6 @@ static int imx412_set_pad_format(struct v4l2_subdev *sd, return ret; } -/** - * imx412_init_state() - Initialize sub-device state - * @sd: pointer to imx412 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * - * Return: 0 if successful, error code otherwise. - */ static int imx412_init_state(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state) { @@ -840,13 +789,6 @@ static int imx412_stop_streaming(struct imx412 *imx412) 1, IMX412_MODE_STANDBY); } -/** - * imx412_set_stream() - Enable sensor streaming - * @sd: pointer to imx412 subdevice - * @enable: set to enable sensor streaming - * - * Return: 0 if successful, error code otherwise. - */ static int imx412_set_stream(struct v4l2_subdev *sd, int enable) { struct imx412 *imx412 = to_imx412(sd); @@ -1010,12 +952,6 @@ static const struct v4l2_subdev_internal_ops imx412_internal_ops = { .init_state = imx412_init_state, }; -/** - * imx412_power_on() - Sensor power on sequence - * @dev: pointer to i2c device - * - * Return: 0 if successful, error code otherwise. - */ static int imx412_power_on(struct device *dev) { struct v4l2_subdev *sd = dev_get_drvdata(dev); @@ -1053,12 +989,6 @@ static int imx412_power_on(struct device *dev) return ret; } -/** - * imx412_power_off() - Sensor power off sequence - * @dev: pointer to i2c device - * - * Return: 0 if successful, error code otherwise. - */ static int imx412_power_off(struct device *dev) { struct v4l2_subdev *sd = dev_get_drvdata(dev); @@ -1159,12 +1089,6 @@ static int imx412_init_controls(struct imx412 *imx412) return 0; } -/** - * imx412_probe() - I2C client device binding - * @client: pointer to i2c client device - * - * Return: 0 if successful, error code otherwise. - */ static int imx412_probe(struct i2c_client *client) { struct imx412 *imx412; @@ -1254,12 +1178,6 @@ static int imx412_probe(struct i2c_client *client) return ret; } -/** - * imx412_remove() - I2C client device unbinding - * @client: pointer to I2C client device - * - * Return: 0 if successful, error code otherwise. - */ static void imx412_remove(struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 11/29] media: imx412: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 11/29] media: imx412: " Sakari Ailus @ 2026-04-10 9:03 ` Jacopo Mondi 2026-04-16 14:28 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 9:03 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:20PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These comments > have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/i2c/imx412.c | 82 -------------------------------------- > 1 file changed, 82 deletions(-) > > diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c > index e25e0a9ff65c..2705af2f16c0 100644 > --- a/drivers/media/i2c/imx412.c > +++ b/drivers/media/i2c/imx412.c > @@ -570,18 +570,6 @@ static int imx412_update_exp_gain(struct imx412 *imx412, u32 exposure, u32 gain) > return ret; > } > > -/** > - * imx412_set_ctrl() - Set subdevice control > - * @ctrl: pointer to v4l2_ctrl structure > - * > - * Supported controls: > - * - V4L2_CID_VBLANK > - * - cluster controls: > - * - V4L2_CID_ANALOGUE_GAIN > - * - V4L2_CID_EXPOSURE > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_set_ctrl(struct v4l2_ctrl *ctrl) > { > struct imx412 *imx412 = > @@ -634,14 +622,6 @@ static const struct v4l2_ctrl_ops imx412_ctrl_ops = { > .s_ctrl = imx412_set_ctrl, > }; > > -/** > - * imx412_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes > - * @sd: pointer to imx412 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @code: V4L2 sub-device code enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_mbus_code_enum *code) > @@ -654,14 +634,6 @@ static int imx412_enum_mbus_code(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx412_enum_frame_size() - Enumerate V4L2 sub-device frame sizes > - * @sd: pointer to imx412 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fsize: V4L2 sub-device size enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_enum_frame_size(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_frame_size_enum *fsize) > @@ -701,14 +673,6 @@ static void imx412_fill_pad_format(struct imx412 *imx412, > fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; > } > > -/** > - * imx412_get_pad_format() - Get subdevice pad format > - * @sd: pointer to imx412 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_get_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -731,14 +695,6 @@ static int imx412_get_pad_format(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx412_set_pad_format() - Set subdevice pad format > - * @sd: pointer to imx412 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -768,13 +724,6 @@ static int imx412_set_pad_format(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * imx412_init_state() - Initialize sub-device state > - * @sd: pointer to imx412 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_init_state(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state) > { > @@ -840,13 +789,6 @@ static int imx412_stop_streaming(struct imx412 *imx412) > 1, IMX412_MODE_STANDBY); > } > > -/** > - * imx412_set_stream() - Enable sensor streaming > - * @sd: pointer to imx412 subdevice > - * @enable: set to enable sensor streaming > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_set_stream(struct v4l2_subdev *sd, int enable) > { > struct imx412 *imx412 = to_imx412(sd); > @@ -1010,12 +952,6 @@ static const struct v4l2_subdev_internal_ops imx412_internal_ops = { > .init_state = imx412_init_state, > }; > > -/** > - * imx412_power_on() - Sensor power on sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_power_on(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1053,12 +989,6 @@ static int imx412_power_on(struct device *dev) > return ret; > } > > -/** > - * imx412_power_off() - Sensor power off sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_power_off(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1159,12 +1089,6 @@ static int imx412_init_controls(struct imx412 *imx412) > return 0; > } > > -/** > - * imx412_probe() - I2C client device binding > - * @client: pointer to i2c client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_probe(struct i2c_client *client) > { > struct imx412 *imx412; > @@ -1254,12 +1178,6 @@ static int imx412_probe(struct i2c_client *client) > return ret; > } > > -/** > - * imx412_remove() - I2C client device unbinding > - * @client: pointer to I2C client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static void imx412_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 11/29] media: imx412: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 11/29] media: imx412: " Sakari Ailus 2026-04-10 9:03 ` Jacopo Mondi @ 2026-04-16 14:28 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 14:28 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:20PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These comments > have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/media/i2c/imx412.c | 82 -------------------------------------- > 1 file changed, 82 deletions(-) > > diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c > index e25e0a9ff65c..2705af2f16c0 100644 > --- a/drivers/media/i2c/imx412.c > +++ b/drivers/media/i2c/imx412.c > @@ -570,18 +570,6 @@ static int imx412_update_exp_gain(struct imx412 *imx412, u32 exposure, u32 gain) > return ret; > } > > -/** > - * imx412_set_ctrl() - Set subdevice control > - * @ctrl: pointer to v4l2_ctrl structure > - * > - * Supported controls: > - * - V4L2_CID_VBLANK > - * - cluster controls: > - * - V4L2_CID_ANALOGUE_GAIN > - * - V4L2_CID_EXPOSURE > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_set_ctrl(struct v4l2_ctrl *ctrl) > { > struct imx412 *imx412 = > @@ -634,14 +622,6 @@ static const struct v4l2_ctrl_ops imx412_ctrl_ops = { > .s_ctrl = imx412_set_ctrl, > }; > > -/** > - * imx412_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes > - * @sd: pointer to imx412 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @code: V4L2 sub-device code enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_mbus_code_enum *code) > @@ -654,14 +634,6 @@ static int imx412_enum_mbus_code(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx412_enum_frame_size() - Enumerate V4L2 sub-device frame sizes > - * @sd: pointer to imx412 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fsize: V4L2 sub-device size enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_enum_frame_size(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_frame_size_enum *fsize) > @@ -701,14 +673,6 @@ static void imx412_fill_pad_format(struct imx412 *imx412, > fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; > } > > -/** > - * imx412_get_pad_format() - Get subdevice pad format > - * @sd: pointer to imx412 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_get_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -731,14 +695,6 @@ static int imx412_get_pad_format(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * imx412_set_pad_format() - Set subdevice pad format > - * @sd: pointer to imx412 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -768,13 +724,6 @@ static int imx412_set_pad_format(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * imx412_init_state() - Initialize sub-device state > - * @sd: pointer to imx412 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_init_state(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state) > { > @@ -840,13 +789,6 @@ static int imx412_stop_streaming(struct imx412 *imx412) > 1, IMX412_MODE_STANDBY); > } > > -/** > - * imx412_set_stream() - Enable sensor streaming > - * @sd: pointer to imx412 subdevice > - * @enable: set to enable sensor streaming > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_set_stream(struct v4l2_subdev *sd, int enable) > { > struct imx412 *imx412 = to_imx412(sd); > @@ -1010,12 +952,6 @@ static const struct v4l2_subdev_internal_ops imx412_internal_ops = { > .init_state = imx412_init_state, > }; > > -/** > - * imx412_power_on() - Sensor power on sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_power_on(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1053,12 +989,6 @@ static int imx412_power_on(struct device *dev) > return ret; > } > > -/** > - * imx412_power_off() - Sensor power off sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_power_off(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1159,12 +1089,6 @@ static int imx412_init_controls(struct imx412 *imx412) > return 0; > } > > -/** > - * imx412_probe() - I2C client device binding > - * @client: pointer to i2c client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int imx412_probe(struct i2c_client *client) > { > struct imx412 *imx412; > @@ -1254,12 +1178,6 @@ static int imx412_probe(struct i2c_client *client) > return ret; > } > > -/** > - * imx412_remove() - I2C client device unbinding > - * @client: pointer to I2C client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static void imx412_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 12/29] media: ov9282: Remove redundant kernel-doc comments 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (10 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 11/29] media: imx412: " Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 9:08 ` Jacopo Mondi 2026-04-16 14:28 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 13/29] media: tvp514x: " Sakari Ailus ` (16 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Remove kernel-doc comments from regular callback functions. These comments have no information value. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/ov9282.c | 67 -------------------------------------- 1 file changed, 67 deletions(-) diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c index 2167fb73ea41..5b6f897a74fc 100644 --- a/drivers/media/i2c/ov9282.c +++ b/drivers/media/i2c/ov9282.c @@ -586,18 +586,6 @@ static u32 ov9282_flash_duration_to_us(struct ov9282 *ov9282, u32 value) return DIV_ROUND_UP(value * frame_width, OV9282_STROBE_SPAN_FACTOR); } -/** - * ov9282_set_ctrl() - Set subdevice control - * @ctrl: pointer to v4l2_ctrl structure - * - * Supported controls: - * - V4L2_CID_VBLANK - * - cluster controls: - * - V4L2_CID_ANALOGUE_GAIN - * - V4L2_CID_EXPOSURE - * - * Return: 0 if successful, error code otherwise. - */ static int ov9282_set_ctrl(struct v4l2_ctrl *ctrl) { struct ov9282 *ov9282 = @@ -704,14 +692,6 @@ static const struct v4l2_ctrl_ops ov9282_ctrl_ops = { .try_ctrl = ov9282_try_ctrl, }; -/** - * ov9282_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes - * @sd: pointer to ov9282 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @code: V4L2 sub-device code enumeration need to be filled - * - * Return: 0 if successful, error code otherwise. - */ static int ov9282_enum_mbus_code(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_mbus_code_enum *code) @@ -780,14 +760,6 @@ static void ov9282_fill_pad_format(struct ov9282 *ov9282, fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; } -/** - * ov9282_get_pad_format() - Get subdevice pad format - * @sd: pointer to ov9282 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @fmt: V4L2 sub-device format need to be set - * - * Return: 0 if successful, error code otherwise. - */ static int ov9282_get_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) @@ -807,14 +779,6 @@ static int ov9282_get_pad_format(struct v4l2_subdev *sd, return 0; } -/** - * ov9282_set_pad_format() - Set subdevice pad format - * @sd: pointer to ov9282 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * @fmt: V4L2 sub-device format need to be set - * - * Return: 0 if successful, error code otherwise. - */ static int ov9282_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) @@ -852,13 +816,6 @@ static int ov9282_set_pad_format(struct v4l2_subdev *sd, return ret; } -/** - * ov9282_init_state() - Initialize sub-device state - * @sd: pointer to ov9282 V4L2 sub-device structure - * @sd_state: V4L2 sub-device configuration - * - * Return: 0 if successful, error code otherwise. - */ static int ov9282_init_state(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state) { @@ -1157,12 +1114,6 @@ static const struct v4l2_subdev_internal_ops ov9282_internal_ops = { .init_state = ov9282_init_state, }; -/** - * ov9282_power_on() - Sensor power on sequence - * @dev: pointer to i2c device - * - * Return: 0 if successful, error code otherwise. - */ static int ov9282_power_on(struct device *dev) { struct v4l2_subdev *sd = dev_get_drvdata(dev); @@ -1206,12 +1157,6 @@ static int ov9282_power_on(struct device *dev) return ret; } -/** - * ov9282_power_off() - Sensor power off sequence - * @dev: pointer to i2c device - * - * Return: 0 if successful, error code otherwise. - */ static int ov9282_power_off(struct device *dev) { struct v4l2_subdev *sd = dev_get_drvdata(dev); @@ -1333,12 +1278,6 @@ static int ov9282_init_controls(struct ov9282 *ov9282) return 0; } -/** - * ov9282_probe() - I2C client device binding - * @client: pointer to i2c client device - * - * Return: 0 if successful, error code otherwise. - */ static int ov9282_probe(struct i2c_client *client) { struct ov9282 *ov9282; @@ -1435,12 +1374,6 @@ static int ov9282_probe(struct i2c_client *client) return ret; } -/** - * ov9282_remove() - I2C client device unbinding - * @client: pointer to I2C client device - * - * Return: 0 if successful, error code otherwise. - */ static void ov9282_remove(struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 12/29] media: ov9282: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 12/29] media: ov9282: " Sakari Ailus @ 2026-04-10 9:08 ` Jacopo Mondi 2026-04-16 14:28 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 9:08 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:21PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These comments > have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/i2c/ov9282.c | 67 -------------------------------------- > 1 file changed, 67 deletions(-) > > diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c > index 2167fb73ea41..5b6f897a74fc 100644 > --- a/drivers/media/i2c/ov9282.c > +++ b/drivers/media/i2c/ov9282.c > @@ -586,18 +586,6 @@ static u32 ov9282_flash_duration_to_us(struct ov9282 *ov9282, u32 value) > return DIV_ROUND_UP(value * frame_width, OV9282_STROBE_SPAN_FACTOR); > } > > -/** > - * ov9282_set_ctrl() - Set subdevice control > - * @ctrl: pointer to v4l2_ctrl structure > - * > - * Supported controls: > - * - V4L2_CID_VBLANK > - * - cluster controls: > - * - V4L2_CID_ANALOGUE_GAIN > - * - V4L2_CID_EXPOSURE > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_set_ctrl(struct v4l2_ctrl *ctrl) > { > struct ov9282 *ov9282 = > @@ -704,14 +692,6 @@ static const struct v4l2_ctrl_ops ov9282_ctrl_ops = { > .try_ctrl = ov9282_try_ctrl, > }; > > -/** > - * ov9282_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes > - * @sd: pointer to ov9282 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @code: V4L2 sub-device code enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_mbus_code_enum *code) > @@ -780,14 +760,6 @@ static void ov9282_fill_pad_format(struct ov9282 *ov9282, > fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; > } > > -/** > - * ov9282_get_pad_format() - Get subdevice pad format > - * @sd: pointer to ov9282 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_get_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -807,14 +779,6 @@ static int ov9282_get_pad_format(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * ov9282_set_pad_format() - Set subdevice pad format > - * @sd: pointer to ov9282 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -852,13 +816,6 @@ static int ov9282_set_pad_format(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * ov9282_init_state() - Initialize sub-device state > - * @sd: pointer to ov9282 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_init_state(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state) > { > @@ -1157,12 +1114,6 @@ static const struct v4l2_subdev_internal_ops ov9282_internal_ops = { > .init_state = ov9282_init_state, > }; > > -/** > - * ov9282_power_on() - Sensor power on sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_power_on(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1206,12 +1157,6 @@ static int ov9282_power_on(struct device *dev) > return ret; > } > > -/** > - * ov9282_power_off() - Sensor power off sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_power_off(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1333,12 +1278,6 @@ static int ov9282_init_controls(struct ov9282 *ov9282) > return 0; > } > > -/** > - * ov9282_probe() - I2C client device binding > - * @client: pointer to i2c client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_probe(struct i2c_client *client) > { > struct ov9282 *ov9282; > @@ -1435,12 +1374,6 @@ static int ov9282_probe(struct i2c_client *client) > return ret; > } > > -/** > - * ov9282_remove() - I2C client device unbinding > - * @client: pointer to I2C client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static void ov9282_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 12/29] media: ov9282: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 12/29] media: ov9282: " Sakari Ailus 2026-04-10 9:08 ` Jacopo Mondi @ 2026-04-16 14:28 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 14:28 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:21PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These comments > have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/media/i2c/ov9282.c | 67 -------------------------------------- > 1 file changed, 67 deletions(-) > > diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c > index 2167fb73ea41..5b6f897a74fc 100644 > --- a/drivers/media/i2c/ov9282.c > +++ b/drivers/media/i2c/ov9282.c > @@ -586,18 +586,6 @@ static u32 ov9282_flash_duration_to_us(struct ov9282 *ov9282, u32 value) > return DIV_ROUND_UP(value * frame_width, OV9282_STROBE_SPAN_FACTOR); > } > > -/** > - * ov9282_set_ctrl() - Set subdevice control > - * @ctrl: pointer to v4l2_ctrl structure > - * > - * Supported controls: > - * - V4L2_CID_VBLANK > - * - cluster controls: > - * - V4L2_CID_ANALOGUE_GAIN > - * - V4L2_CID_EXPOSURE > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_set_ctrl(struct v4l2_ctrl *ctrl) > { > struct ov9282 *ov9282 = > @@ -704,14 +692,6 @@ static const struct v4l2_ctrl_ops ov9282_ctrl_ops = { > .try_ctrl = ov9282_try_ctrl, > }; > > -/** > - * ov9282_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes > - * @sd: pointer to ov9282 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @code: V4L2 sub-device code enumeration need to be filled > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_mbus_code_enum *code) > @@ -780,14 +760,6 @@ static void ov9282_fill_pad_format(struct ov9282 *ov9282, > fmt->format.xfer_func = V4L2_XFER_FUNC_NONE; > } > > -/** > - * ov9282_get_pad_format() - Get subdevice pad format > - * @sd: pointer to ov9282 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_get_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -807,14 +779,6 @@ static int ov9282_get_pad_format(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * ov9282_set_pad_format() - Set subdevice pad format > - * @sd: pointer to ov9282 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * @fmt: V4L2 sub-device format need to be set > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -852,13 +816,6 @@ static int ov9282_set_pad_format(struct v4l2_subdev *sd, > return ret; > } > > -/** > - * ov9282_init_state() - Initialize sub-device state > - * @sd: pointer to ov9282 V4L2 sub-device structure > - * @sd_state: V4L2 sub-device configuration > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_init_state(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state) > { > @@ -1157,12 +1114,6 @@ static const struct v4l2_subdev_internal_ops ov9282_internal_ops = { > .init_state = ov9282_init_state, > }; > > -/** > - * ov9282_power_on() - Sensor power on sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_power_on(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1206,12 +1157,6 @@ static int ov9282_power_on(struct device *dev) > return ret; > } > > -/** > - * ov9282_power_off() - Sensor power off sequence > - * @dev: pointer to i2c device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_power_off(struct device *dev) > { > struct v4l2_subdev *sd = dev_get_drvdata(dev); > @@ -1333,12 +1278,6 @@ static int ov9282_init_controls(struct ov9282 *ov9282) > return 0; > } > > -/** > - * ov9282_probe() - I2C client device binding > - * @client: pointer to i2c client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static int ov9282_probe(struct i2c_client *client) > { > struct ov9282 *ov9282; > @@ -1435,12 +1374,6 @@ static int ov9282_probe(struct i2c_client *client) > return ret; > } > > -/** > - * ov9282_remove() - I2C client device unbinding > - * @client: pointer to I2C client device > - * > - * Return: 0 if successful, error code otherwise. > - */ > static void ov9282_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 13/29] media: tvp514x: Remove redundant kernel-doc comments 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (11 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 12/29] media: ov9282: " Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 9:08 ` Jacopo Mondi 2026-04-16 14:28 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 14/29] media: Documentation: Improve LINK_FREQ documentation Sakari Ailus ` (15 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Remove kernel-doc comments from regular callback functions. These comments have no information value. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/tvp514x.c | 55 +------------------------------------ 1 file changed, 1 insertion(+), 54 deletions(-) diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c index f9c9c80c33ac..7af8f37646d6 100644 --- a/drivers/media/i2c/tvp514x.c +++ b/drivers/media/i2c/tvp514x.c @@ -686,13 +686,6 @@ static int tvp514x_s_routing(struct v4l2_subdev *sd, return 0; } -/** - * tvp514x_s_ctrl() - V4L2 decoder interface handler for s_ctrl - * @ctrl: pointer to v4l2_ctrl structure - * - * If the requested control is supported, sets the control's current - * value in HW. Otherwise, returns -EINVAL if the control is not supported. - */ static int tvp514x_s_ctrl(struct v4l2_ctrl *ctrl) { struct v4l2_subdev *sd = to_sd(ctrl); @@ -789,13 +782,6 @@ tvp514x_set_frame_interval(struct v4l2_subdev *sd, return 0; } -/** - * tvp514x_s_stream() - V4L2 decoder i/f handler for s_stream - * @sd: pointer to standard V4L2 sub-device structure - * @enable: streaming enable or disable - * - * Sets streaming to enable or disable, if possible. - */ static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable) { int err = 0; @@ -850,14 +836,6 @@ static const struct v4l2_ctrl_ops tvp514x_ctrl_ops = { .s_ctrl = tvp514x_s_ctrl, }; -/** - * tvp514x_enum_mbus_code() - V4L2 decoder interface handler for enum_mbus_code - * @sd: pointer to standard V4L2 sub-device structure - * @sd_state: subdev state - * @code: pointer to v4l2_subdev_mbus_code_enum structure - * - * Enumertaes mbus codes supported - */ static int tvp514x_enum_mbus_code(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_mbus_code_enum *code) @@ -877,14 +855,6 @@ static int tvp514x_enum_mbus_code(struct v4l2_subdev *sd, return 0; } -/** - * tvp514x_get_pad_format() - V4L2 decoder interface handler for get pad format - * @sd: pointer to standard V4L2 sub-device structure - * @sd_state: subdev state - * @format: pointer to v4l2_subdev_format structure - * - * Retrieves pad format which is active or tried based on requirement - */ static int tvp514x_get_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) @@ -909,14 +879,6 @@ static int tvp514x_get_pad_format(struct v4l2_subdev *sd, return 0; } -/** - * tvp514x_set_pad_format() - V4L2 decoder interface handler for set pad format - * @sd: pointer to standard V4L2 sub-device structure - * @sd_state: subdev state - * @fmt: pointer to v4l2_subdev_format structure - * - * Set pad format for the output pad - */ static int tvp514x_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) @@ -1014,15 +976,7 @@ tvp514x_get_pdata(struct i2c_client *client) return pdata; } -/** - * tvp514x_probe() - decoder driver i2c probe handler - * @client: i2c driver client device structure - * - * Register decoder as an i2c client device and V4L2 - * device. - */ -static int -tvp514x_probe(struct i2c_client *client) +static int tvp514x_probe(struct i2c_client *client) { struct tvp514x_platform_data *pdata = tvp514x_get_pdata(client); struct tvp514x_decoder *decoder; @@ -1113,13 +1067,6 @@ tvp514x_probe(struct i2c_client *client) return ret; } -/** - * tvp514x_remove() - decoder driver i2c remove handler - * @client: i2c driver client device structure - * - * Unregister decoder as an i2c client device and V4L2 - * device. Complement of tvp514x_probe(). - */ static void tvp514x_remove(struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 13/29] media: tvp514x: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 13/29] media: tvp514x: " Sakari Ailus @ 2026-04-10 9:08 ` Jacopo Mondi 2026-04-16 14:28 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 9:08 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:22PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These comments > have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/i2c/tvp514x.c | 55 +------------------------------------ > 1 file changed, 1 insertion(+), 54 deletions(-) > > diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c > index f9c9c80c33ac..7af8f37646d6 100644 > --- a/drivers/media/i2c/tvp514x.c > +++ b/drivers/media/i2c/tvp514x.c > @@ -686,13 +686,6 @@ static int tvp514x_s_routing(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * tvp514x_s_ctrl() - V4L2 decoder interface handler for s_ctrl > - * @ctrl: pointer to v4l2_ctrl structure > - * > - * If the requested control is supported, sets the control's current > - * value in HW. Otherwise, returns -EINVAL if the control is not supported. > - */ > static int tvp514x_s_ctrl(struct v4l2_ctrl *ctrl) > { > struct v4l2_subdev *sd = to_sd(ctrl); > @@ -789,13 +782,6 @@ tvp514x_set_frame_interval(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * tvp514x_s_stream() - V4L2 decoder i/f handler for s_stream > - * @sd: pointer to standard V4L2 sub-device structure > - * @enable: streaming enable or disable > - * > - * Sets streaming to enable or disable, if possible. > - */ > static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable) > { > int err = 0; > @@ -850,14 +836,6 @@ static const struct v4l2_ctrl_ops tvp514x_ctrl_ops = { > .s_ctrl = tvp514x_s_ctrl, > }; > > -/** > - * tvp514x_enum_mbus_code() - V4L2 decoder interface handler for enum_mbus_code > - * @sd: pointer to standard V4L2 sub-device structure > - * @sd_state: subdev state > - * @code: pointer to v4l2_subdev_mbus_code_enum structure > - * > - * Enumertaes mbus codes supported > - */ > static int tvp514x_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_mbus_code_enum *code) > @@ -877,14 +855,6 @@ static int tvp514x_enum_mbus_code(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * tvp514x_get_pad_format() - V4L2 decoder interface handler for get pad format > - * @sd: pointer to standard V4L2 sub-device structure > - * @sd_state: subdev state > - * @format: pointer to v4l2_subdev_format structure > - * > - * Retrieves pad format which is active or tried based on requirement > - */ > static int tvp514x_get_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *format) > @@ -909,14 +879,6 @@ static int tvp514x_get_pad_format(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * tvp514x_set_pad_format() - V4L2 decoder interface handler for set pad format > - * @sd: pointer to standard V4L2 sub-device structure > - * @sd_state: subdev state > - * @fmt: pointer to v4l2_subdev_format structure > - * > - * Set pad format for the output pad > - */ > static int tvp514x_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -1014,15 +976,7 @@ tvp514x_get_pdata(struct i2c_client *client) > return pdata; > } > > -/** > - * tvp514x_probe() - decoder driver i2c probe handler > - * @client: i2c driver client device structure > - * > - * Register decoder as an i2c client device and V4L2 > - * device. > - */ > -static int > -tvp514x_probe(struct i2c_client *client) > +static int tvp514x_probe(struct i2c_client *client) > { > struct tvp514x_platform_data *pdata = tvp514x_get_pdata(client); > struct tvp514x_decoder *decoder; > @@ -1113,13 +1067,6 @@ tvp514x_probe(struct i2c_client *client) > return ret; > } > > -/** > - * tvp514x_remove() - decoder driver i2c remove handler > - * @client: i2c driver client device structure > - * > - * Unregister decoder as an i2c client device and V4L2 > - * device. Complement of tvp514x_probe(). > - */ > static void tvp514x_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 13/29] media: tvp514x: Remove redundant kernel-doc comments 2026-04-08 15:39 ` [PATCH v4 13/29] media: tvp514x: " Sakari Ailus 2026-04-10 9:08 ` Jacopo Mondi @ 2026-04-16 14:28 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 14:28 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:22PM +0300, Sakari Ailus wrote: > Remove kernel-doc comments from regular callback functions. These comments > have no information value. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/media/i2c/tvp514x.c | 55 +------------------------------------ > 1 file changed, 1 insertion(+), 54 deletions(-) > > diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c > index f9c9c80c33ac..7af8f37646d6 100644 > --- a/drivers/media/i2c/tvp514x.c > +++ b/drivers/media/i2c/tvp514x.c > @@ -686,13 +686,6 @@ static int tvp514x_s_routing(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * tvp514x_s_ctrl() - V4L2 decoder interface handler for s_ctrl > - * @ctrl: pointer to v4l2_ctrl structure > - * > - * If the requested control is supported, sets the control's current > - * value in HW. Otherwise, returns -EINVAL if the control is not supported. > - */ > static int tvp514x_s_ctrl(struct v4l2_ctrl *ctrl) > { > struct v4l2_subdev *sd = to_sd(ctrl); > @@ -789,13 +782,6 @@ tvp514x_set_frame_interval(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * tvp514x_s_stream() - V4L2 decoder i/f handler for s_stream > - * @sd: pointer to standard V4L2 sub-device structure > - * @enable: streaming enable or disable > - * > - * Sets streaming to enable or disable, if possible. > - */ > static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable) > { > int err = 0; > @@ -850,14 +836,6 @@ static const struct v4l2_ctrl_ops tvp514x_ctrl_ops = { > .s_ctrl = tvp514x_s_ctrl, > }; > > -/** > - * tvp514x_enum_mbus_code() - V4L2 decoder interface handler for enum_mbus_code > - * @sd: pointer to standard V4L2 sub-device structure > - * @sd_state: subdev state > - * @code: pointer to v4l2_subdev_mbus_code_enum structure > - * > - * Enumertaes mbus codes supported > - */ > static int tvp514x_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_mbus_code_enum *code) > @@ -877,14 +855,6 @@ static int tvp514x_enum_mbus_code(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * tvp514x_get_pad_format() - V4L2 decoder interface handler for get pad format > - * @sd: pointer to standard V4L2 sub-device structure > - * @sd_state: subdev state > - * @format: pointer to v4l2_subdev_format structure > - * > - * Retrieves pad format which is active or tried based on requirement > - */ > static int tvp514x_get_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *format) > @@ -909,14 +879,6 @@ static int tvp514x_get_pad_format(struct v4l2_subdev *sd, > return 0; > } > > -/** > - * tvp514x_set_pad_format() - V4L2 decoder interface handler for set pad format > - * @sd: pointer to standard V4L2 sub-device structure > - * @sd_state: subdev state > - * @fmt: pointer to v4l2_subdev_format structure > - * > - * Set pad format for the output pad > - */ > static int tvp514x_set_pad_format(struct v4l2_subdev *sd, > struct v4l2_subdev_state *sd_state, > struct v4l2_subdev_format *fmt) > @@ -1014,15 +976,7 @@ tvp514x_get_pdata(struct i2c_client *client) > return pdata; > } > > -/** > - * tvp514x_probe() - decoder driver i2c probe handler > - * @client: i2c driver client device structure > - * > - * Register decoder as an i2c client device and V4L2 > - * device. > - */ > -static int > -tvp514x_probe(struct i2c_client *client) > +static int tvp514x_probe(struct i2c_client *client) > { > struct tvp514x_platform_data *pdata = tvp514x_get_pdata(client); > struct tvp514x_decoder *decoder; > @@ -1113,13 +1067,6 @@ tvp514x_probe(struct i2c_client *client) > return ret; > } > > -/** > - * tvp514x_remove() - decoder driver i2c remove handler > - * @client: i2c driver client device structure > - * > - * Unregister decoder as an i2c client device and V4L2 > - * device. Complement of tvp514x_probe(). > - */ > static void tvp514x_remove(struct i2c_client *client) > { > struct v4l2_subdev *sd = i2c_get_clientdata(client); -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 14/29] media: Documentation: Improve LINK_FREQ documentation 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (12 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 13/29] media: tvp514x: " Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-16 15:05 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 15/29] media: Documentation: Improve pixel rate calculation documentation Sakari Ailus ` (14 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Add a reference to the LINK_FREQ control and clarify the meaning of the control as for C-PHY the matter is less obvious. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> --- Documentation/driver-api/media/tx-rx.rst | 3 ++- .../userspace-api/media/v4l/ext-ctrls-image-process.rst | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/driver-api/media/tx-rx.rst b/Documentation/driver-api/media/tx-rx.rst index 22e1b13ecde9..7df2407817b3 100644 --- a/Documentation/driver-api/media/tx-rx.rst +++ b/Documentation/driver-api/media/tx-rx.rst @@ -93,7 +93,8 @@ where * - variable or constant - description * - link_freq - - The value of the ``V4L2_CID_LINK_FREQ`` integer64 menu item. + - The value of the :ref:`V4L2_CID_LINK_FREQ <v4l2-cid-link-freq>` integer64 + menu item. * - nr_of_lanes - Number of data lanes used on the CSI-2 link. * - 2 diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst index 6d516f041ca2..ee88933256dd 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst @@ -24,7 +24,9 @@ Image Process Control IDs .. _v4l2-cid-link-freq: ``V4L2_CID_LINK_FREQ (integer menu)`` - The frequency of the data bus (e.g. parallel or CSI-2). + The fundamental frequency of the operating symbol rate (serial interfaces + such as CSI-2) or the sampling rate (parallel interfaces such as DVP or + Bt.565) of the data interface. .. _v4l2-cid-pixel-rate: -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 14/29] media: Documentation: Improve LINK_FREQ documentation 2026-04-08 15:39 ` [PATCH v4 14/29] media: Documentation: Improve LINK_FREQ documentation Sakari Ailus @ 2026-04-16 15:05 ` Laurent Pinchart 2026-04-21 14:42 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 15:05 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:23PM +0300, Sakari Ailus wrote: > Add a reference to the LINK_FREQ control and clarify the meaning of the > control as for C-PHY the matter is less obvious. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > Documentation/driver-api/media/tx-rx.rst | 3 ++- > .../userspace-api/media/v4l/ext-ctrls-image-process.rst | 4 +++- > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/Documentation/driver-api/media/tx-rx.rst b/Documentation/driver-api/media/tx-rx.rst > index 22e1b13ecde9..7df2407817b3 100644 > --- a/Documentation/driver-api/media/tx-rx.rst > +++ b/Documentation/driver-api/media/tx-rx.rst > @@ -93,7 +93,8 @@ where > * - variable or constant > - description > * - link_freq > - - The value of the ``V4L2_CID_LINK_FREQ`` integer64 menu item. > + - The value of the :ref:`V4L2_CID_LINK_FREQ <v4l2-cid-link-freq>` integer64 > + menu item. > * - nr_of_lanes > - Number of data lanes used on the CSI-2 link. > * - 2 > diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst > index 6d516f041ca2..ee88933256dd 100644 > --- a/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst > +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst > @@ -24,7 +24,9 @@ Image Process Control IDs > .. _v4l2-cid-link-freq: > > ``V4L2_CID_LINK_FREQ (integer menu)`` > - The frequency of the data bus (e.g. parallel or CSI-2). > + The fundamental frequency of the operating symbol rate (serial interfaces While this is absolutely correct, I think it will confuse most readers more than the existing text. Do you think that mentioning that, for CSI-2, the frequency is equal to 1 / (2 * UI) would help ? > + such as CSI-2) or the sampling rate (parallel interfaces such as DVP or > + Bt.565) of the data interface. > > .. _v4l2-cid-pixel-rate: > -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 14/29] media: Documentation: Improve LINK_FREQ documentation 2026-04-16 15:05 ` Laurent Pinchart @ 2026-04-21 14:42 ` Sakari Ailus 0 siblings, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-21 14:42 UTC (permalink / raw) To: Laurent Pinchart Cc: linux-media, hans, 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, André 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 Hi Laurent, On Thu, Apr 16, 2026 at 06:05:03PM +0300, Laurent Pinchart wrote: > On Wed, Apr 08, 2026 at 06:39:23PM +0300, Sakari Ailus wrote: > > Add a reference to the LINK_FREQ control and clarify the meaning of the > > control as for C-PHY the matter is less obvious. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > --- > > Documentation/driver-api/media/tx-rx.rst | 3 ++- > > .../userspace-api/media/v4l/ext-ctrls-image-process.rst | 4 +++- > > 2 files changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/driver-api/media/tx-rx.rst b/Documentation/driver-api/media/tx-rx.rst > > index 22e1b13ecde9..7df2407817b3 100644 > > --- a/Documentation/driver-api/media/tx-rx.rst > > +++ b/Documentation/driver-api/media/tx-rx.rst > > @@ -93,7 +93,8 @@ where > > * - variable or constant > > - description > > * - link_freq > > - - The value of the ``V4L2_CID_LINK_FREQ`` integer64 menu item. > > + - The value of the :ref:`V4L2_CID_LINK_FREQ <v4l2-cid-link-freq>` integer64 > > + menu item. > > * - nr_of_lanes > > - Number of data lanes used on the CSI-2 link. > > * - 2 > > diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst > > index 6d516f041ca2..ee88933256dd 100644 > > --- a/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst > > +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst > > @@ -24,7 +24,9 @@ Image Process Control IDs > > .. _v4l2-cid-link-freq: > > > > ``V4L2_CID_LINK_FREQ (integer menu)`` > > - The frequency of the data bus (e.g. parallel or CSI-2). > > + The fundamental frequency of the operating symbol rate (serial interfaces > > While this is absolutely correct, I think it will confuse most readers > more than the existing text. Do you think that mentioning that, for > CSI-2, the frequency is equal to 1 / (2 * UI) would help ? I'll add that for v5. > > > + such as CSI-2) or the sampling rate (parallel interfaces such as DVP or > > + Bt.565) of the data interface. > > > > .. _v4l2-cid-pixel-rate: > > > -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 15/29] media: Documentation: Improve pixel rate calculation documentation 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (13 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 14/29] media: Documentation: Improve LINK_FREQ documentation Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-16 16:20 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 16/29] media: v4l2-subdev: Refactor returning routes Sakari Ailus ` (13 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Improve documentation on calculating the pixel rate, by adding references to relevant functions and mentioning V4L2 fwnode endpoint instead of OF endpoint. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> --- Documentation/driver-api/media/tx-rx.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/driver-api/media/tx-rx.rst b/Documentation/driver-api/media/tx-rx.rst index 7df2407817b3..9b231fa0216a 100644 --- a/Documentation/driver-api/media/tx-rx.rst +++ b/Documentation/driver-api/media/tx-rx.rst @@ -104,7 +104,11 @@ where * - k - 16 for D-PHY and 7 for C-PHY. -Information on whether D-PHY or C-PHY is used, and the value of ``nr_of_lanes``, can be obtained from the OF endpoint configuration. +Information on whether D-PHY or C-PHY is used as well as the value of +``nr_of_lanes`` can be obtained from the V4L2 endpoint configuration; see +:c:func:`v4l2_fwnode_endpoint_alloc_parse()`, +:c:func:`v4l2_fwnode_endpoint_parse()` and +:c:func:`v4l2_get_active_data_lanes()`. .. note:: -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 15/29] media: Documentation: Improve pixel rate calculation documentation 2026-04-08 15:39 ` [PATCH v4 15/29] media: Documentation: Improve pixel rate calculation documentation Sakari Ailus @ 2026-04-16 16:20 ` Laurent Pinchart 0 siblings, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 16:20 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:24PM +0300, Sakari Ailus wrote: > Improve documentation on calculating the pixel rate, by adding references > to relevant functions and mentioning V4L2 fwnode endpoint instead of OF > endpoint. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > Documentation/driver-api/media/tx-rx.rst | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/Documentation/driver-api/media/tx-rx.rst b/Documentation/driver-api/media/tx-rx.rst > index 7df2407817b3..9b231fa0216a 100644 > --- a/Documentation/driver-api/media/tx-rx.rst > +++ b/Documentation/driver-api/media/tx-rx.rst > @@ -104,7 +104,11 @@ where > * - k > - 16 for D-PHY and 7 for C-PHY. > > -Information on whether D-PHY or C-PHY is used, and the value of ``nr_of_lanes``, can be obtained from the OF endpoint configuration. > +Information on whether D-PHY or C-PHY is used as well as the value of > +``nr_of_lanes`` can be obtained from the V4L2 endpoint configuration; see > +:c:func:`v4l2_fwnode_endpoint_alloc_parse()`, > +:c:func:`v4l2_fwnode_endpoint_parse()` and > +:c:func:`v4l2_get_active_data_lanes()`. Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > .. note:: -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 16/29] media: v4l2-subdev: Refactor returning routes 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (14 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 15/29] media: Documentation: Improve pixel rate calculation documentation Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-16 16:24 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 17/29] media: v4l2-subdev: Allow accessing routes with STREAMS client capability Sakari Ailus ` (12 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Refactor returning the routes by adding a new function that essentially does a memcopy and sets the number of the routes in the routing table. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Michael Riesch <michael.riesch@collabora.com> --- drivers/media/v4l2-core/v4l2-subdev.c | 34 +++++++++++++-------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index 831c69c958b8..f8fde395a53a 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -629,6 +629,19 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, v4l2_subdev_get_unlocked_active_state(sd); } +static void copy_routes_state_to_routing(struct v4l2_subdev_routing *routing, + const struct v4l2_subdev_state *state) +{ + struct v4l2_subdev_route *routes = + (struct v4l2_subdev_route *)(uintptr_t)routing->routes; + u32 copy_routes = min(routing->len_routes, state->routing.num_routes); + + for (u32 i = 0; i < copy_routes; i++) + routes[i] = state->routing.routes[i]; + + routing->num_routes = state->routing.num_routes; +} + static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, struct v4l2_subdev_state *state) { @@ -1000,7 +1013,6 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, case VIDIOC_SUBDEV_G_ROUTING: { struct v4l2_subdev_routing *routing = arg; - struct v4l2_subdev_krouting *krouting; if (!v4l2_subdev_enable_streams_api) return -ENOIOCTLCMD; @@ -1010,13 +1022,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, memset(routing->reserved, 0, sizeof(routing->reserved)); - krouting = &state->routing; - - memcpy((struct v4l2_subdev_route *)(uintptr_t)routing->routes, - krouting->routes, - min(krouting->num_routes, routing->len_routes) * - sizeof(*krouting->routes)); - routing->num_routes = krouting->num_routes; + copy_routes_state_to_routing(routing, state); return 0; } @@ -1084,11 +1090,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, * the routing table. */ if (!v4l2_subdev_has_op(sd, pad, set_routing)) { - memcpy((struct v4l2_subdev_route *)(uintptr_t)routing->routes, - state->routing.routes, - min(state->routing.num_routes, routing->len_routes) * - sizeof(*state->routing.routes)); - routing->num_routes = state->routing.num_routes; + copy_routes_state_to_routing(routing, state); return 0; } @@ -1102,11 +1104,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, if (rval < 0) return rval; - memcpy((struct v4l2_subdev_route *)(uintptr_t)routing->routes, - state->routing.routes, - min(state->routing.num_routes, routing->len_routes) * - sizeof(*state->routing.routes)); - routing->num_routes = state->routing.num_routes; + copy_routes_state_to_routing(routing, state); return 0; } -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 16/29] media: v4l2-subdev: Refactor returning routes 2026-04-08 15:39 ` [PATCH v4 16/29] media: v4l2-subdev: Refactor returning routes Sakari Ailus @ 2026-04-16 16:24 ` Laurent Pinchart 2026-04-21 14:50 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 16:24 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 Hi Sakari, Thank you for the patch. On Wed, Apr 08, 2026 at 06:39:25PM +0300, Sakari Ailus wrote: > Refactor returning the routes by adding a new function that essentially > does a memcopy and sets the number of the routes in the routing table. I'd write "factor out" instead of "refactor", here and in the subject line. Then you can add This avoids code duplication. > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> > --- > drivers/media/v4l2-core/v4l2-subdev.c | 34 +++++++++++++-------------- > 1 file changed, 16 insertions(+), 18 deletions(-) > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > index 831c69c958b8..f8fde395a53a 100644 > --- a/drivers/media/v4l2-core/v4l2-subdev.c > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > @@ -629,6 +629,19 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, > v4l2_subdev_get_unlocked_active_state(sd); > } > > +static void copy_routes_state_to_routing(struct v4l2_subdev_routing *routing, > + const struct v4l2_subdev_state *state) v4l2_subdev_ prefix. > +{ > + struct v4l2_subdev_route *routes = > + (struct v4l2_subdev_route *)(uintptr_t)routing->routes; > + u32 copy_routes = min(routing->len_routes, state->routing.num_routes); > + > + for (u32 i = 0; i < copy_routes; i++) > + routes[i] = state->routing.routes[i]; Any reason you use a loop instead of memcpy() ? If so, please document it in the commit message. With all that addressed, Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > + > + routing->num_routes = state->routing.num_routes; > +} > + > static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > struct v4l2_subdev_state *state) > { > @@ -1000,7 +1013,6 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > case VIDIOC_SUBDEV_G_ROUTING: { > struct v4l2_subdev_routing *routing = arg; > - struct v4l2_subdev_krouting *krouting; > > if (!v4l2_subdev_enable_streams_api) > return -ENOIOCTLCMD; > @@ -1010,13 +1022,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > memset(routing->reserved, 0, sizeof(routing->reserved)); > > - krouting = &state->routing; > - > - memcpy((struct v4l2_subdev_route *)(uintptr_t)routing->routes, > - krouting->routes, > - min(krouting->num_routes, routing->len_routes) * > - sizeof(*krouting->routes)); > - routing->num_routes = krouting->num_routes; > + copy_routes_state_to_routing(routing, state); > > return 0; > } > @@ -1084,11 +1090,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > * the routing table. > */ > if (!v4l2_subdev_has_op(sd, pad, set_routing)) { > - memcpy((struct v4l2_subdev_route *)(uintptr_t)routing->routes, > - state->routing.routes, > - min(state->routing.num_routes, routing->len_routes) * > - sizeof(*state->routing.routes)); > - routing->num_routes = state->routing.num_routes; > + copy_routes_state_to_routing(routing, state); > > return 0; > } > @@ -1102,11 +1104,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > if (rval < 0) > return rval; > > - memcpy((struct v4l2_subdev_route *)(uintptr_t)routing->routes, > - state->routing.routes, > - min(state->routing.num_routes, routing->len_routes) * > - sizeof(*state->routing.routes)); > - routing->num_routes = state->routing.num_routes; > + copy_routes_state_to_routing(routing, state); > > return 0; > } -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 16/29] media: v4l2-subdev: Refactor returning routes 2026-04-16 16:24 ` Laurent Pinchart @ 2026-04-21 14:50 ` Sakari Ailus 0 siblings, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-21 14:50 UTC (permalink / raw) To: Laurent Pinchart Cc: linux-media, hans, 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, André 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 Hi Laurent, On Thu, Apr 16, 2026 at 07:24:15PM +0300, Laurent Pinchart wrote: > Hi Sakari, > > Thank you for the patch. > > On Wed, Apr 08, 2026 at 06:39:25PM +0300, Sakari Ailus wrote: > > Refactor returning the routes by adding a new function that essentially > > does a memcopy and sets the number of the routes in the routing table. > > I'd write "factor out" instead of "refactor", here and in the subject > line. Then you can add > > This avoids code duplication. > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> > > --- > > drivers/media/v4l2-core/v4l2-subdev.c | 34 +++++++++++++-------------- > > 1 file changed, 16 insertions(+), 18 deletions(-) > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > index 831c69c958b8..f8fde395a53a 100644 > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > @@ -629,6 +629,19 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, > > v4l2_subdev_get_unlocked_active_state(sd); > > } > > > > +static void copy_routes_state_to_routing(struct v4l2_subdev_routing *routing, > > + const struct v4l2_subdev_state *state) > > v4l2_subdev_ prefix. I'll call it v4l2_subdev_copy_routes(). > > > +{ > > + struct v4l2_subdev_route *routes = > > + (struct v4l2_subdev_route *)(uintptr_t)routing->routes; > > + u32 copy_routes = min(routing->len_routes, state->routing.num_routes); > > + > > + for (u32 i = 0; i < copy_routes; i++) > > + routes[i] = state->routing.routes[i]; > > Any reason you use a loop instead of memcpy() ? If so, please document > it in the commit message. I'll switch to memcpy(). > > With all that addressed, > > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Thank you. -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 17/29] media: v4l2-subdev: Allow accessing routes with STREAMS client capability 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (15 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 16/29] media: v4l2-subdev: Refactor returning routes Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-16 15:06 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() Sakari Ailus ` (11 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Disable access to routes when the STREAMS client capability bit isn't set. Routes aren't relevant otherwise anyway. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> Reviewed-by: Michael Riesch <michael.riesch@collabora.com> --- drivers/media/v4l2-core/v4l2-subdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index f8fde395a53a..647587c0499a 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -1020,6 +1020,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS)) return -ENOIOCTLCMD; + if (!client_supports_streams) + return -EINVAL; + memset(routing->reserved, 0, sizeof(routing->reserved)); copy_routes_state_to_routing(routing, state); @@ -1041,6 +1044,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS)) return -ENOIOCTLCMD; + if (!client_supports_streams) + return -EINVAL; + if (routing->which != V4L2_SUBDEV_FORMAT_TRY && ro_subdev) return -EPERM; -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 17/29] media: v4l2-subdev: Allow accessing routes with STREAMS client capability 2026-04-08 15:39 ` [PATCH v4 17/29] media: v4l2-subdev: Allow accessing routes with STREAMS client capability Sakari Ailus @ 2026-04-16 15:06 ` Laurent Pinchart 0 siblings, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 15:06 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:26PM +0300, Sakari Ailus wrote: > Disable access to routes when the STREAMS client capability bit isn't set. > Routes aren't relevant otherwise anyway. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/media/v4l2-core/v4l2-subdev.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > index f8fde395a53a..647587c0499a 100644 > --- a/drivers/media/v4l2-core/v4l2-subdev.c > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > @@ -1020,6 +1020,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS)) > return -ENOIOCTLCMD; > > + if (!client_supports_streams) > + return -EINVAL; > + > memset(routing->reserved, 0, sizeof(routing->reserved)); > > copy_routes_state_to_routing(routing, state); > @@ -1041,6 +1044,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS)) > return -ENOIOCTLCMD; > > + if (!client_supports_streams) > + return -EINVAL; > + > if (routing->which != V4L2_SUBDEV_FORMAT_TRY && ro_subdev) > return -EPERM; > -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (16 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 17/29] media: v4l2-subdev: Allow accessing routes with STREAMS client capability Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 9:26 ` Jacopo Mondi 2026-04-16 14:35 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 19/29] media: mc: Separate single link validation into a new function Sakari Ailus ` (10 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 There are two conditions checking the ENABLED link flag in the loop going through the links related to an entity. Drop the other one and simplify the remaining code. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Michael Riesch <michael.riesch@collabora.com> --- drivers/media/mc/mc-entity.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index 3fa0bc687851..6bf4730b89d2 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -838,17 +838,16 @@ __must_check int __media_pipeline_start(struct media_pad *origin, if (link->sink != pad && link->source != pad) continue; - /* Record if the pad has links and enabled links. */ - if (link->flags & MEDIA_LNK_FL_ENABLED) - has_enabled_link = true; - /* - * Validate the link if it's enabled and has the - * current pad as its sink. + * Ensure the link is enabled and if so, record + * it. Proceed to the next link if the current pad isn't + * the sink pad of the link. */ if (!(link->flags & MEDIA_LNK_FL_ENABLED)) continue; + has_enabled_link = true; + if (link->sink != pad) continue; -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() 2026-04-08 15:39 ` [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() Sakari Ailus @ 2026-04-10 9:26 ` Jacopo Mondi 2026-04-16 14:35 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 9:26 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:27PM +0300, Sakari Ailus wrote: > There are two conditions checking the ENABLED link flag in the loop > going through the links related to an entity. Drop the other one and > simplify the remaining code. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/mc/mc-entity.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > index 3fa0bc687851..6bf4730b89d2 100644 > --- a/drivers/media/mc/mc-entity.c > +++ b/drivers/media/mc/mc-entity.c > @@ -838,17 +838,16 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > if (link->sink != pad && link->source != pad) > continue; > > - /* Record if the pad has links and enabled links. */ > - if (link->flags & MEDIA_LNK_FL_ENABLED) > - has_enabled_link = true; > - > /* > - * Validate the link if it's enabled and has the > - * current pad as its sink. > + * Ensure the link is enabled and if so, record > + * it. Proceed to the next link if the current pad isn't > + * the sink pad of the link. > */ > if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > continue; > > + has_enabled_link = true; > + > if (link->sink != pad) > continue; > > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() 2026-04-08 15:39 ` [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() Sakari Ailus 2026-04-10 9:26 ` Jacopo Mondi @ 2026-04-16 14:35 ` Laurent Pinchart 2026-04-21 10:24 ` Sakari Ailus 1 sibling, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 14:35 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 Hi Sakari, Thank you for the patch. On Wed, Apr 08, 2026 at 06:39:27PM +0300, Sakari Ailus wrote: > There are two conditions checking the ENABLED link flag in the loop > going through the links related to an entity. Drop the other one and > simplify the remaining code. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> > --- > drivers/media/mc/mc-entity.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > index 3fa0bc687851..6bf4730b89d2 100644 > --- a/drivers/media/mc/mc-entity.c > +++ b/drivers/media/mc/mc-entity.c > @@ -838,17 +838,16 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > if (link->sink != pad && link->source != pad) > continue; > > - /* Record if the pad has links and enabled links. */ > - if (link->flags & MEDIA_LNK_FL_ENABLED) > - has_enabled_link = true; > - > /* > - * Validate the link if it's enabled and has the > - * current pad as its sink. > + * Ensure the link is enabled and if so, record > + * it. Proceed to the next link if the current pad isn't > + * the sink pad of the link. You can reflow this; * Ensure the link is enabled and if so, record it. * Proceed to the next link if the current pad isn't the * sink pad of the link. but I find the new comment confusing. I would keep the code as-is, I think it's more readable, and the compiler will deal with optimization. > */ > if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > continue; > > + has_enabled_link = true; > + > if (link->sink != pad) > continue; > -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() 2026-04-16 14:35 ` Laurent Pinchart @ 2026-04-21 10:24 ` Sakari Ailus 2026-04-21 11:18 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-21 10:24 UTC (permalink / raw) To: Laurent Pinchart Cc: linux-media, hans, 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, André 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 Hi Laurent, Thank you for the review. On Thu, Apr 16, 2026 at 05:35:24PM +0300, Laurent Pinchart wrote: > Hi Sakari, > > Thank you for the patch. > > On Wed, Apr 08, 2026 at 06:39:27PM +0300, Sakari Ailus wrote: > > There are two conditions checking the ENABLED link flag in the loop > > going through the links related to an entity. Drop the other one and > > simplify the remaining code. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> > > --- > > drivers/media/mc/mc-entity.c | 11 +++++------ > > 1 file changed, 5 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > > index 3fa0bc687851..6bf4730b89d2 100644 > > --- a/drivers/media/mc/mc-entity.c > > +++ b/drivers/media/mc/mc-entity.c > > @@ -838,17 +838,16 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > > if (link->sink != pad && link->source != pad) > > continue; > > > > - /* Record if the pad has links and enabled links. */ > > - if (link->flags & MEDIA_LNK_FL_ENABLED) > > - has_enabled_link = true; > > - > > /* > > - * Validate the link if it's enabled and has the > > - * current pad as its sink. > > + * Ensure the link is enabled and if so, record > > + * it. Proceed to the next link if the current pad isn't > > + * the sink pad of the link. > > You can reflow this; > > * Ensure the link is enabled and if so, record it. > * Proceed to the next link if the current pad isn't the > * sink pad of the link. > > but I find the new comment confusing. > > I would keep the code as-is, I think it's more readable, and the > compiler will deal with optimization. There's only one flag to test and I can't see how it'd be more readable to do that twice in the same location. I can keep the comment as-is if you prefer that. > > > */ > > if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > > continue; > > > > + has_enabled_link = true; > > + > > if (link->sink != pad) > > continue; > > > -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() 2026-04-21 10:24 ` Sakari Ailus @ 2026-04-21 11:18 ` Laurent Pinchart 2026-04-21 12:37 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-21 11:18 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Tue, Apr 21, 2026 at 01:24:16PM +0300, Sakari Ailus wrote: > On Thu, Apr 16, 2026 at 05:35:24PM +0300, Laurent Pinchart wrote: > > On Wed, Apr 08, 2026 at 06:39:27PM +0300, Sakari Ailus wrote: > > > There are two conditions checking the ENABLED link flag in the loop > > > going through the links related to an entity. Drop the other one and > > > simplify the remaining code. > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> > > > --- > > > drivers/media/mc/mc-entity.c | 11 +++++------ > > > 1 file changed, 5 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > > > index 3fa0bc687851..6bf4730b89d2 100644 > > > --- a/drivers/media/mc/mc-entity.c > > > +++ b/drivers/media/mc/mc-entity.c > > > @@ -838,17 +838,16 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > > > if (link->sink != pad && link->source != pad) > > > continue; > > > > > > - /* Record if the pad has links and enabled links. */ > > > - if (link->flags & MEDIA_LNK_FL_ENABLED) > > > - has_enabled_link = true; > > > - > > > /* > > > - * Validate the link if it's enabled and has the > > > - * current pad as its sink. > > > + * Ensure the link is enabled and if so, record > > > + * it. Proceed to the next link if the current pad isn't > > > + * the sink pad of the link. > > > > You can reflow this; > > > > * Ensure the link is enabled and if so, record it. > > * Proceed to the next link if the current pad isn't the > > * sink pad of the link. > > > > but I find the new comment confusing. > > > > I would keep the code as-is, I think it's more readable, and the > > compiler will deal with optimization. > > There's only one flag to test and I can't see how it'd be more readable to > do that twice in the same location. I can keep the comment as-is if you > prefer that. The flag is tested twice for two different purposes, with two separate comments. A subsequent patch in the series further modifies this code, and makes things less readable as it inserts code in the middle while still keeping a single comment to explain the multiple operations. I'm sure we could expand the comment to explain things in more details (and bikeshed how to do so), but I think it will still be less readable than keeping those two steps separate with one comment each. > > > */ > > > if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > > > continue; > > > > > > + has_enabled_link = true; > > > + > > > if (link->sink != pad) > > > continue; > > > -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() 2026-04-21 11:18 ` Laurent Pinchart @ 2026-04-21 12:37 ` Sakari Ailus 2026-04-21 22:10 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-21 12:37 UTC (permalink / raw) To: Laurent Pinchart Cc: linux-media, hans, 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, André 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 Hi Laurent, On Tue, Apr 21, 2026 at 02:18:25PM +0300, Laurent Pinchart wrote: > On Tue, Apr 21, 2026 at 01:24:16PM +0300, Sakari Ailus wrote: > > On Thu, Apr 16, 2026 at 05:35:24PM +0300, Laurent Pinchart wrote: > > > On Wed, Apr 08, 2026 at 06:39:27PM +0300, Sakari Ailus wrote: > > > > There are two conditions checking the ENABLED link flag in the loop > > > > going through the links related to an entity. Drop the other one and > > > > simplify the remaining code. > > > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> > > > > --- > > > > drivers/media/mc/mc-entity.c | 11 +++++------ > > > > 1 file changed, 5 insertions(+), 6 deletions(-) > > > > > > > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > > > > index 3fa0bc687851..6bf4730b89d2 100644 > > > > --- a/drivers/media/mc/mc-entity.c > > > > +++ b/drivers/media/mc/mc-entity.c > > > > @@ -838,17 +838,16 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > > > > if (link->sink != pad && link->source != pad) > > > > continue; > > > > > > > > - /* Record if the pad has links and enabled links. */ > > > > - if (link->flags & MEDIA_LNK_FL_ENABLED) > > > > - has_enabled_link = true; > > > > - > > > > /* > > > > - * Validate the link if it's enabled and has the > > > > - * current pad as its sink. > > > > + * Ensure the link is enabled and if so, record > > > > + * it. Proceed to the next link if the current pad isn't > > > > + * the sink pad of the link. > > > > > > You can reflow this; > > > > > > * Ensure the link is enabled and if so, record it. > > > * Proceed to the next link if the current pad isn't the > > > * sink pad of the link. > > > > > > but I find the new comment confusing. > > > > > > I would keep the code as-is, I think it's more readable, and the > > > compiler will deal with optimization. > > > > There's only one flag to test and I can't see how it'd be more readable to > > do that twice in the same location. I can keep the comment as-is if you > > prefer that. > > The flag is tested twice for two different purposes, with two separate > comments. A subsequent patch in the series further modifies this code, I believe the code wouldn't have looked like this if it wasn't written over several iterations. In other words, it was in a need of a cleanup this patch does. :-) I.e. first see if a link isn't enabled and if so, bail out. Otherwise the rest will proceed from there, the link being enabled being a condition for that, including marking that there was an enabled link. > and makes things less readable as it inserts code in the middle while > still keeping a single comment to explain the multiple operations. I'm If you look at the resulting media_pipeline_validate_one(), the flow is entirely reasonable and would not benefit from testing the enabled flag twice. I can add better comments on why what is being done is done. > sure we could expand the comment to explain things in more details (and > bikeshed how to do so), but I think it will still be less readable than > keeping those two steps separate with one comment each. > > > > > */ > > > > if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > > > > continue; > > > > > > > > + has_enabled_link = true; > > > > + > > > > if (link->sink != pad) > > > > continue; > > > > > -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() 2026-04-21 12:37 ` Sakari Ailus @ 2026-04-21 22:10 ` Laurent Pinchart 0 siblings, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-21 22:10 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Tue, Apr 21, 2026 at 03:37:18PM +0300, Sakari Ailus wrote: > On Tue, Apr 21, 2026 at 02:18:25PM +0300, Laurent Pinchart wrote: > > On Tue, Apr 21, 2026 at 01:24:16PM +0300, Sakari Ailus wrote: > > > On Thu, Apr 16, 2026 at 05:35:24PM +0300, Laurent Pinchart wrote: > > > > On Wed, Apr 08, 2026 at 06:39:27PM +0300, Sakari Ailus wrote: > > > > > There are two conditions checking the ENABLED link flag in the loop > > > > > going through the links related to an entity. Drop the other one and > > > > > simplify the remaining code. > > > > > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> > > > > > --- > > > > > drivers/media/mc/mc-entity.c | 11 +++++------ > > > > > 1 file changed, 5 insertions(+), 6 deletions(-) > > > > > > > > > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > > > > > index 3fa0bc687851..6bf4730b89d2 100644 > > > > > --- a/drivers/media/mc/mc-entity.c > > > > > +++ b/drivers/media/mc/mc-entity.c > > > > > @@ -838,17 +838,16 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > > > > > if (link->sink != pad && link->source != pad) > > > > > continue; > > > > > > > > > > - /* Record if the pad has links and enabled links. */ > > > > > - if (link->flags & MEDIA_LNK_FL_ENABLED) > > > > > - has_enabled_link = true; > > > > > - > > > > > /* > > > > > - * Validate the link if it's enabled and has the > > > > > - * current pad as its sink. > > > > > + * Ensure the link is enabled and if so, record > > > > > + * it. Proceed to the next link if the current pad isn't > > > > > + * the sink pad of the link. > > > > > > > > You can reflow this; > > > > > > > > * Ensure the link is enabled and if so, record it. > > > > * Proceed to the next link if the current pad isn't the > > > > * sink pad of the link. > > > > > > > > but I find the new comment confusing. > > > > > > > > I would keep the code as-is, I think it's more readable, and the > > > > compiler will deal with optimization. > > > > > > There's only one flag to test and I can't see how it'd be more readable to > > > do that twice in the same location. I can keep the comment as-is if you > > > prefer that. > > > > The flag is tested twice for two different purposes, with two separate > > comments. A subsequent patch in the series further modifies this code, > > I believe the code wouldn't have looked like this if it wasn't written over > several iterations. In other words, it was in a need of a cleanup this > patch does. :-) > > I.e. first see if a link isn't enabled and if so, bail out. Otherwise the > rest will proceed from there, the link being enabled being a condition for > that, including marking that there was an enabled link. First the code records if it has found an enabled link for the pad, and then it skips validating links that don't need to be validated, that is links that are disabled or links the originate from the current pad (as links are validated in the context of their sink, not their source). Those are two separate and unrelated operations (recording if there are enabled links, and skipping links that don't need to be validated), and each of them has its own comment block. This patch moves the first operation in the middle of the second (between the link->flags and the link->sink checks), which makes things harder to read, and harder to document. > > and makes things less readable as it inserts code in the middle while > > still keeping a single comment to explain the multiple operations. I'm > > If you look at the resulting media_pipeline_validate_one(), the flow is > entirely reasonable and would not benefit from testing the enabled flag > twice. I can add better comments on why what is being done is done. I looked at the function found the comment very confusing compared to the current code. I tried to write a better one and wasn't happy with the result. That's why I realized this patch should be dropped. You can try writing a better comment, but I want things to be absolutely crystal clear. That won't be easy with this modification of the code flow. As the current code is more readable, and the proposed change does not improve anything, I strongly think the best option is to drop this patch. > > sure we could expand the comment to explain things in more details (and > > bikeshed how to do so), but I think it will still be less readable than > > keeping those two steps separate with one comment each. > > > > > > > */ > > > > > if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > > > > > continue; > > > > > > > > > > + has_enabled_link = true; > > > > > + > > > > > if (link->sink != pad) > > > > > continue; > > > > > -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 19/29] media: mc: Separate single link validation into a new function 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (17 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 9:29 ` Jacopo Mondi 2026-04-16 16:35 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 20/29] media: uapi: Bump the STREAMS bit a little Sakari Ailus ` (9 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Add a new function __media_pipeline_validate_one() to validate a single link in a pipeline. This will soon be used for performing validation in multiple phases. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Michael Riesch <michael.riesch@collabora.com> --- drivers/media/mc/mc-entity.c | 74 ++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index 6bf4730b89d2..717569bd1a8c 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -768,6 +768,45 @@ static int media_pipeline_populate(struct media_pipeline *pipe, return ret; } +static int +__media_pipeline_validate_one(struct media_pad *origin, + struct media_pad *pad, struct media_link *link, + bool *has_enabled_link) +{ + struct media_device *mdev = origin->graph_obj.mdev; + struct media_entity *entity = pad->entity; + int ret; + + /* Return here if the link is disabled. */ + if (!(link->flags & MEDIA_LNK_FL_ENABLED)) + return 0; + + if (has_enabled_link) + *has_enabled_link = true; + + /* Skip validation if the current pad isn't the sink pad of the link. */ + if (link->sink != pad) + return 0; + + if (!entity->ops || !entity->ops->link_validate) + return 0; + + ret = entity->ops->link_validate(link); + if (ret) { + dev_dbg(mdev->dev, + "Link '%s':%u -> '%s':%u failed validation: %d\n", + link->source->entity->name, link->source->index, + link->sink->entity->name, link->sink->index, ret); + return ret; + } + + dev_dbg(mdev->dev, "Link '%s':%u -> '%s':%u is valid\n", + link->source->entity->name, link->source->index, + link->sink->entity->name, link->sink->index); + + return 0; +} + __must_check int __media_pipeline_start(struct media_pad *origin, struct media_pipeline *pipe) { @@ -838,39 +877,10 @@ __must_check int __media_pipeline_start(struct media_pad *origin, if (link->sink != pad && link->source != pad) continue; - /* - * Ensure the link is enabled and if so, record - * it. Proceed to the next link if the current pad isn't - * the sink pad of the link. - */ - if (!(link->flags & MEDIA_LNK_FL_ENABLED)) - continue; - - has_enabled_link = true; - - if (link->sink != pad) - continue; - - if (!entity->ops || !entity->ops->link_validate) - continue; - - ret = entity->ops->link_validate(link); - if (ret) { - dev_dbg(mdev->dev, - "Link '%s':%u -> '%s':%u failed validation: %d\n", - link->source->entity->name, - link->source->index, - link->sink->entity->name, - link->sink->index, ret); + ret = __media_pipeline_validate_one(origin, pad, link, + &has_enabled_link); + if (ret) goto error; - } - - dev_dbg(mdev->dev, - "Link '%s':%u -> '%s':%u is valid\n", - link->source->entity->name, - link->source->index, - link->sink->entity->name, - link->sink->index); } /* -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 19/29] media: mc: Separate single link validation into a new function 2026-04-08 15:39 ` [PATCH v4 19/29] media: mc: Separate single link validation into a new function Sakari Ailus @ 2026-04-10 9:29 ` Jacopo Mondi 2026-04-16 16:35 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 9:29 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:28PM +0300, Sakari Ailus wrote: > Add a new function __media_pipeline_validate_one() to validate a single > link in a pipeline. This will soon be used for performing validation in > multiple phases. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/mc/mc-entity.c | 74 ++++++++++++++++++++---------------- > 1 file changed, 42 insertions(+), 32 deletions(-) > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > index 6bf4730b89d2..717569bd1a8c 100644 > --- a/drivers/media/mc/mc-entity.c > +++ b/drivers/media/mc/mc-entity.c > @@ -768,6 +768,45 @@ static int media_pipeline_populate(struct media_pipeline *pipe, > return ret; > } > > +static int > +__media_pipeline_validate_one(struct media_pad *origin, > + struct media_pad *pad, struct media_link *link, > + bool *has_enabled_link) > +{ > + struct media_device *mdev = origin->graph_obj.mdev; > + struct media_entity *entity = pad->entity; > + int ret; > + > + /* Return here if the link is disabled. */ > + if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > + return 0; > + > + if (has_enabled_link) > + *has_enabled_link = true; > + > + /* Skip validation if the current pad isn't the sink pad of the link. */ > + if (link->sink != pad) > + return 0; > + > + if (!entity->ops || !entity->ops->link_validate) > + return 0; > + > + ret = entity->ops->link_validate(link); > + if (ret) { > + dev_dbg(mdev->dev, > + "Link '%s':%u -> '%s':%u failed validation: %d\n", > + link->source->entity->name, link->source->index, > + link->sink->entity->name, link->sink->index, ret); > + return ret; > + } > + > + dev_dbg(mdev->dev, "Link '%s':%u -> '%s':%u is valid\n", > + link->source->entity->name, link->source->index, > + link->sink->entity->name, link->sink->index); > + > + return 0; > +} > + > __must_check int __media_pipeline_start(struct media_pad *origin, > struct media_pipeline *pipe) > { > @@ -838,39 +877,10 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > if (link->sink != pad && link->source != pad) > continue; > > - /* > - * Ensure the link is enabled and if so, record > - * it. Proceed to the next link if the current pad isn't > - * the sink pad of the link. > - */ > - if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > - continue; > - > - has_enabled_link = true; > - > - if (link->sink != pad) > - continue; > - > - if (!entity->ops || !entity->ops->link_validate) > - continue; > - > - ret = entity->ops->link_validate(link); > - if (ret) { > - dev_dbg(mdev->dev, > - "Link '%s':%u -> '%s':%u failed validation: %d\n", > - link->source->entity->name, > - link->source->index, > - link->sink->entity->name, > - link->sink->index, ret); > + ret = __media_pipeline_validate_one(origin, pad, link, > + &has_enabled_link); > + if (ret) > goto error; > - } > - > - dev_dbg(mdev->dev, > - "Link '%s':%u -> '%s':%u is valid\n", > - link->source->entity->name, > - link->source->index, > - link->sink->entity->name, > - link->sink->index); > } > > /* > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 19/29] media: mc: Separate single link validation into a new function 2026-04-08 15:39 ` [PATCH v4 19/29] media: mc: Separate single link validation into a new function Sakari Ailus 2026-04-10 9:29 ` Jacopo Mondi @ 2026-04-16 16:35 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 16:35 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 Hi Sakari, Thank you for the patch. On Wed, Apr 08, 2026 at 06:39:28PM +0300, Sakari Ailus wrote: > Add a new function __media_pipeline_validate_one() to validate a single > link in a pipeline. This will soon be used for performing validation in > multiple phases. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Michael Riesch <michael.riesch@collabora.com> > --- > drivers/media/mc/mc-entity.c | 74 ++++++++++++++++++++---------------- > 1 file changed, 42 insertions(+), 32 deletions(-) > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > index 6bf4730b89d2..717569bd1a8c 100644 > --- a/drivers/media/mc/mc-entity.c > +++ b/drivers/media/mc/mc-entity.c > @@ -768,6 +768,45 @@ static int media_pipeline_populate(struct media_pipeline *pipe, > return ret; > } > > +static int > +__media_pipeline_validate_one(struct media_pad *origin, > + struct media_pad *pad, struct media_link *link, > + bool *has_enabled_link) I'd drop the __ prefix unless you plan to add a media_pipeline_validate_one(). As I think 22/29 should be postpone to a series that introduces its first user, I'd postpone this patch too. > +{ > + struct media_device *mdev = origin->graph_obj.mdev; > + struct media_entity *entity = pad->entity; > + int ret; > + > + /* Return here if the link is disabled. */ > + if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > + return 0; > + > + if (has_enabled_link) > + *has_enabled_link = true; > + > + /* Skip validation if the current pad isn't the sink pad of the link. */ > + if (link->sink != pad) > + return 0; > + > + if (!entity->ops || !entity->ops->link_validate) > + return 0; > + > + ret = entity->ops->link_validate(link); > + if (ret) { > + dev_dbg(mdev->dev, > + "Link '%s':%u -> '%s':%u failed validation: %d\n", > + link->source->entity->name, link->source->index, > + link->sink->entity->name, link->sink->index, ret); > + return ret; > + } > + > + dev_dbg(mdev->dev, "Link '%s':%u -> '%s':%u is valid\n", > + link->source->entity->name, link->source->index, > + link->sink->entity->name, link->sink->index); > + > + return 0; > +} > + > __must_check int __media_pipeline_start(struct media_pad *origin, > struct media_pipeline *pipe) > { > @@ -838,39 +877,10 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > if (link->sink != pad && link->source != pad) > continue; > > - /* > - * Ensure the link is enabled and if so, record > - * it. Proceed to the next link if the current pad isn't > - * the sink pad of the link. > - */ > - if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > - continue; > - > - has_enabled_link = true; > - > - if (link->sink != pad) > - continue; > - > - if (!entity->ops || !entity->ops->link_validate) > - continue; > - > - ret = entity->ops->link_validate(link); > - if (ret) { > - dev_dbg(mdev->dev, > - "Link '%s':%u -> '%s':%u failed validation: %d\n", > - link->source->entity->name, > - link->source->index, > - link->sink->entity->name, > - link->sink->index, ret); > + ret = __media_pipeline_validate_one(origin, pad, link, > + &has_enabled_link); > + if (ret) > goto error; > - } > - > - dev_dbg(mdev->dev, > - "Link '%s':%u -> '%s':%u is valid\n", > - link->source->entity->name, > - link->source->index, > - link->sink->entity->name, > - link->sink->index); > } > > /* -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 20/29] media: uapi: Bump the STREAMS bit a little 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (18 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 19/29] media: mc: Separate single link validation into a new function Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 9:31 ` Jacopo Mondi 2026-04-08 15:39 ` [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP Sakari Ailus ` (8 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Bump the V4L2_SUBDEV_CAP_STREAMS by one bit up, order to avoid confusing libcamera with streams that has moved forward from the original libcamera implementation. The bit can presumably be taken into use but only after the other free bits. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- include/uapi/linux/v4l2-subdev.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h index 2347e266cf75..6160c3e21436 100644 --- a/include/uapi/linux/v4l2-subdev.h +++ b/include/uapi/linux/v4l2-subdev.h @@ -196,8 +196,11 @@ struct v4l2_subdev_capability { /* The v4l2 sub-device video device node is registered in read-only mode. */ #define V4L2_SUBDEV_CAP_RO_SUBDEV 0x00000001 +/* Reserved, old STREAMS bit libcamera used before API stabilisation. */ +/* #define V4L2_SUBDEV_CAP_STREAMS_PRELIMINARY 0x00000002 */ + /* The v4l2 sub-device supports routing and multiplexed streams. */ -#define V4L2_SUBDEV_CAP_STREAMS 0x00000002 +#define V4L2_SUBDEV_CAP_STREAMS 0x00000004 /* * Is the route active? An active route will start when streaming is enabled -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 20/29] media: uapi: Bump the STREAMS bit a little 2026-04-08 15:39 ` [PATCH v4 20/29] media: uapi: Bump the STREAMS bit a little Sakari Ailus @ 2026-04-10 9:31 ` Jacopo Mondi 2026-04-16 14:31 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 9:31 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:29PM +0300, Sakari Ailus wrote: > Bump the V4L2_SUBDEV_CAP_STREAMS by one bit up, order to avoid confusing > libcamera with streams that has moved forward from the original libcamera > implementation. The bit can presumably be taken into use but only after > the other free bits. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Thanks! Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > include/uapi/linux/v4l2-subdev.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h > index 2347e266cf75..6160c3e21436 100644 > --- a/include/uapi/linux/v4l2-subdev.h > +++ b/include/uapi/linux/v4l2-subdev.h > @@ -196,8 +196,11 @@ struct v4l2_subdev_capability { > /* The v4l2 sub-device video device node is registered in read-only mode. */ > #define V4L2_SUBDEV_CAP_RO_SUBDEV 0x00000001 > > +/* Reserved, old STREAMS bit libcamera used before API stabilisation. */ > +/* #define V4L2_SUBDEV_CAP_STREAMS_PRELIMINARY 0x00000002 */ This should make sure libcamera versions which support the new flag won't match agains older kernel which use the old value! > + > /* The v4l2 sub-device supports routing and multiplexed streams. */ > -#define V4L2_SUBDEV_CAP_STREAMS 0x00000002 > +#define V4L2_SUBDEV_CAP_STREAMS 0x00000004 > > /* > * Is the route active? An active route will start when streaming is enabled > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 20/29] media: uapi: Bump the STREAMS bit a little 2026-04-10 9:31 ` Jacopo Mondi @ 2026-04-16 14:31 ` Laurent Pinchart 2026-04-21 10:27 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 14:31 UTC (permalink / raw) To: Jacopo Mondi Cc: Sakari Ailus, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Fri, Apr 10, 2026 at 11:31:06AM +0200, Jacopo Mondi wrote: > On Wed, Apr 08, 2026 at 06:39:29PM +0300, Sakari Ailus wrote: > > Bump the V4L2_SUBDEV_CAP_STREAMS by one bit up, order to avoid confusing > > libcamera with streams that has moved forward from the original libcamera > > implementation. The bit can presumably be taken into use but only after > > the other free bits. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > Thanks! > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > > --- > > include/uapi/linux/v4l2-subdev.h | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h > > index 2347e266cf75..6160c3e21436 100644 > > --- a/include/uapi/linux/v4l2-subdev.h > > +++ b/include/uapi/linux/v4l2-subdev.h > > @@ -196,8 +196,11 @@ struct v4l2_subdev_capability { > > /* The v4l2 sub-device video device node is registered in read-only mode. */ > > #define V4L2_SUBDEV_CAP_RO_SUBDEV 0x00000001 > > > > +/* Reserved, old STREAMS bit libcamera used before API stabilisation. */ > > +/* #define V4L2_SUBDEV_CAP_STREAMS_PRELIMINARY 0x00000002 */ > > This should make sure libcamera versions which support the new flag > won't match agains older kernel which use the old value! Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Could we delay merging this patch until we work on implementing the new behaviour in libcamera ? > > + > > /* The v4l2 sub-device supports routing and multiplexed streams. */ > > -#define V4L2_SUBDEV_CAP_STREAMS 0x00000002 > > +#define V4L2_SUBDEV_CAP_STREAMS 0x00000004 > > > > /* > > * Is the route active? An active route will start when streaming is enabled -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 20/29] media: uapi: Bump the STREAMS bit a little 2026-04-16 14:31 ` Laurent Pinchart @ 2026-04-21 10:27 ` Sakari Ailus 2026-04-21 11:18 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-21 10:27 UTC (permalink / raw) To: Laurent Pinchart Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Laurent, On Thu, Apr 16, 2026 at 05:31:12PM +0300, Laurent Pinchart wrote: > On Fri, Apr 10, 2026 at 11:31:06AM +0200, Jacopo Mondi wrote: > > On Wed, Apr 08, 2026 at 06:39:29PM +0300, Sakari Ailus wrote: > > > Bump the V4L2_SUBDEV_CAP_STREAMS by one bit up, order to avoid confusing > > > libcamera with streams that has moved forward from the original libcamera > > > implementation. The bit can presumably be taken into use but only after > > > the other free bits. > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > Thanks! > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > > > > --- > > > include/uapi/linux/v4l2-subdev.h | 5 ++++- > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h > > > index 2347e266cf75..6160c3e21436 100644 > > > --- a/include/uapi/linux/v4l2-subdev.h > > > +++ b/include/uapi/linux/v4l2-subdev.h > > > @@ -196,8 +196,11 @@ struct v4l2_subdev_capability { > > > /* The v4l2 sub-device video device node is registered in read-only mode. */ > > > #define V4L2_SUBDEV_CAP_RO_SUBDEV 0x00000001 > > > > > > +/* Reserved, old STREAMS bit libcamera used before API stabilisation. */ > > > +/* #define V4L2_SUBDEV_CAP_STREAMS_PRELIMINARY 0x00000002 */ > > > > This should make sure libcamera versions which support the new flag > > won't match agains older kernel which use the old value! > > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > Could we delay merging this patch until we work on implementing the new > behaviour in libcamera ? I guess we're not in hurry to merge this although I don't see the direct connection to libcamera. Are you worried someone could start using this bit instead before wget things entirely stabilised? :-) > > > > + > > > /* The v4l2 sub-device supports routing and multiplexed streams. */ > > > -#define V4L2_SUBDEV_CAP_STREAMS 0x00000002 > > > +#define V4L2_SUBDEV_CAP_STREAMS 0x00000004 > > > > > > /* > > > * Is the route active? An active route will start when streaming is enabled > -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 20/29] media: uapi: Bump the STREAMS bit a little 2026-04-21 10:27 ` Sakari Ailus @ 2026-04-21 11:18 ` Laurent Pinchart 0 siblings, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-21 11:18 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Tue, Apr 21, 2026 at 01:27:36PM +0300, Sakari Ailus wrote: > On Thu, Apr 16, 2026 at 05:31:12PM +0300, Laurent Pinchart wrote: > > On Fri, Apr 10, 2026 at 11:31:06AM +0200, Jacopo Mondi wrote: > > > On Wed, Apr 08, 2026 at 06:39:29PM +0300, Sakari Ailus wrote: > > > > Bump the V4L2_SUBDEV_CAP_STREAMS by one bit up, order to avoid confusing > > > > libcamera with streams that has moved forward from the original libcamera > > > > implementation. The bit can presumably be taken into use but only after > > > > the other free bits. > > > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > > > Thanks! > > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > > > > > > --- > > > > include/uapi/linux/v4l2-subdev.h | 5 ++++- > > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h > > > > index 2347e266cf75..6160c3e21436 100644 > > > > --- a/include/uapi/linux/v4l2-subdev.h > > > > +++ b/include/uapi/linux/v4l2-subdev.h > > > > @@ -196,8 +196,11 @@ struct v4l2_subdev_capability { > > > > /* The v4l2 sub-device video device node is registered in read-only mode. */ > > > > #define V4L2_SUBDEV_CAP_RO_SUBDEV 0x00000001 > > > > > > > > +/* Reserved, old STREAMS bit libcamera used before API stabilisation. */ > > > > +/* #define V4L2_SUBDEV_CAP_STREAMS_PRELIMINARY 0x00000002 */ > > > > > > This should make sure libcamera versions which support the new flag > > > won't match agains older kernel which use the old value! > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > > > Could we delay merging this patch until we work on implementing the new > > behaviour in libcamera ? > > I guess we're not in hurry to merge this although I don't see the direct > connection to libcamera. Are you worried someone could start using this bit > instead before wget things entirely stabilised? :-) That's exactly my concern, yes. > > > > + > > > > /* The v4l2 sub-device supports routing and multiplexed streams. */ > > > > -#define V4L2_SUBDEV_CAP_STREAMS 0x00000002 > > > > +#define V4L2_SUBDEV_CAP_STREAMS 0x00000004 > > > > > > > > /* > > > > * Is the route active? An active route will start when streaming is enabled -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (19 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 20/29] media: uapi: Bump the STREAMS bit a little Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 10:31 ` Jacopo Mondi 2026-04-16 15:59 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 22/29] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE Sakari Ailus ` (7 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 The implementation of MEDIA_IOC_LINK_SETUP currently requires that all flags that are set by the driver are correctly set as the driver expects. This poses a problem for adding new flags as programs could not work with links that have unknown flags even when the use of these flags wouldn't affect the program. Ignore the non-settable link flags. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/mc/mc-entity.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index 717569bd1a8c..287eded356bb 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -1319,7 +1319,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) int __media_entity_setup_link(struct media_link *link, u32 flags) { - const u32 mask = MEDIA_LNK_FL_ENABLED; + const u32 settable_flags = MEDIA_LNK_FL_ENABLED; struct media_device *mdev; struct media_pad *source, *sink; int ret = -EBUSY; @@ -1327,9 +1327,9 @@ int __media_entity_setup_link(struct media_link *link, u32 flags) if (link == NULL) return -EINVAL; - /* The non-modifiable link flags must not be modified. */ - if ((link->flags & ~mask) != (flags & ~mask)) - return -EINVAL; + /* Only allow changing user-settable flags. */ + flags &= settable_flags; + flags |= link->flags & ~settable_flags; if (link->flags & MEDIA_LNK_FL_IMMUTABLE) return link->flags == flags ? 0 : -EINVAL; -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP 2026-04-08 15:39 ` [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP Sakari Ailus @ 2026-04-10 10:31 ` Jacopo Mondi 2026-04-10 12:56 ` Sakari Ailus 2026-04-16 15:59 ` Laurent Pinchart 1 sibling, 1 reply; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 10:31 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:30PM +0300, Sakari Ailus wrote: > The implementation of MEDIA_IOC_LINK_SETUP currently requires that all > flags that are set by the driver are correctly set as the driver expects. I would The implementation of MEDIA_IOC_LINK_SETUP currently requires that all flags that are not configurable are not modified by userspace. > This poses a problem for adding new flags as programs could not work with > links that have unknown flags even when the use of these flags wouldn't > affect the program. > > Ignore the non-settable link flags. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > --- > drivers/media/mc/mc-entity.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > index 717569bd1a8c..287eded356bb 100644 > --- a/drivers/media/mc/mc-entity.c > +++ b/drivers/media/mc/mc-entity.c > @@ -1319,7 +1319,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) > > int __media_entity_setup_link(struct media_link *link, u32 flags) Let me get this right: "link" comes from userspace. "flags" are the flags set by driver when creating the link, right ? > { > - const u32 mask = MEDIA_LNK_FL_ENABLED; > + const u32 settable_flags = MEDIA_LNK_FL_ENABLED; > struct media_device *mdev; > struct media_pad *source, *sink; > int ret = -EBUSY; > @@ -1327,9 +1327,9 @@ int __media_entity_setup_link(struct media_link *link, u32 flags) > if (link == NULL) > return -EINVAL; > > - /* The non-modifiable link flags must not be modified. */ > - if ((link->flags & ~mask) != (flags & ~mask)) > - return -EINVAL; > + /* Only allow changing user-settable flags. */ > + flags &= settable_flags; > + flags |= link->flags & ~settable_flags; > > if (link->flags & MEDIA_LNK_FL_IMMUTABLE) If my above understanding is correct and if you drop the above check, doesn't this mean userspace can now clear MEDIA_LNK_FL_IMMUTABLE ? Should link->flags be replaced by "flags" here ? > return link->flags == flags ? 0 : -EINVAL; And this should probably be changed as well. Unfortunately, if we want to allow userspace to ignore the forthcoming MEDIA_LNK_FL_VALIDATE_LATE flag I guess we need to make it an exception (which is not great, I know). Hope I got it right... > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP 2026-04-10 10:31 ` Jacopo Mondi @ 2026-04-10 12:56 ` Sakari Ailus 2026-04-10 13:24 ` Jacopo Mondi 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-10 12:56 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Jacopo, Thanks for the review. On Fri, Apr 10, 2026 at 12:31:58PM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:30PM +0300, Sakari Ailus wrote: > > The implementation of MEDIA_IOC_LINK_SETUP currently requires that all > > flags that are set by the driver are correctly set as the driver expects. > > I would > > The implementation of MEDIA_IOC_LINK_SETUP currently requires that all > flags that are not configurable are not modified by userspace. Sounds good. > > > This poses a problem for adding new flags as programs could not work with > > links that have unknown flags even when the use of these flags wouldn't > > affect the program. > > > > Ignore the non-settable link flags. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > --- > > drivers/media/mc/mc-entity.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > > index 717569bd1a8c..287eded356bb 100644 > > --- a/drivers/media/mc/mc-entity.c > > +++ b/drivers/media/mc/mc-entity.c > > @@ -1319,7 +1319,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) > > > > int __media_entity_setup_link(struct media_link *link, u32 flags) > > Let me get this right: "link" comes from userspace. "flags" are the > flags set by driver when creating the link, right ? It's the other way around; this is called via MEDIA_IOC_SETUP_LINK IOCTL. > > > { > > - const u32 mask = MEDIA_LNK_FL_ENABLED; > > + const u32 settable_flags = MEDIA_LNK_FL_ENABLED; > > struct media_device *mdev; > > struct media_pad *source, *sink; > > int ret = -EBUSY; > > @@ -1327,9 +1327,9 @@ int __media_entity_setup_link(struct media_link *link, u32 flags) > > if (link == NULL) > > return -EINVAL; > > > > - /* The non-modifiable link flags must not be modified. */ > > - if ((link->flags & ~mask) != (flags & ~mask)) > > - return -EINVAL; > > + /* Only allow changing user-settable flags. */ > > + flags &= settable_flags; > > + flags |= link->flags & ~settable_flags; > > > > if (link->flags & MEDIA_LNK_FL_IMMUTABLE) > > If my above understanding is correct and if you drop the above check, > doesn't this mean userspace can now clear MEDIA_LNK_FL_IMMUTABLE ? > > Should link->flags be replaced by "flags" here ? The intent here is to drop whatever non-settable flags the user provided and replace them with what is set on the link. > > > return link->flags == flags ? 0 : -EINVAL; > > And this should probably be changed as well. Unfortunately, if we > want to allow userspace to ignore the forthcoming MEDIA_LNK_FL_VALIDATE_LATE > flag I guess we need to make it an exception (which is not great, I know). > > Hope I got it right... > -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP 2026-04-10 12:56 ` Sakari Ailus @ 2026-04-10 13:24 ` Jacopo Mondi 0 siblings, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 13:24 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Sakari On Fri, Apr 10, 2026 at 03:56:58PM +0300, Sakari Ailus wrote: > Hi Jacopo, > > Thanks for the review. > > On Fri, Apr 10, 2026 at 12:31:58PM +0200, Jacopo Mondi wrote: > > Hi Sakari > > > > On Wed, Apr 08, 2026 at 06:39:30PM +0300, Sakari Ailus wrote: > > > The implementation of MEDIA_IOC_LINK_SETUP currently requires that all > > > flags that are set by the driver are correctly set as the driver expects. > > > > I would > > > > The implementation of MEDIA_IOC_LINK_SETUP currently requires that all > > flags that are not configurable are not modified by userspace. > > Sounds good. > > > > > > This poses a problem for adding new flags as programs could not work with > > > links that have unknown flags even when the use of these flags wouldn't > > > affect the program. > > > > > > Ignore the non-settable link flags. > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > --- > > > drivers/media/mc/mc-entity.c | 8 ++++---- > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > > > index 717569bd1a8c..287eded356bb 100644 > > > --- a/drivers/media/mc/mc-entity.c > > > +++ b/drivers/media/mc/mc-entity.c > > > @@ -1319,7 +1319,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) > > > > > > int __media_entity_setup_link(struct media_link *link, u32 flags) > > > > Let me get this right: "link" comes from userspace. "flags" are the > > flags set by driver when creating the link, right ? > > It's the other way around; this is called via MEDIA_IOC_SETUP_LINK IOCTL. > Ah static long media_device_setup_link(struct media_device *mdev, void *arg) { struct media_link_desc *linkd = arg; ... return __media_entity_setup_link(link, linkd->flags); } I've read it the other way around > > > > > { > > > - const u32 mask = MEDIA_LNK_FL_ENABLED; > > > + const u32 settable_flags = MEDIA_LNK_FL_ENABLED; > > > struct media_device *mdev; > > > struct media_pad *source, *sink; > > > int ret = -EBUSY; > > > @@ -1327,9 +1327,9 @@ int __media_entity_setup_link(struct media_link *link, u32 flags) > > > if (link == NULL) > > > return -EINVAL; > > > > > > - /* The non-modifiable link flags must not be modified. */ > > > - if ((link->flags & ~mask) != (flags & ~mask)) > > > - return -EINVAL; > > > + /* Only allow changing user-settable flags. */ > > > + flags &= settable_flags; > > > + flags |= link->flags & ~settable_flags; > > > > > > if (link->flags & MEDIA_LNK_FL_IMMUTABLE) > > > > If my above understanding is correct and if you drop the above check, > > doesn't this mean userspace can now clear MEDIA_LNK_FL_IMMUTABLE ? > > > > Should link->flags be replaced by "flags" here ? > > The intent here is to drop whatever non-settable flags the user provided > and replace them with what is set on the link. > > > > > > return link->flags == flags ? 0 : -EINVAL; > > > > And this should probably be changed as well. Unfortunately, if we > > want to allow userspace to ignore the forthcoming MEDIA_LNK_FL_VALIDATE_LATE > > flag I guess we need to make it an exception (which is not great, I know). > > > > Hope I got it right... > > I didn't Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > -- > Regards, > > Sakari Ailus > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP 2026-04-08 15:39 ` [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP Sakari Ailus 2026-04-10 10:31 ` Jacopo Mondi @ 2026-04-16 15:59 ` Laurent Pinchart 2026-04-21 10:44 ` Sakari Ailus 1 sibling, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 15:59 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 Hi Sakari, Thank you for the patch. On Wed, Apr 08, 2026 at 06:39:30PM +0300, Sakari Ailus wrote: > The implementation of MEDIA_IOC_LINK_SETUP currently requires that all > flags that are set by the driver are correctly set as the driver expects. > This poses a problem for adding new flags as programs could not work with > links that have unknown flags even when the use of these flags wouldn't > affect the program. I suppose applications could be instructed to preserve the flags they don't know about, but some existing applications probably don't do that. > Ignore the non-settable link flags. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > --- > drivers/media/mc/mc-entity.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > index 717569bd1a8c..287eded356bb 100644 > --- a/drivers/media/mc/mc-entity.c > +++ b/drivers/media/mc/mc-entity.c > @@ -1319,7 +1319,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) > > int __media_entity_setup_link(struct media_link *link, u32 flags) > { > - const u32 mask = MEDIA_LNK_FL_ENABLED; > + const u32 settable_flags = MEDIA_LNK_FL_ENABLED; > struct media_device *mdev; > struct media_pad *source, *sink; > int ret = -EBUSY; > @@ -1327,9 +1327,9 @@ int __media_entity_setup_link(struct media_link *link, u32 flags) > if (link == NULL) > return -EINVAL; > > - /* The non-modifiable link flags must not be modified. */ > - if ((link->flags & ~mask) != (flags & ~mask)) > - return -EINVAL; > + /* Only allow changing user-settable flags. */ > + flags &= settable_flags; > + flags |= link->flags & ~settable_flags; Now that the link can be configured with different flags than the ones set by userspace, I think the ioctl should return the actual link flags. > > if (link->flags & MEDIA_LNK_FL_IMMUTABLE) > return link->flags == flags ? 0 : -EINVAL; -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP 2026-04-16 15:59 ` Laurent Pinchart @ 2026-04-21 10:44 ` Sakari Ailus 0 siblings, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-21 10:44 UTC (permalink / raw) To: Laurent Pinchart Cc: linux-media, hans, 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, André 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 Hi Laurent, On Thu, Apr 16, 2026 at 06:59:17PM +0300, Laurent Pinchart wrote: > Hi Sakari, > > Thank you for the patch. > > On Wed, Apr 08, 2026 at 06:39:30PM +0300, Sakari Ailus wrote: > > The implementation of MEDIA_IOC_LINK_SETUP currently requires that all > > flags that are set by the driver are correctly set as the driver expects. > > This poses a problem for adding new flags as programs could not work with > > links that have unknown flags even when the use of these flags wouldn't > > affect the program. > > I suppose applications could be instructed to preserve the flags they > don't know about, but some existing applications probably don't do that. > > > Ignore the non-settable link flags. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > --- > > drivers/media/mc/mc-entity.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > > index 717569bd1a8c..287eded356bb 100644 > > --- a/drivers/media/mc/mc-entity.c > > +++ b/drivers/media/mc/mc-entity.c > > @@ -1319,7 +1319,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) > > > > int __media_entity_setup_link(struct media_link *link, u32 flags) > > { > > - const u32 mask = MEDIA_LNK_FL_ENABLED; > > + const u32 settable_flags = MEDIA_LNK_FL_ENABLED; > > struct media_device *mdev; > > struct media_pad *source, *sink; > > int ret = -EBUSY; > > @@ -1327,9 +1327,9 @@ int __media_entity_setup_link(struct media_link *link, u32 flags) > > if (link == NULL) > > return -EINVAL; > > > > - /* The non-modifiable link flags must not be modified. */ > > - if ((link->flags & ~mask) != (flags & ~mask)) > > - return -EINVAL; > > + /* Only allow changing user-settable flags. */ > > + flags &= settable_flags; > > + flags |= link->flags & ~settable_flags; > > Now that the link can be configured with different flags than the ones > set by userspace, I think the ioctl should return the actual link flags. I'll do that for v5. > > > > > if (link->flags & MEDIA_LNK_FL_IMMUTABLE) > > return link->flags == flags ? 0 : -EINVAL; > -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 22/29] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (20 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 10:41 ` Jacopo Mondi 2026-04-16 16:29 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 23/29] media: Improve enable_streams and disable_streams documentation Sakari Ailus ` (6 subsequent siblings) 28 siblings, 2 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Add MEDIA_LNK_FL_VALIDATE_LATE flag to support late validation of links. This is serving the use case where video devices are configured and started streaming indepenently of each other but this sequence may be run in series, in such a way that a video device in a pipeline starts streaming before another one is configured. Before this flag, drivers have resorted to implementing the link validation separately for the video nodes as part of streaming start sequence. media_pipeline_start() shall be called on each leaf entity connected to the graph with a link where MEDIA_LNK_FL_VALIDATE_LATE is set before uphardware operation. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- .../media/mediactl/media-ioc-setup-link.rst | 4 + .../media/mediactl/media-types.rst | 5 ++ drivers/media/mc/mc-entity.c | 82 ++++++++++++++++++- include/uapi/linux/media.h | 1 + 4 files changed, 88 insertions(+), 4 deletions(-) diff --git a/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst b/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst index 23208300cb61..7c2bced57e77 100644 --- a/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst +++ b/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst @@ -49,6 +49,10 @@ Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled while streaming media data. Attempting to enable or disable a streaming non-dynamic link will return an ``EBUSY`` error code. +Pipeline validation may be delayed for links marked with the ``VALIDATE_LATE`` +flag until actual hardware operation even if the rest of the pipeline would be +validated at an earlier point of time. + If the specified link can't be found the driver returns with an ``EINVAL`` error code. diff --git a/Documentation/userspace-api/media/mediactl/media-types.rst b/Documentation/userspace-api/media/mediactl/media-types.rst index 6332e8395263..d6a690655a01 100644 --- a/Documentation/userspace-api/media/mediactl/media-types.rst +++ b/Documentation/userspace-api/media/mediactl/media-types.rst @@ -391,6 +391,7 @@ must be set for every pad. .. _MEDIA-LNK-FL-ENABLED: .. _MEDIA-LNK-FL-IMMUTABLE: .. _MEDIA-LNK-FL-DYNAMIC: +.. _MEDIA-LNK-FL-VALIDATE-LATE: .. _MEDIA-LNK-FL-LINK-TYPE: .. flat-table:: Media link flags @@ -410,6 +411,10 @@ must be set for every pad. - The link enabled state can be modified during streaming. This flag is set by drivers and is read-only for applications. + * - ``MEDIA_LNK_FL_VALIDATE_LATE`` + - The validation of the link may be delayed up to until the start of + hardware operation. + * - ``MEDIA_LNK_FL_LINK_TYPE`` - This is a bitmask that defines the type of the link. The following link types are currently supported: diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index 287eded356bb..5b0162f81425 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -771,7 +771,7 @@ static int media_pipeline_populate(struct media_pipeline *pipe, static int __media_pipeline_validate_one(struct media_pad *origin, struct media_pad *pad, struct media_link *link, - bool *has_enabled_link) + bool *has_enabled_link, bool skip_validation) { struct media_device *mdev = origin->graph_obj.mdev; struct media_entity *entity = pad->entity; @@ -784,6 +784,9 @@ __media_pipeline_validate_one(struct media_pad *origin, if (has_enabled_link) *has_enabled_link = true; + if (skip_validation) + return 0; + /* Skip validation if the current pad isn't the sink pad of the link. */ if (link->sink != pad) return 0; @@ -825,11 +828,48 @@ __must_check int __media_pipeline_start(struct media_pad *origin, return -EINVAL; /* - * If the pipeline has already been started, it is guaranteed to be - * valid, so just increase the start count. + * Increase start count on pipelines that have been validated + * earlier. Also check links with the VALIDATE_LATE flag here. */ if (pipe->start_count) { + struct media_link *link; + + link = __media_entity_next_link(origin->entity, NULL, + MEDIA_LNK_FL_DATA_LINK); + if (link && link->flags & MEDIA_LNK_FL_VALIDATE_LATE) { + struct media_link *link2 = + __media_entity_next_link(origin->entity, link, + MEDIA_LNK_FL_DATA_LINK); + bool has_enabled_link = false; + + /* + * Only a single pad is allowed for VALIDATE_LATE + * links. That pad needs to have exactly one link. + */ + if (origin->entity->num_pads != 1) + return -EINVAL; + + if (!link || link2) + return -EINVAL; + + dev_dbg(mdev->dev, + "Validating pad '%s':%u late\n", + origin->entity->name, origin->index); + + ret = __media_pipeline_validate_one(link->sink, + link->sink, link, + &has_enabled_link, + false); + if (ret) + return ret; + + if (origin->flags & MEDIA_PAD_FL_MUST_CONNECT && + !has_enabled_link) + return -ENOLINK; + } + pipe->start_count++; + return 0; } @@ -873,12 +913,19 @@ __must_check int __media_pipeline_start(struct media_pad *origin, * the connected sink pad to avoid duplicating checks. */ for_each_media_entity_data_link(entity, link) { + /* Skip late-validated links not connected to origin. */ + bool skip_validation = + link->flags & MEDIA_LNK_FL_VALIDATE_LATE && + link->sink != origin && + link->source != origin; + /* Skip links unrelated to the current pad. */ if (link->sink != pad && link->source != pad) continue; ret = __media_pipeline_validate_one(origin, pad, link, - &has_enabled_link); + &has_enabled_link, + skip_validation); if (ret) goto error; } @@ -1158,6 +1205,33 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, if (WARN_ON(!(sink->pads[sink_pad].flags & MEDIA_PAD_FL_SINK))) return -EINVAL; + /* + * With the late validate flag, either source or sink shall have exactly + * one pad and no links before this one. Similarly, no links may be + * added to entities with a single pad and an existing late-validated + * link. + */ + if (flags & MEDIA_LNK_FL_VALIDATE_LATE) { + if (!(source->num_pads == 1 && !source->num_links) && + !(sink->num_pads == 1 && !sink->num_links)) + return -EINVAL; + } else { + struct media_entity *entities[] = { source, sink }; + + for (unsigned int i = 0; i < ARRAY_SIZE(entities); i++) { + if (entities[i]->num_pads != 1) + continue; + + struct media_link *__link = + __media_entity_next_link(entities[i], NULL, + MEDIA_LNK_FL_DATA_LINK); + + if (__link && + __link->flags & MEDIA_LNK_FL_VALIDATE_LATE) + return -EINVAL; + } + } + link = media_add_link(&source->links); if (link == NULL) return -ENOMEM; diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index 1c80b1d6bbaf..c96e2118ea99 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h @@ -219,6 +219,7 @@ struct media_pad_desc { #define MEDIA_LNK_FL_ENABLED (1U << 0) #define MEDIA_LNK_FL_IMMUTABLE (1U << 1) #define MEDIA_LNK_FL_DYNAMIC (1U << 2) +#define MEDIA_LNK_FL_VALIDATE_LATE (1U << 3) #define MEDIA_LNK_FL_LINK_TYPE (0xf << 28) # define MEDIA_LNK_FL_DATA_LINK (0U << 28) -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 22/29] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE 2026-04-08 15:39 ` [PATCH v4 22/29] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE Sakari Ailus @ 2026-04-10 10:41 ` Jacopo Mondi 2026-04-13 7:59 ` Sakari Ailus 2026-04-16 16:29 ` Laurent Pinchart 1 sibling, 1 reply; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 10:41 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:31PM +0300, Sakari Ailus wrote: > Add MEDIA_LNK_FL_VALIDATE_LATE flag to support late validation of links. > This is serving the use case where video devices are configured and > started streaming indepenently of each other but this sequence may be run s/indepenently/independently > in series, in such a way that a video device in a pipeline starts > streaming before another one is configured. > > Before this flag, drivers have resorted to implementing the link > validation separately for the video nodes as part of streaming start > sequence. > > media_pipeline_start() shall be called on each leaf entity connected to > the graph with a link where MEDIA_LNK_FL_VALIDATE_LATE is set before > uphardware operation. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > --- > .../media/mediactl/media-ioc-setup-link.rst | 4 + > .../media/mediactl/media-types.rst | 5 ++ > drivers/media/mc/mc-entity.c | 82 ++++++++++++++++++- > include/uapi/linux/media.h | 1 + > 4 files changed, 88 insertions(+), 4 deletions(-) > > diff --git a/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst b/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > index 23208300cb61..7c2bced57e77 100644 > --- a/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > +++ b/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > @@ -49,6 +49,10 @@ Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled > while streaming media data. Attempting to enable or disable a streaming > non-dynamic link will return an ``EBUSY`` error code. > > +Pipeline validation may be delayed for links marked with the ``VALIDATE_LATE`` Is it helpful to say "created" instead of "marked" to highlight that this flag is set by drivers or is it clear enough from the context ? > +flag until actual hardware operation even if the rest of the pipeline would be operation or operations ? > +validated at an earlier point of time. > + > If the specified link can't be found the driver returns with an ``EINVAL`` > error code. > > diff --git a/Documentation/userspace-api/media/mediactl/media-types.rst b/Documentation/userspace-api/media/mediactl/media-types.rst > index 6332e8395263..d6a690655a01 100644 > --- a/Documentation/userspace-api/media/mediactl/media-types.rst > +++ b/Documentation/userspace-api/media/mediactl/media-types.rst > @@ -391,6 +391,7 @@ must be set for every pad. > .. _MEDIA-LNK-FL-ENABLED: > .. _MEDIA-LNK-FL-IMMUTABLE: > .. _MEDIA-LNK-FL-DYNAMIC: > +.. _MEDIA-LNK-FL-VALIDATE-LATE: > .. _MEDIA-LNK-FL-LINK-TYPE: > > .. flat-table:: Media link flags > @@ -410,6 +411,10 @@ must be set for every pad. > - The link enabled state can be modified during streaming. This flag > is set by drivers and is read-only for applications. > > + * - ``MEDIA_LNK_FL_VALIDATE_LATE`` > + - The validation of the link may be delayed up to until the start of Not an English native speaker here, but "delayed up to until" sounds more complicated than just "delayed to" > + hardware operation. > + > * - ``MEDIA_LNK_FL_LINK_TYPE`` > - This is a bitmask that defines the type of the link. The following > link types are currently supported: > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > index 287eded356bb..5b0162f81425 100644 > --- a/drivers/media/mc/mc-entity.c > +++ b/drivers/media/mc/mc-entity.c > @@ -771,7 +771,7 @@ static int media_pipeline_populate(struct media_pipeline *pipe, > static int > __media_pipeline_validate_one(struct media_pad *origin, > struct media_pad *pad, struct media_link *link, > - bool *has_enabled_link) > + bool *has_enabled_link, bool skip_validation) > { > struct media_device *mdev = origin->graph_obj.mdev; > struct media_entity *entity = pad->entity; > @@ -784,6 +784,9 @@ __media_pipeline_validate_one(struct media_pad *origin, > if (has_enabled_link) > *has_enabled_link = true; > > + if (skip_validation) > + return 0; > + > /* Skip validation if the current pad isn't the sink pad of the link. */ > if (link->sink != pad) > return 0; > @@ -825,11 +828,48 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > return -EINVAL; > > /* > - * If the pipeline has already been started, it is guaranteed to be > - * valid, so just increase the start count. > + * Increase start count on pipelines that have been validated > + * earlier. Also check links with the VALIDATE_LATE flag here. > */ > if (pipe->start_count) { > + struct media_link *link; > + > + link = __media_entity_next_link(origin->entity, NULL, > + MEDIA_LNK_FL_DATA_LINK); > + if (link && link->flags & MEDIA_LNK_FL_VALIDATE_LATE) { > + struct media_link *link2 = > + __media_entity_next_link(origin->entity, link, > + MEDIA_LNK_FL_DATA_LINK); > + bool has_enabled_link = false; > + > + /* > + * Only a single pad is allowed for VALIDATE_LATE > + * links. That pad needs to have exactly one link. > + */ > + if (origin->entity->num_pads != 1) > + return -EINVAL; > + > + if (!link || link2) > + return -EINVAL; This is a development error, isn't it ? Is it worth an error message ? > + > + dev_dbg(mdev->dev, > + "Validating pad '%s':%u late\n", > + origin->entity->name, origin->index); > + > + ret = __media_pipeline_validate_one(link->sink, > + link->sink, link, > + &has_enabled_link, > + false); > + if (ret) > + return ret; > + > + if (origin->flags & MEDIA_PAD_FL_MUST_CONNECT && > + !has_enabled_link) > + return -ENOLINK; > + } > + > pipe->start_count++; > + > return 0; > } > > @@ -873,12 +913,19 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > * the connected sink pad to avoid duplicating checks. > */ > for_each_media_entity_data_link(entity, link) { > + /* Skip late-validated links not connected to origin. */ > + bool skip_validation = > + link->flags & MEDIA_LNK_FL_VALIDATE_LATE && > + link->sink != origin && > + link->source != origin; > + > /* Skip links unrelated to the current pad. */ > if (link->sink != pad && link->source != pad) > continue; > > ret = __media_pipeline_validate_one(origin, pad, link, > - &has_enabled_link); > + &has_enabled_link, > + skip_validation); > if (ret) > goto error; > } > @@ -1158,6 +1205,33 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, > if (WARN_ON(!(sink->pads[sink_pad].flags & MEDIA_PAD_FL_SINK))) > return -EINVAL; > > + /* > + * With the late validate flag, either source or sink shall have exactly > + * one pad and no links before this one. Similarly, no links may be > + * added to entities with a single pad and an existing late-validated > + * link. > + */ > + if (flags & MEDIA_LNK_FL_VALIDATE_LATE) { > + if (!(source->num_pads == 1 && !source->num_links) && > + !(sink->num_pads == 1 && !sink->num_links)) > + return -EINVAL; Ah, so the above error check for which I suggested an error message cannot happen, right ? > + } else { > + struct media_entity *entities[] = { source, sink }; > + > + for (unsigned int i = 0; i < ARRAY_SIZE(entities); i++) { > + if (entities[i]->num_pads != 1) > + continue; > + > + struct media_link *__link = > + __media_entity_next_link(entities[i], NULL, > + MEDIA_LNK_FL_DATA_LINK); > + > + if (__link && > + __link->flags & MEDIA_LNK_FL_VALIDATE_LATE) > + return -EINVAL; > + } > + } > + > link = media_add_link(&source->links); > if (link == NULL) > return -ENOMEM; > diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h > index 1c80b1d6bbaf..c96e2118ea99 100644 > --- a/include/uapi/linux/media.h > +++ b/include/uapi/linux/media.h > @@ -219,6 +219,7 @@ struct media_pad_desc { > #define MEDIA_LNK_FL_ENABLED (1U << 0) > #define MEDIA_LNK_FL_IMMUTABLE (1U << 1) > #define MEDIA_LNK_FL_DYNAMIC (1U << 2) > +#define MEDIA_LNK_FL_VALIDATE_LATE (1U << 3) Nice, with the above minors addressed, if applicable Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > #define MEDIA_LNK_FL_LINK_TYPE (0xf << 28) > # define MEDIA_LNK_FL_DATA_LINK (0U << 28) > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 22/29] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE 2026-04-10 10:41 ` Jacopo Mondi @ 2026-04-13 7:59 ` Sakari Ailus 2026-04-13 9:30 ` Jacopo Mondi 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-13 7:59 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Jacopo, On Fri, Apr 10, 2026 at 12:41:27PM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:31PM +0300, Sakari Ailus wrote: > > Add MEDIA_LNK_FL_VALIDATE_LATE flag to support late validation of links. > > This is serving the use case where video devices are configured and > > started streaming indepenently of each other but this sequence may be run > > s/indepenently/independently Yes. > > > in series, in such a way that a video device in a pipeline starts > > streaming before another one is configured. > > > > Before this flag, drivers have resorted to implementing the link > > validation separately for the video nodes as part of streaming start > > sequence. > > > > media_pipeline_start() shall be called on each leaf entity connected to > > the graph with a link where MEDIA_LNK_FL_VALIDATE_LATE is set before > > uphardware operation. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > --- > > .../media/mediactl/media-ioc-setup-link.rst | 4 + > > .../media/mediactl/media-types.rst | 5 ++ > > drivers/media/mc/mc-entity.c | 82 ++++++++++++++++++- > > include/uapi/linux/media.h | 1 + > > 4 files changed, 88 insertions(+), 4 deletions(-) > > > > diff --git a/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst b/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > > index 23208300cb61..7c2bced57e77 100644 > > --- a/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > > +++ b/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > > @@ -49,6 +49,10 @@ Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled > > while streaming media data. Attempting to enable or disable a streaming > > non-dynamic link will return an ``EBUSY`` error code. > > > > +Pipeline validation may be delayed for links marked with the ``VALIDATE_LATE`` > > Is it helpful to say "created" instead of "marked" to highlight that > this flag is set by drivers or is it clear enough from the context ? How about: Pipeline validation may be delayed for links with the ``VALIDATE_LATE`` flag set until actual hardware operation even if the rest of the pipeline would be validated at an earlier point of time. > > > +flag until actual hardware operation even if the rest of the pipeline would be > > operation or operations ? I'd use singular in referring what the hardware does as a whole here, but I can rework the sentence, too. > > > +validated at an earlier point of time. > > + > > If the specified link can't be found the driver returns with an ``EINVAL`` > > error code. > > > > diff --git a/Documentation/userspace-api/media/mediactl/media-types.rst b/Documentation/userspace-api/media/mediactl/media-types.rst > > index 6332e8395263..d6a690655a01 100644 > > --- a/Documentation/userspace-api/media/mediactl/media-types.rst > > +++ b/Documentation/userspace-api/media/mediactl/media-types.rst > > @@ -391,6 +391,7 @@ must be set for every pad. > > .. _MEDIA-LNK-FL-ENABLED: > > .. _MEDIA-LNK-FL-IMMUTABLE: > > .. _MEDIA-LNK-FL-DYNAMIC: > > +.. _MEDIA-LNK-FL-VALIDATE-LATE: > > .. _MEDIA-LNK-FL-LINK-TYPE: > > > > .. flat-table:: Media link flags > > @@ -410,6 +411,10 @@ must be set for every pad. > > - The link enabled state can be modified during streaming. This flag > > is set by drivers and is read-only for applications. > > > > + * - ``MEDIA_LNK_FL_VALIDATE_LATE`` > > + - The validation of the link may be delayed up to until the start of > > Not an English native speaker here, but "delayed up to until" sounds more > complicated than just "delayed to" Yes, but I don't think it's grammatically nor factually correct. :-) How about: - The validation of the link may be delayed from the pipeline start but it is done no later than starting streaming on the hardware. > > > + hardware operation. > > + > > * - ``MEDIA_LNK_FL_LINK_TYPE`` > > - This is a bitmask that defines the type of the link. The following > > link types are currently supported: > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > > index 287eded356bb..5b0162f81425 100644 > > --- a/drivers/media/mc/mc-entity.c > > +++ b/drivers/media/mc/mc-entity.c > > @@ -771,7 +771,7 @@ static int media_pipeline_populate(struct media_pipeline *pipe, > > static int > > __media_pipeline_validate_one(struct media_pad *origin, > > struct media_pad *pad, struct media_link *link, > > - bool *has_enabled_link) > > + bool *has_enabled_link, bool skip_validation) > > { > > struct media_device *mdev = origin->graph_obj.mdev; > > struct media_entity *entity = pad->entity; > > @@ -784,6 +784,9 @@ __media_pipeline_validate_one(struct media_pad *origin, > > if (has_enabled_link) > > *has_enabled_link = true; > > > > + if (skip_validation) > > + return 0; > > + > > /* Skip validation if the current pad isn't the sink pad of the link. */ > > if (link->sink != pad) > > return 0; > > @@ -825,11 +828,48 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > > return -EINVAL; > > > > /* > > - * If the pipeline has already been started, it is guaranteed to be > > - * valid, so just increase the start count. > > + * Increase start count on pipelines that have been validated > > + * earlier. Also check links with the VALIDATE_LATE flag here. > > */ > > if (pipe->start_count) { > > + struct media_link *link; > > + > > + link = __media_entity_next_link(origin->entity, NULL, > > + MEDIA_LNK_FL_DATA_LINK); > > + if (link && link->flags & MEDIA_LNK_FL_VALIDATE_LATE) { > > + struct media_link *link2 = > > + __media_entity_next_link(origin->entity, link, > > + MEDIA_LNK_FL_DATA_LINK); > > + bool has_enabled_link = false; > > + > > + /* > > + * Only a single pad is allowed for VALIDATE_LATE > > + * links. That pad needs to have exactly one link. > > + */ > > + if (origin->entity->num_pads != 1) > > + return -EINVAL; > > + > > + if (!link || link2) > > + return -EINVAL; > > This is a development error, isn't it ? Is it worth an error message ? Actually the !link check can be removed from here as it is already checked earlier. > > > + > > + dev_dbg(mdev->dev, > > + "Validating pad '%s':%u late\n", > > + origin->entity->name, origin->index); > > + > > + ret = __media_pipeline_validate_one(link->sink, > > + link->sink, link, > > + &has_enabled_link, > > + false); > > + if (ret) > > + return ret; > > + > > + if (origin->flags & MEDIA_PAD_FL_MUST_CONNECT && > > + !has_enabled_link) > > + return -ENOLINK; > > + } > > + > > pipe->start_count++; > > + > > return 0; > > } > > > > @@ -873,12 +913,19 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > > * the connected sink pad to avoid duplicating checks. > > */ > > for_each_media_entity_data_link(entity, link) { > > + /* Skip late-validated links not connected to origin. */ > > + bool skip_validation = > > + link->flags & MEDIA_LNK_FL_VALIDATE_LATE && > > + link->sink != origin && > > + link->source != origin; > > + > > /* Skip links unrelated to the current pad. */ > > if (link->sink != pad && link->source != pad) > > continue; > > > > ret = __media_pipeline_validate_one(origin, pad, link, > > - &has_enabled_link); > > + &has_enabled_link, > > + skip_validation); > > if (ret) > > goto error; > > } > > @@ -1158,6 +1205,33 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, > > if (WARN_ON(!(sink->pads[sink_pad].flags & MEDIA_PAD_FL_SINK))) > > return -EINVAL; > > > > + /* > > + * With the late validate flag, either source or sink shall have exactly > > + * one pad and no links before this one. Similarly, no links may be > > + * added to entities with a single pad and an existing late-validated > > + * link. > > + */ > > + if (flags & MEDIA_LNK_FL_VALIDATE_LATE) { > > + if (!(source->num_pads == 1 && !source->num_links) && > > + !(sink->num_pads == 1 && !sink->num_links)) > > + return -EINVAL; > > Ah, so the above error check for which I suggested an error message > cannot happen, right ? Indeed. > > > + } else { > > + struct media_entity *entities[] = { source, sink }; > > + > > + for (unsigned int i = 0; i < ARRAY_SIZE(entities); i++) { > > + if (entities[i]->num_pads != 1) > > + continue; > > + > > + struct media_link *__link = > > + __media_entity_next_link(entities[i], NULL, > > + MEDIA_LNK_FL_DATA_LINK); > > + > > + if (__link && > > + __link->flags & MEDIA_LNK_FL_VALIDATE_LATE) > > + return -EINVAL; > > + } > > + } > > + > > link = media_add_link(&source->links); > > if (link == NULL) > > return -ENOMEM; > > diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h > > index 1c80b1d6bbaf..c96e2118ea99 100644 > > --- a/include/uapi/linux/media.h > > +++ b/include/uapi/linux/media.h > > @@ -219,6 +219,7 @@ struct media_pad_desc { > > #define MEDIA_LNK_FL_ENABLED (1U << 0) > > #define MEDIA_LNK_FL_IMMUTABLE (1U << 1) > > #define MEDIA_LNK_FL_DYNAMIC (1U << 2) > > +#define MEDIA_LNK_FL_VALIDATE_LATE (1U << 3) > > Nice, with the above minors addressed, if applicable > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Thank you! > > > > > #define MEDIA_LNK_FL_LINK_TYPE (0xf << 28) > > # define MEDIA_LNK_FL_DATA_LINK (0U << 28) -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 22/29] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE 2026-04-13 7:59 ` Sakari Ailus @ 2026-04-13 9:30 ` Jacopo Mondi 0 siblings, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-13 9:30 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Sakari On Mon, Apr 13, 2026 at 10:59:19AM +0300, Sakari Ailus wrote: > Hi Jacopo, > > On Fri, Apr 10, 2026 at 12:41:27PM +0200, Jacopo Mondi wrote: > > Hi Sakari > > > > On Wed, Apr 08, 2026 at 06:39:31PM +0300, Sakari Ailus wrote: > > > Add MEDIA_LNK_FL_VALIDATE_LATE flag to support late validation of links. > > > This is serving the use case where video devices are configured and > > > started streaming indepenently of each other but this sequence may be run > > > > s/indepenently/independently > > Yes. > > > > > > in series, in such a way that a video device in a pipeline starts > > > streaming before another one is configured. > > > > > > Before this flag, drivers have resorted to implementing the link > > > validation separately for the video nodes as part of streaming start > > > sequence. > > > > > > media_pipeline_start() shall be called on each leaf entity connected to > > > the graph with a link where MEDIA_LNK_FL_VALIDATE_LATE is set before > > > uphardware operation. > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > --- > > > .../media/mediactl/media-ioc-setup-link.rst | 4 + > > > .../media/mediactl/media-types.rst | 5 ++ > > > drivers/media/mc/mc-entity.c | 82 ++++++++++++++++++- > > > include/uapi/linux/media.h | 1 + > > > 4 files changed, 88 insertions(+), 4 deletions(-) > > > > > > diff --git a/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst b/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > > > index 23208300cb61..7c2bced57e77 100644 > > > --- a/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > > > +++ b/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > > > @@ -49,6 +49,10 @@ Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled > > > while streaming media data. Attempting to enable or disable a streaming > > > non-dynamic link will return an ``EBUSY`` error code. > > > > > > +Pipeline validation may be delayed for links marked with the ``VALIDATE_LATE`` > > > > Is it helpful to say "created" instead of "marked" to highlight that > > this flag is set by drivers or is it clear enough from the context ? > > How about: > > Pipeline validation may be delayed for links with the ``VALIDATE_LATE`` flag set > until actual hardware operation even if the rest of the pipeline would be > validated at an earlier point of time. > Nice, thanks > > > > > +flag until actual hardware operation even if the rest of the pipeline would be > > > > operation or operations ? > > I'd use singular in referring what the hardware does as a whole here, but I > can rework the sentence, too. > Oh ok, no worries, as long as it was intentional it's fine > > > > > +validated at an earlier point of time. > > > + > > > If the specified link can't be found the driver returns with an ``EINVAL`` > > > error code. > > > > > > diff --git a/Documentation/userspace-api/media/mediactl/media-types.rst b/Documentation/userspace-api/media/mediactl/media-types.rst > > > index 6332e8395263..d6a690655a01 100644 > > > --- a/Documentation/userspace-api/media/mediactl/media-types.rst > > > +++ b/Documentation/userspace-api/media/mediactl/media-types.rst > > > @@ -391,6 +391,7 @@ must be set for every pad. > > > .. _MEDIA-LNK-FL-ENABLED: > > > .. _MEDIA-LNK-FL-IMMUTABLE: > > > .. _MEDIA-LNK-FL-DYNAMIC: > > > +.. _MEDIA-LNK-FL-VALIDATE-LATE: > > > .. _MEDIA-LNK-FL-LINK-TYPE: > > > > > > .. flat-table:: Media link flags > > > @@ -410,6 +411,10 @@ must be set for every pad. > > > - The link enabled state can be modified during streaming. This flag > > > is set by drivers and is read-only for applications. > > > > > > + * - ``MEDIA_LNK_FL_VALIDATE_LATE`` > > > + - The validation of the link may be delayed up to until the start of > > > > Not an English native speaker here, but "delayed up to until" sounds more > > complicated than just "delayed to" > > Yes, but I don't think it's grammatically nor factually correct. :-) > > How about: > > - The validation of the link may be delayed from the pipeline start but > it is done no later than starting streaming on the hardware. > Fine with me, up to you :) > > > > > + hardware operation. > > > + > > > * - ``MEDIA_LNK_FL_LINK_TYPE`` > > > - This is a bitmask that defines the type of the link. The following > > > link types are currently supported: > > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > > > index 287eded356bb..5b0162f81425 100644 > > > --- a/drivers/media/mc/mc-entity.c > > > +++ b/drivers/media/mc/mc-entity.c > > > @@ -771,7 +771,7 @@ static int media_pipeline_populate(struct media_pipeline *pipe, > > > static int > > > __media_pipeline_validate_one(struct media_pad *origin, > > > struct media_pad *pad, struct media_link *link, > > > - bool *has_enabled_link) > > > + bool *has_enabled_link, bool skip_validation) > > > { > > > struct media_device *mdev = origin->graph_obj.mdev; > > > struct media_entity *entity = pad->entity; > > > @@ -784,6 +784,9 @@ __media_pipeline_validate_one(struct media_pad *origin, > > > if (has_enabled_link) > > > *has_enabled_link = true; > > > > > > + if (skip_validation) > > > + return 0; > > > + > > > /* Skip validation if the current pad isn't the sink pad of the link. */ > > > if (link->sink != pad) > > > return 0; > > > @@ -825,11 +828,48 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > > > return -EINVAL; > > > > > > /* > > > - * If the pipeline has already been started, it is guaranteed to be > > > - * valid, so just increase the start count. > > > + * Increase start count on pipelines that have been validated > > > + * earlier. Also check links with the VALIDATE_LATE flag here. > > > */ > > > if (pipe->start_count) { > > > + struct media_link *link; > > > + > > > + link = __media_entity_next_link(origin->entity, NULL, > > > + MEDIA_LNK_FL_DATA_LINK); > > > + if (link && link->flags & MEDIA_LNK_FL_VALIDATE_LATE) { > > > + struct media_link *link2 = > > > + __media_entity_next_link(origin->entity, link, > > > + MEDIA_LNK_FL_DATA_LINK); > > > + bool has_enabled_link = false; > > > + > > > + /* > > > + * Only a single pad is allowed for VALIDATE_LATE > > > + * links. That pad needs to have exactly one link. > > > + */ > > > + if (origin->entity->num_pads != 1) > > > + return -EINVAL; > > > + > > > + if (!link || link2) > > > + return -EINVAL; > > > > This is a development error, isn't it ? Is it worth an error message ? > > Actually the !link check can be removed from here as it is already checked > earlier. > > > > > > + > > > + dev_dbg(mdev->dev, > > > + "Validating pad '%s':%u late\n", > > > + origin->entity->name, origin->index); > > > + > > > + ret = __media_pipeline_validate_one(link->sink, > > > + link->sink, link, > > > + &has_enabled_link, > > > + false); > > > + if (ret) > > > + return ret; > > > + > > > + if (origin->flags & MEDIA_PAD_FL_MUST_CONNECT && > > > + !has_enabled_link) > > > + return -ENOLINK; > > > + } > > > + > > > pipe->start_count++; > > > + > > > return 0; > > > } > > > > > > @@ -873,12 +913,19 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > > > * the connected sink pad to avoid duplicating checks. > > > */ > > > for_each_media_entity_data_link(entity, link) { > > > + /* Skip late-validated links not connected to origin. */ > > > + bool skip_validation = > > > + link->flags & MEDIA_LNK_FL_VALIDATE_LATE && > > > + link->sink != origin && > > > + link->source != origin; > > > + > > > /* Skip links unrelated to the current pad. */ > > > if (link->sink != pad && link->source != pad) > > > continue; > > > > > > ret = __media_pipeline_validate_one(origin, pad, link, > > > - &has_enabled_link); > > > + &has_enabled_link, > > > + skip_validation); > > > if (ret) > > > goto error; > > > } > > > @@ -1158,6 +1205,33 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, > > > if (WARN_ON(!(sink->pads[sink_pad].flags & MEDIA_PAD_FL_SINK))) > > > return -EINVAL; > > > > > > + /* > > > + * With the late validate flag, either source or sink shall have exactly > > > + * one pad and no links before this one. Similarly, no links may be > > > + * added to entities with a single pad and an existing late-validated > > > + * link. > > > + */ > > > + if (flags & MEDIA_LNK_FL_VALIDATE_LATE) { > > > + if (!(source->num_pads == 1 && !source->num_links) && > > > + !(sink->num_pads == 1 && !sink->num_links)) > > > + return -EINVAL; > > > > Ah, so the above error check for which I suggested an error message > > cannot happen, right ? > > Indeed. > > > > > > + } else { > > > + struct media_entity *entities[] = { source, sink }; > > > + > > > + for (unsigned int i = 0; i < ARRAY_SIZE(entities); i++) { > > > + if (entities[i]->num_pads != 1) > > > + continue; > > > + > > > + struct media_link *__link = > > > + __media_entity_next_link(entities[i], NULL, > > > + MEDIA_LNK_FL_DATA_LINK); > > > + > > > + if (__link && > > > + __link->flags & MEDIA_LNK_FL_VALIDATE_LATE) > > > + return -EINVAL; > > > + } > > > + } > > > + > > > link = media_add_link(&source->links); > > > if (link == NULL) > > > return -ENOMEM; > > > diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h > > > index 1c80b1d6bbaf..c96e2118ea99 100644 > > > --- a/include/uapi/linux/media.h > > > +++ b/include/uapi/linux/media.h > > > @@ -219,6 +219,7 @@ struct media_pad_desc { > > > #define MEDIA_LNK_FL_ENABLED (1U << 0) > > > #define MEDIA_LNK_FL_IMMUTABLE (1U << 1) > > > #define MEDIA_LNK_FL_DYNAMIC (1U << 2) > > > +#define MEDIA_LNK_FL_VALIDATE_LATE (1U << 3) > > > > Nice, with the above minors addressed, if applicable > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > Thank you! > Thanks j > > > > > > > > #define MEDIA_LNK_FL_LINK_TYPE (0xf << 28) > > > # define MEDIA_LNK_FL_DATA_LINK (0U << 28) > > -- > Kind regards, > > Sakari Ailus > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 22/29] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE 2026-04-08 15:39 ` [PATCH v4 22/29] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE Sakari Ailus 2026-04-10 10:41 ` Jacopo Mondi @ 2026-04-16 16:29 ` Laurent Pinchart 1 sibling, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 16:29 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:31PM +0300, Sakari Ailus wrote: > Add MEDIA_LNK_FL_VALIDATE_LATE flag to support late validation of links. > This is serving the use case where video devices are configured and > started streaming indepenently of each other but this sequence may be run > in series, in such a way that a video device in a pipeline starts > streaming before another one is configured. > > Before this flag, drivers have resorted to implementing the link > validation separately for the video nodes as part of streaming start > sequence. > > media_pipeline_start() shall be called on each leaf entity connected to > the graph with a link where MEDIA_LNK_FL_VALIDATE_LATE is set before > uphardware operation. I don't like this much, especially given that there are no users in this series, so I can't check how it's used. Let's postpone it. > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > --- > .../media/mediactl/media-ioc-setup-link.rst | 4 + > .../media/mediactl/media-types.rst | 5 ++ > drivers/media/mc/mc-entity.c | 82 ++++++++++++++++++- > include/uapi/linux/media.h | 1 + > 4 files changed, 88 insertions(+), 4 deletions(-) > > diff --git a/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst b/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > index 23208300cb61..7c2bced57e77 100644 > --- a/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > +++ b/Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst > @@ -49,6 +49,10 @@ Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled > while streaming media data. Attempting to enable or disable a streaming > non-dynamic link will return an ``EBUSY`` error code. > > +Pipeline validation may be delayed for links marked with the ``VALIDATE_LATE`` > +flag until actual hardware operation even if the rest of the pipeline would be > +validated at an earlier point of time. > + > If the specified link can't be found the driver returns with an ``EINVAL`` > error code. > > diff --git a/Documentation/userspace-api/media/mediactl/media-types.rst b/Documentation/userspace-api/media/mediactl/media-types.rst > index 6332e8395263..d6a690655a01 100644 > --- a/Documentation/userspace-api/media/mediactl/media-types.rst > +++ b/Documentation/userspace-api/media/mediactl/media-types.rst > @@ -391,6 +391,7 @@ must be set for every pad. > .. _MEDIA-LNK-FL-ENABLED: > .. _MEDIA-LNK-FL-IMMUTABLE: > .. _MEDIA-LNK-FL-DYNAMIC: > +.. _MEDIA-LNK-FL-VALIDATE-LATE: > .. _MEDIA-LNK-FL-LINK-TYPE: > > .. flat-table:: Media link flags > @@ -410,6 +411,10 @@ must be set for every pad. > - The link enabled state can be modified during streaming. This flag > is set by drivers and is read-only for applications. > > + * - ``MEDIA_LNK_FL_VALIDATE_LATE`` > + - The validation of the link may be delayed up to until the start of > + hardware operation. > + > * - ``MEDIA_LNK_FL_LINK_TYPE`` > - This is a bitmask that defines the type of the link. The following > link types are currently supported: > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > index 287eded356bb..5b0162f81425 100644 > --- a/drivers/media/mc/mc-entity.c > +++ b/drivers/media/mc/mc-entity.c > @@ -771,7 +771,7 @@ static int media_pipeline_populate(struct media_pipeline *pipe, > static int > __media_pipeline_validate_one(struct media_pad *origin, > struct media_pad *pad, struct media_link *link, > - bool *has_enabled_link) > + bool *has_enabled_link, bool skip_validation) > { > struct media_device *mdev = origin->graph_obj.mdev; > struct media_entity *entity = pad->entity; > @@ -784,6 +784,9 @@ __media_pipeline_validate_one(struct media_pad *origin, > if (has_enabled_link) > *has_enabled_link = true; > > + if (skip_validation) > + return 0; > + > /* Skip validation if the current pad isn't the sink pad of the link. */ > if (link->sink != pad) > return 0; > @@ -825,11 +828,48 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > return -EINVAL; > > /* > - * If the pipeline has already been started, it is guaranteed to be > - * valid, so just increase the start count. > + * Increase start count on pipelines that have been validated > + * earlier. Also check links with the VALIDATE_LATE flag here. > */ > if (pipe->start_count) { > + struct media_link *link; > + > + link = __media_entity_next_link(origin->entity, NULL, > + MEDIA_LNK_FL_DATA_LINK); > + if (link && link->flags & MEDIA_LNK_FL_VALIDATE_LATE) { > + struct media_link *link2 = > + __media_entity_next_link(origin->entity, link, > + MEDIA_LNK_FL_DATA_LINK); > + bool has_enabled_link = false; > + > + /* > + * Only a single pad is allowed for VALIDATE_LATE > + * links. That pad needs to have exactly one link. > + */ > + if (origin->entity->num_pads != 1) > + return -EINVAL; > + > + if (!link || link2) > + return -EINVAL; > + > + dev_dbg(mdev->dev, > + "Validating pad '%s':%u late\n", > + origin->entity->name, origin->index); > + > + ret = __media_pipeline_validate_one(link->sink, > + link->sink, link, > + &has_enabled_link, > + false); > + if (ret) > + return ret; > + > + if (origin->flags & MEDIA_PAD_FL_MUST_CONNECT && > + !has_enabled_link) > + return -ENOLINK; > + } > + > pipe->start_count++; > + > return 0; > } > > @@ -873,12 +913,19 @@ __must_check int __media_pipeline_start(struct media_pad *origin, > * the connected sink pad to avoid duplicating checks. > */ > for_each_media_entity_data_link(entity, link) { > + /* Skip late-validated links not connected to origin. */ > + bool skip_validation = > + link->flags & MEDIA_LNK_FL_VALIDATE_LATE && > + link->sink != origin && > + link->source != origin; > + > /* Skip links unrelated to the current pad. */ > if (link->sink != pad && link->source != pad) > continue; > > ret = __media_pipeline_validate_one(origin, pad, link, > - &has_enabled_link); > + &has_enabled_link, > + skip_validation); > if (ret) > goto error; > } > @@ -1158,6 +1205,33 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, > if (WARN_ON(!(sink->pads[sink_pad].flags & MEDIA_PAD_FL_SINK))) > return -EINVAL; > > + /* > + * With the late validate flag, either source or sink shall have exactly > + * one pad and no links before this one. Similarly, no links may be > + * added to entities with a single pad and an existing late-validated > + * link. > + */ > + if (flags & MEDIA_LNK_FL_VALIDATE_LATE) { > + if (!(source->num_pads == 1 && !source->num_links) && > + !(sink->num_pads == 1 && !sink->num_links)) > + return -EINVAL; > + } else { > + struct media_entity *entities[] = { source, sink }; > + > + for (unsigned int i = 0; i < ARRAY_SIZE(entities); i++) { > + if (entities[i]->num_pads != 1) > + continue; > + > + struct media_link *__link = > + __media_entity_next_link(entities[i], NULL, > + MEDIA_LNK_FL_DATA_LINK); > + > + if (__link && > + __link->flags & MEDIA_LNK_FL_VALIDATE_LATE) > + return -EINVAL; > + } > + } > + > link = media_add_link(&source->links); > if (link == NULL) > return -ENOMEM; > diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h > index 1c80b1d6bbaf..c96e2118ea99 100644 > --- a/include/uapi/linux/media.h > +++ b/include/uapi/linux/media.h > @@ -219,6 +219,7 @@ struct media_pad_desc { > #define MEDIA_LNK_FL_ENABLED (1U << 0) > #define MEDIA_LNK_FL_IMMUTABLE (1U << 1) > #define MEDIA_LNK_FL_DYNAMIC (1U << 2) > +#define MEDIA_LNK_FL_VALIDATE_LATE (1U << 3) > > #define MEDIA_LNK_FL_LINK_TYPE (0xf << 28) > # define MEDIA_LNK_FL_DATA_LINK (0U << 28) -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 23/29] media: Improve enable_streams and disable_streams documentation 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (21 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 22/29] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-16 15:49 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() Sakari Ailus ` (5 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Document that enable_streams may start additional streams and disable_streams may not disable requested streams if other related streams are still enabled. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> --- include/media/v4l2-subdev.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index d256b7ec8f84..4588992b4417 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -814,6 +814,10 @@ struct v4l2_subdev_state { * V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask * argument. * + * Starting the requested streams may require starting additional + * streams. Streams that are started together due to hardware are called a + * stream group. + * * @disable_streams: Disable the streams defined in streams_mask on the given * source pad. Subdevs that implement this operation must use the active * state management provided by the subdev core (enabled through a call to @@ -823,6 +827,9 @@ struct v4l2_subdev_state { * Drivers that support only a single stream without setting the * V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask * argument. + * + * A stream group is disabled when one or more streams in the stream + * group are disabled. */ struct v4l2_subdev_pad_ops { int (*enum_mbus_code)(struct v4l2_subdev *sd, -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 23/29] media: Improve enable_streams and disable_streams documentation 2026-04-08 15:39 ` [PATCH v4 23/29] media: Improve enable_streams and disable_streams documentation Sakari Ailus @ 2026-04-16 15:49 ` Laurent Pinchart 2026-04-21 15:35 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 15:49 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:32PM +0300, Sakari Ailus wrote: > Document that enable_streams may start additional streams and > disable_streams may not disable requested streams if other related streams > are still enabled. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > --- > include/media/v4l2-subdev.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > index d256b7ec8f84..4588992b4417 100644 > --- a/include/media/v4l2-subdev.h > +++ b/include/media/v4l2-subdev.h > @@ -814,6 +814,10 @@ struct v4l2_subdev_state { > * V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask > * argument. > * > + * Starting the requested streams may require starting additional > + * streams. Streams that are started together due to hardware are called a > + * stream group. > + * > * @disable_streams: Disable the streams defined in streams_mask on the given > * source pad. Subdevs that implement this operation must use the active > * state management provided by the subdev core (enabled through a call to > @@ -823,6 +827,9 @@ struct v4l2_subdev_state { > * Drivers that support only a single stream without setting the > * V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask > * argument. > + * > + * A stream group is disabled when one or more streams in the stream > + * group are disabled. This contradicts the commit message. Did you mean that a stream group will be disabled when all the streams it contains are disabled ? > */ > struct v4l2_subdev_pad_ops { > int (*enum_mbus_code)(struct v4l2_subdev *sd, -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 23/29] media: Improve enable_streams and disable_streams documentation 2026-04-16 15:49 ` Laurent Pinchart @ 2026-04-21 15:35 ` Sakari Ailus 0 siblings, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-21 15:35 UTC (permalink / raw) To: Laurent Pinchart Cc: linux-media, hans, 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, André 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 Hi Laurent, On Thu, Apr 16, 2026 at 06:49:14PM +0300, Laurent Pinchart wrote: > On Wed, Apr 08, 2026 at 06:39:32PM +0300, Sakari Ailus wrote: > > Document that enable_streams may start additional streams and > > disable_streams may not disable requested streams if other related streams > > are still enabled. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > > --- > > include/media/v4l2-subdev.h | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > > index d256b7ec8f84..4588992b4417 100644 > > --- a/include/media/v4l2-subdev.h > > +++ b/include/media/v4l2-subdev.h > > @@ -814,6 +814,10 @@ struct v4l2_subdev_state { > > * V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask > > * argument. > > * > > + * Starting the requested streams may require starting additional > > + * streams. Streams that are started together due to hardware are called a > > + * stream group. > > + * > > * @disable_streams: Disable the streams defined in streams_mask on the given > > * source pad. Subdevs that implement this operation must use the active > > * state management provided by the subdev core (enabled through a call to > > @@ -823,6 +827,9 @@ struct v4l2_subdev_state { > > * Drivers that support only a single stream without setting the > > * V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask > > * argument. > > + * > > + * A stream group is disabled when one or more streams in the stream > > + * group are disabled. > > This contradicts the commit message. Did you mean that a stream group > will be disabled when all the streams it contains are disabled ? It was meant to say that a stream group will stop streaming once all streams have been disabled. I'll fix this for v5. > > > */ > > struct v4l2_subdev_pad_ops { > > int (*enum_mbus_code)(struct v4l2_subdev *sd, > -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (22 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 23/29] media: Improve enable_streams and disable_streams documentation Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 10:53 ` Jacopo Mondi 2026-04-08 15:39 ` [PATCH v4 25/29] media: v4l2-subdev: Move subdev client capabilities into a new struct Sakari Ailus ` (4 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Introduce v4l2_subdev_get_frame_desc() in order to facilitate implementing drivers that need frame descriptors. If the remote sub-device does not support frame descriptors, v4l2_subdev_get_frame_desc() creates one (with a single entry) opportunistically, thus avoiding the need to add frame descriptor support to sensor drivers the device for which only generates a single stream, or managing the situation on the caller side. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/v4l2-core/v4l2-subdev.c | 96 +++++++++++++++++++++++++++ include/media/v4l2-subdev.h | 20 ++++++ 2 files changed, 116 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index 647587c0499a..40b28e070726 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -20,6 +20,7 @@ #include <linux/version.h> #include <linux/videodev2.h> +#include <media/mipi-csi2.h> #include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/v4l2-event.h> @@ -2758,3 +2759,98 @@ void v4l2_subdev_put_privacy_led(struct v4l2_subdev *sd) #endif } EXPORT_SYMBOL_GPL(v4l2_subdev_put_privacy_led); + +static int get_mipi_dt_for_mbus(u32 code) +{ + switch (code) { + case MEDIA_BUS_FMT_BGR888_1X24: + return MIPI_CSI2_DT_RGB888; + case MEDIA_BUS_FMT_Y8_1X8: + case MEDIA_BUS_FMT_SBGGR8_1X8: + case MEDIA_BUS_FMT_SGBRG8_1X8: + case MEDIA_BUS_FMT_SGRBG8_1X8: + case MEDIA_BUS_FMT_SRGGB8_1X8: + return MIPI_CSI2_DT_RAW8; + case MEDIA_BUS_FMT_Y10_1X10: + case MEDIA_BUS_FMT_SBGGR10_1X10: + case MEDIA_BUS_FMT_SGBRG10_1X10: + case MEDIA_BUS_FMT_SGRBG10_1X10: + case MEDIA_BUS_FMT_SRGGB10_1X10: + return MIPI_CSI2_DT_RAW10; + case MEDIA_BUS_FMT_Y12_1X12: + case MEDIA_BUS_FMT_SBGGR12_1X12: + case MEDIA_BUS_FMT_SGBRG12_1X12: + case MEDIA_BUS_FMT_SGRBG12_1X12: + case MEDIA_BUS_FMT_SRGGB12_1X12: + return MIPI_CSI2_DT_RAW12; + case MEDIA_BUS_FMT_Y14_1X14: + case MEDIA_BUS_FMT_SBGGR14_1X14: + case MEDIA_BUS_FMT_SGBRG14_1X14: + case MEDIA_BUS_FMT_SGRBG14_1X14: + case MEDIA_BUS_FMT_SRGGB14_1X14: + return MIPI_CSI2_DT_RAW14; + case MEDIA_BUS_FMT_Y16_1X16: + case MEDIA_BUS_FMT_SBGGR16_1X16: + case MEDIA_BUS_FMT_SGBRG16_1X16: + case MEDIA_BUS_FMT_SGRBG16_1X16: + case MEDIA_BUS_FMT_SRGGB16_1X16: + return MIPI_CSI2_DT_RAW16; + case MEDIA_BUS_FMT_SBGGR20_1X20: + case MEDIA_BUS_FMT_SGBRG20_1X20: + case MEDIA_BUS_FMT_SGRBG20_1X20: + case MEDIA_BUS_FMT_SRGGB20_1X20: + return MIPI_CSI2_DT_RAW20; + default: + return -EINVAL; + } +} + +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, + struct v4l2_mbus_frame_desc *desc) +{ + struct v4l2_subdev_format subdev_fmt = { + .which = V4L2_SUBDEV_FORMAT_ACTIVE, + .pad = pad, + }; + int ret; + + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { + unsigned int type = desc->type; + + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); + + if (desc->type != type) + return -EINVAL; + + return ret; + } + + if (desc->type != V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL && + desc->type != V4L2_MBUS_FRAME_DESC_TYPE_CSI2) + return -EINVAL; + + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, + &subdev_fmt); + if (ret) + return ret; + + struct v4l2_mbus_frame_desc_entry entry = { + .pixelcode = subdev_fmt.format.code, + }; + + if (desc->type == V4L2_MBUS_FRAME_DESC_TYPE_CSI2) { + int dt; + + dt = get_mipi_dt_for_mbus(subdev_fmt.format.code); + if (dt < 0) + return dt; + + entry.bus.csi2.dt = dt; + } + + desc->entry[0] = entry; + desc->num_entries = 1; + + return 0; +} +EXPORT_SYMBOL_GPL(v4l2_subdev_get_frame_desc); diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 4588992b4417..93b672edd08e 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -2058,4 +2058,24 @@ void v4l2_subdev_notify_event(struct v4l2_subdev *sd, */ bool v4l2_subdev_is_streaming(struct v4l2_subdev *sd); +/** + * v4l2_subdev_get_frame_desc() - Get a pad's frame descriptor + * @sd: The sub-device + * @pad: The number of the pad in @sd from which to obtain the frame descriptor + * @desc: A pointer to a frame descriptor, with its type field set + * + * Obtain a frame descriptor from a sub-device. If the sub-device supports the + * get_frame_desc pad operation, its result is returned, just like calling it + * directly using v4l2_subdev_call(). If the sub-device driver does not support + * it, then one containing a single entry is created using the information from + * the sub-device active state, which this function locks for the duration of + * the call to obtain it. + * + * The caller is required to set @desc->type to the expected bus type. + * + * Return: %0 on success or negative error code on failure. + */ +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, + struct v4l2_mbus_frame_desc *desc); + #endif /* _V4L2_SUBDEV_H */ -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-08 15:39 ` [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() Sakari Ailus @ 2026-04-10 10:53 ` Jacopo Mondi 2026-04-13 8:07 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 10:53 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:33PM +0300, Sakari Ailus wrote: > Introduce v4l2_subdev_get_frame_desc() in order to facilitate implementing > drivers that need frame descriptors. If the remote sub-device does not > support frame descriptors, v4l2_subdev_get_frame_desc() creates one (with > a single entry) opportunistically, thus avoiding the need to add frame > descriptor support to sensor drivers the device for which only generates a > single stream, or managing the situation on the caller side. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > --- > drivers/media/v4l2-core/v4l2-subdev.c | 96 +++++++++++++++++++++++++++ > include/media/v4l2-subdev.h | 20 ++++++ > 2 files changed, 116 insertions(+) > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > index 647587c0499a..40b28e070726 100644 > --- a/drivers/media/v4l2-core/v4l2-subdev.c > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > @@ -20,6 +20,7 @@ > #include <linux/version.h> > #include <linux/videodev2.h> > > +#include <media/mipi-csi2.h> > #include <media/v4l2-ctrls.h> > #include <media/v4l2-device.h> > #include <media/v4l2-event.h> > @@ -2758,3 +2759,98 @@ void v4l2_subdev_put_privacy_led(struct v4l2_subdev *sd) > #endif > } > EXPORT_SYMBOL_GPL(v4l2_subdev_put_privacy_led); > + > +static int get_mipi_dt_for_mbus(u32 code) > +{ > + switch (code) { > + case MEDIA_BUS_FMT_BGR888_1X24: > + return MIPI_CSI2_DT_RGB888; > + case MEDIA_BUS_FMT_Y8_1X8: > + case MEDIA_BUS_FMT_SBGGR8_1X8: > + case MEDIA_BUS_FMT_SGBRG8_1X8: > + case MEDIA_BUS_FMT_SGRBG8_1X8: > + case MEDIA_BUS_FMT_SRGGB8_1X8: > + return MIPI_CSI2_DT_RAW8; > + case MEDIA_BUS_FMT_Y10_1X10: > + case MEDIA_BUS_FMT_SBGGR10_1X10: > + case MEDIA_BUS_FMT_SGBRG10_1X10: > + case MEDIA_BUS_FMT_SGRBG10_1X10: > + case MEDIA_BUS_FMT_SRGGB10_1X10: > + return MIPI_CSI2_DT_RAW10; > + case MEDIA_BUS_FMT_Y12_1X12: > + case MEDIA_BUS_FMT_SBGGR12_1X12: > + case MEDIA_BUS_FMT_SGBRG12_1X12: > + case MEDIA_BUS_FMT_SGRBG12_1X12: > + case MEDIA_BUS_FMT_SRGGB12_1X12: > + return MIPI_CSI2_DT_RAW12; > + case MEDIA_BUS_FMT_Y14_1X14: > + case MEDIA_BUS_FMT_SBGGR14_1X14: > + case MEDIA_BUS_FMT_SGBRG14_1X14: > + case MEDIA_BUS_FMT_SGRBG14_1X14: > + case MEDIA_BUS_FMT_SRGGB14_1X14: > + return MIPI_CSI2_DT_RAW14; > + case MEDIA_BUS_FMT_Y16_1X16: > + case MEDIA_BUS_FMT_SBGGR16_1X16: > + case MEDIA_BUS_FMT_SGBRG16_1X16: > + case MEDIA_BUS_FMT_SGRBG16_1X16: > + case MEDIA_BUS_FMT_SRGGB16_1X16: > + return MIPI_CSI2_DT_RAW16; > + case MEDIA_BUS_FMT_SBGGR20_1X20: > + case MEDIA_BUS_FMT_SGBRG20_1X20: > + case MEDIA_BUS_FMT_SGRBG20_1X20: > + case MEDIA_BUS_FMT_SRGGB20_1X20: > + return MIPI_CSI2_DT_RAW20; > + default: > + return -EINVAL; > + } > +} > + > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > + struct v4l2_mbus_frame_desc *desc) > +{ > + struct v4l2_subdev_format subdev_fmt = { > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > + .pad = pad, > + }; > + int ret; > + > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > + unsigned int type = desc->type; > + > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > + > + if (desc->type != type) > + return -EINVAL; > + > + return ret; > + } > + > + if (desc->type != V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL && > + desc->type != V4L2_MBUS_FRAME_DESC_TYPE_CSI2) > + return -EINVAL; > + > + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, > + &subdev_fmt); > + if (ret) > + return ret; > + > + struct v4l2_mbus_frame_desc_entry entry = { > + .pixelcode = subdev_fmt.format.code, > + }; > + > + if (desc->type == V4L2_MBUS_FRAME_DESC_TYPE_CSI2) { > + int dt; > + > + dt = get_mipi_dt_for_mbus(subdev_fmt.format.code); > + if (dt < 0) > + return dt; > + > + entry.bus.csi2.dt = dt; > + } > + > + desc->entry[0] = entry; > + desc->num_entries = 1; > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(v4l2_subdev_get_frame_desc); > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > index 4588992b4417..93b672edd08e 100644 > --- a/include/media/v4l2-subdev.h > +++ b/include/media/v4l2-subdev.h > @@ -2058,4 +2058,24 @@ void v4l2_subdev_notify_event(struct v4l2_subdev *sd, > */ > bool v4l2_subdev_is_streaming(struct v4l2_subdev *sd); > > +/** > + * v4l2_subdev_get_frame_desc() - Get a pad's frame descriptor > + * @sd: The sub-device > + * @pad: The number of the pad in @sd from which to obtain the frame descriptor > + * @desc: A pointer to a frame descriptor, with its type field set > + * > + * Obtain a frame descriptor from a sub-device. If the sub-device supports the > + * get_frame_desc pad operation, its result is returned, just like calling it > + * directly using v4l2_subdev_call(). If the sub-device driver does not support > + * it, then one containing a single entry is created using the information from > + * the sub-device active state, which this function locks for the duration of > + * the call to obtain it. This doesn't seem to apply anymore... > + * > + * The caller is required to set @desc->type to the expected bus type. Is it worth mentioning that only V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL and V4L2_MBUS_FRAME_DESC_TYPE_CSI2 are supported ? > + * > + * Return: %0 on success or negative error code on failure. > + */ > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > + struct v4l2_mbus_frame_desc *desc); With the documentation addressed Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Thanks j > + > #endif /* _V4L2_SUBDEV_H */ > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-10 10:53 ` Jacopo Mondi @ 2026-04-13 8:07 ` Sakari Ailus 2026-04-16 16:16 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-13 8:07 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Jacopo, Thank you for the review. On Fri, Apr 10, 2026 at 12:53:42PM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:33PM +0300, Sakari Ailus wrote: > > Introduce v4l2_subdev_get_frame_desc() in order to facilitate implementing > > drivers that need frame descriptors. If the remote sub-device does not > > support frame descriptors, v4l2_subdev_get_frame_desc() creates one (with > > a single entry) opportunistically, thus avoiding the need to add frame > > descriptor support to sensor drivers the device for which only generates a > > single stream, or managing the situation on the caller side. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > --- > > drivers/media/v4l2-core/v4l2-subdev.c | 96 +++++++++++++++++++++++++++ > > include/media/v4l2-subdev.h | 20 ++++++ > > 2 files changed, 116 insertions(+) > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > index 647587c0499a..40b28e070726 100644 > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > @@ -20,6 +20,7 @@ > > #include <linux/version.h> > > #include <linux/videodev2.h> > > > > +#include <media/mipi-csi2.h> > > #include <media/v4l2-ctrls.h> > > #include <media/v4l2-device.h> > > #include <media/v4l2-event.h> > > @@ -2758,3 +2759,98 @@ void v4l2_subdev_put_privacy_led(struct v4l2_subdev *sd) > > #endif > > } > > EXPORT_SYMBOL_GPL(v4l2_subdev_put_privacy_led); > > + > > +static int get_mipi_dt_for_mbus(u32 code) > > +{ > > + switch (code) { > > + case MEDIA_BUS_FMT_BGR888_1X24: > > + return MIPI_CSI2_DT_RGB888; > > + case MEDIA_BUS_FMT_Y8_1X8: > > + case MEDIA_BUS_FMT_SBGGR8_1X8: > > + case MEDIA_BUS_FMT_SGBRG8_1X8: > > + case MEDIA_BUS_FMT_SGRBG8_1X8: > > + case MEDIA_BUS_FMT_SRGGB8_1X8: > > + return MIPI_CSI2_DT_RAW8; > > + case MEDIA_BUS_FMT_Y10_1X10: > > + case MEDIA_BUS_FMT_SBGGR10_1X10: > > + case MEDIA_BUS_FMT_SGBRG10_1X10: > > + case MEDIA_BUS_FMT_SGRBG10_1X10: > > + case MEDIA_BUS_FMT_SRGGB10_1X10: > > + return MIPI_CSI2_DT_RAW10; > > + case MEDIA_BUS_FMT_Y12_1X12: > > + case MEDIA_BUS_FMT_SBGGR12_1X12: > > + case MEDIA_BUS_FMT_SGBRG12_1X12: > > + case MEDIA_BUS_FMT_SGRBG12_1X12: > > + case MEDIA_BUS_FMT_SRGGB12_1X12: > > + return MIPI_CSI2_DT_RAW12; > > + case MEDIA_BUS_FMT_Y14_1X14: > > + case MEDIA_BUS_FMT_SBGGR14_1X14: > > + case MEDIA_BUS_FMT_SGBRG14_1X14: > > + case MEDIA_BUS_FMT_SGRBG14_1X14: > > + case MEDIA_BUS_FMT_SRGGB14_1X14: > > + return MIPI_CSI2_DT_RAW14; > > + case MEDIA_BUS_FMT_Y16_1X16: > > + case MEDIA_BUS_FMT_SBGGR16_1X16: > > + case MEDIA_BUS_FMT_SGBRG16_1X16: > > + case MEDIA_BUS_FMT_SGRBG16_1X16: > > + case MEDIA_BUS_FMT_SRGGB16_1X16: > > + return MIPI_CSI2_DT_RAW16; > > + case MEDIA_BUS_FMT_SBGGR20_1X20: > > + case MEDIA_BUS_FMT_SGBRG20_1X20: > > + case MEDIA_BUS_FMT_SGRBG20_1X20: > > + case MEDIA_BUS_FMT_SRGGB20_1X20: > > + return MIPI_CSI2_DT_RAW20; > > + default: > > + return -EINVAL; > > + } > > +} > > + > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > + struct v4l2_mbus_frame_desc *desc) > > +{ > > + struct v4l2_subdev_format subdev_fmt = { > > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > > + .pad = pad, > > + }; > > + int ret; > > + > > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > > + unsigned int type = desc->type; > > + > > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > > + > > + if (desc->type != type) > > + return -EINVAL; > > + > > + return ret; > > + } > > + > > + if (desc->type != V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL && > > + desc->type != V4L2_MBUS_FRAME_DESC_TYPE_CSI2) > > + return -EINVAL; > > + > > + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, > > + &subdev_fmt); > > + if (ret) > > + return ret; > > + > > + struct v4l2_mbus_frame_desc_entry entry = { > > + .pixelcode = subdev_fmt.format.code, > > + }; > > + > > + if (desc->type == V4L2_MBUS_FRAME_DESC_TYPE_CSI2) { > > + int dt; > > + > > + dt = get_mipi_dt_for_mbus(subdev_fmt.format.code); > > + if (dt < 0) > > + return dt; > > + > > + entry.bus.csi2.dt = dt; > > + } > > + > > + desc->entry[0] = entry; > > + desc->num_entries = 1; > > + > > + return 0; > > +} > > +EXPORT_SYMBOL_GPL(v4l2_subdev_get_frame_desc); > > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > > index 4588992b4417..93b672edd08e 100644 > > --- a/include/media/v4l2-subdev.h > > +++ b/include/media/v4l2-subdev.h > > @@ -2058,4 +2058,24 @@ void v4l2_subdev_notify_event(struct v4l2_subdev *sd, > > */ > > bool v4l2_subdev_is_streaming(struct v4l2_subdev *sd); > > > > +/** > > + * v4l2_subdev_get_frame_desc() - Get a pad's frame descriptor > > + * @sd: The sub-device > > + * @pad: The number of the pad in @sd from which to obtain the frame descriptor > > + * @desc: A pointer to a frame descriptor, with its type field set > > + * > > + * Obtain a frame descriptor from a sub-device. If the sub-device supports the > > + * get_frame_desc pad operation, its result is returned, just like calling it > > + * directly using v4l2_subdev_call(). If the sub-device driver does not support > > + * it, then one containing a single entry is created using the information from > > + * the sub-device active state, which this function locks for the duration of > > + * the call to obtain it. > > This doesn't seem to apply anymore... I'll rephrase it. > > > + * > > + * The caller is required to set @desc->type to the expected bus type. > > Is it worth mentioning that only V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL > and V4L2_MBUS_FRAME_DESC_TYPE_CSI2 are supported ? I'll add that. > > > > + * > > + * Return: %0 on success or negative error code on failure. > > + */ > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > + struct v4l2_mbus_frame_desc *desc); > > With the documentation addressed > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Thanks! -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-13 8:07 ` Sakari Ailus @ 2026-04-16 16:16 ` Laurent Pinchart 2026-04-21 12:18 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 16:16 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Mon, Apr 13, 2026 at 11:07:07AM +0300, Sakari Ailus wrote: > On Fri, Apr 10, 2026 at 12:53:42PM +0200, Jacopo Mondi wrote: > > On Wed, Apr 08, 2026 at 06:39:33PM +0300, Sakari Ailus wrote: > > > Introduce v4l2_subdev_get_frame_desc() in order to facilitate implementing > > > drivers that need frame descriptors. If the remote sub-device does not > > > support frame descriptors, v4l2_subdev_get_frame_desc() creates one (with > > > a single entry) opportunistically, thus avoiding the need to add frame > > > descriptor support to sensor drivers the device for which only generates a s/the device for which/whose device/ I think all sensor drivers should implement .get_frame_desc(), possibly with a helper. > > > single stream, or managing the situation on the caller side. That part I agree with, we currently need to manage the situation on the caller side because not all subdevs implement the operation. That will still be the case for a while, so this helper is useful. Can you also replace manual calls to .get_frame_desc() with the helper ? Some of the existing callers implement fallbacks, I fonud them at least in drivers/media/platform/broadcom/bcm2835-unicam.c drivers/media/platform/raspberrypi/rp1-cfe/cfe.c drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c drivers/media/platform/ti/cal/cal.c (directly in the function that calls .get_frame_desc(), or in its caller) Replacing those will ensure the helper works as expected. > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > --- > > > drivers/media/v4l2-core/v4l2-subdev.c | 96 +++++++++++++++++++++++++++ > > > include/media/v4l2-subdev.h | 20 ++++++ > > > 2 files changed, 116 insertions(+) > > > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > > index 647587c0499a..40b28e070726 100644 > > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > > @@ -20,6 +20,7 @@ > > > #include <linux/version.h> > > > #include <linux/videodev2.h> > > > > > > +#include <media/mipi-csi2.h> > > > #include <media/v4l2-ctrls.h> > > > #include <media/v4l2-device.h> > > > #include <media/v4l2-event.h> > > > @@ -2758,3 +2759,98 @@ void v4l2_subdev_put_privacy_led(struct v4l2_subdev *sd) > > > #endif > > > } > > > EXPORT_SYMBOL_GPL(v4l2_subdev_put_privacy_led); > > > + > > > +static int get_mipi_dt_for_mbus(u32 code) v4l2_subdev_get_mipi_dt_for_mbus() Or move the function to v4l2-common.c, name it mipi_csi2_dt_for_mbus() and declare it in include/media/mipi-csi2.h. > > > +{ > > > + switch (code) { > > > + case MEDIA_BUS_FMT_BGR888_1X24: > > > + return MIPI_CSI2_DT_RGB888; > > > + case MEDIA_BUS_FMT_Y8_1X8: > > > + case MEDIA_BUS_FMT_SBGGR8_1X8: > > > + case MEDIA_BUS_FMT_SGBRG8_1X8: > > > + case MEDIA_BUS_FMT_SGRBG8_1X8: > > > + case MEDIA_BUS_FMT_SRGGB8_1X8: > > > + return MIPI_CSI2_DT_RAW8; > > > + case MEDIA_BUS_FMT_Y10_1X10: > > > + case MEDIA_BUS_FMT_SBGGR10_1X10: > > > + case MEDIA_BUS_FMT_SGBRG10_1X10: > > > + case MEDIA_BUS_FMT_SGRBG10_1X10: > > > + case MEDIA_BUS_FMT_SRGGB10_1X10: > > > + return MIPI_CSI2_DT_RAW10; > > > + case MEDIA_BUS_FMT_Y12_1X12: > > > + case MEDIA_BUS_FMT_SBGGR12_1X12: > > > + case MEDIA_BUS_FMT_SGBRG12_1X12: > > > + case MEDIA_BUS_FMT_SGRBG12_1X12: > > > + case MEDIA_BUS_FMT_SRGGB12_1X12: > > > + return MIPI_CSI2_DT_RAW12; > > > + case MEDIA_BUS_FMT_Y14_1X14: > > > + case MEDIA_BUS_FMT_SBGGR14_1X14: > > > + case MEDIA_BUS_FMT_SGBRG14_1X14: > > > + case MEDIA_BUS_FMT_SGRBG14_1X14: > > > + case MEDIA_BUS_FMT_SRGGB14_1X14: > > > + return MIPI_CSI2_DT_RAW14; > > > + case MEDIA_BUS_FMT_Y16_1X16: > > > + case MEDIA_BUS_FMT_SBGGR16_1X16: > > > + case MEDIA_BUS_FMT_SGBRG16_1X16: > > > + case MEDIA_BUS_FMT_SGRBG16_1X16: > > > + case MEDIA_BUS_FMT_SRGGB16_1X16: > > > + return MIPI_CSI2_DT_RAW16; > > > + case MEDIA_BUS_FMT_SBGGR20_1X20: > > > + case MEDIA_BUS_FMT_SGBRG20_1X20: > > > + case MEDIA_BUS_FMT_SGRBG20_1X20: > > > + case MEDIA_BUS_FMT_SRGGB20_1X20: > > > + return MIPI_CSI2_DT_RAW20; > > > + default: > > > + return -EINVAL; > > > + } > > > +} > > > + > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > + struct v4l2_mbus_frame_desc *desc) > > > +{ > > > + struct v4l2_subdev_format subdev_fmt = { > > > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > > > + .pad = pad, > > > + }; > > > + int ret; > > > + > > > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > > > + unsigned int type = desc->type; > > > + > > > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > > > + > > > + if (desc->type != type) > > > + return -EINVAL; I'd add a dev_err() here. There are .get_frame_desc() callers that check if the returned type matches what they expect and log an error otherwise. When using this helper the check can't be performed in the callera any more, leading to possibly hard to debug issues if no message is printed. > > > + > > > + return ret; > > > + } > > > + > > > + if (desc->type != V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL && > > > + desc->type != V4L2_MBUS_FRAME_DESC_TYPE_CSI2) > > > + return -EINVAL; > > > + > > > + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, > > > + &subdev_fmt); > > > + if (ret) > > > + return ret; > > > + > > > + struct v4l2_mbus_frame_desc_entry entry = { > > > + .pixelcode = subdev_fmt.format.code, > > > + }; > > > + > > > + if (desc->type == V4L2_MBUS_FRAME_DESC_TYPE_CSI2) { > > > + int dt; > > > + > > > + dt = get_mipi_dt_for_mbus(subdev_fmt.format.code); > > > + if (dt < 0) > > > + return dt; > > > + > > > + entry.bus.csi2.dt = dt; > > > + } > > > + > > > + desc->entry[0] = entry; > > > + desc->num_entries = 1; > > > + > > > + return 0; > > > +} > > > +EXPORT_SYMBOL_GPL(v4l2_subdev_get_frame_desc); > > > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > > > index 4588992b4417..93b672edd08e 100644 > > > --- a/include/media/v4l2-subdev.h > > > +++ b/include/media/v4l2-subdev.h > > > @@ -2058,4 +2058,24 @@ void v4l2_subdev_notify_event(struct v4l2_subdev *sd, > > > */ > > > bool v4l2_subdev_is_streaming(struct v4l2_subdev *sd); > > > > > > +/** > > > + * v4l2_subdev_get_frame_desc() - Get a pad's frame descriptor > > > + * @sd: The sub-device > > > + * @pad: The number of the pad in @sd from which to obtain the frame descriptor > > > + * @desc: A pointer to a frame descriptor, with its type field set > > > + * > > > + * Obtain a frame descriptor from a sub-device. If the sub-device supports the > > > + * get_frame_desc pad operation, its result is returned, just like calling it > > > + * directly using v4l2_subdev_call(). If the sub-device driver does not support > > > + * it, then one containing a single entry is created using the information from s/one /a frame descriptor/ > > > + * the sub-device active state, which this function locks for the duration of > > > + * the call to obtain it. > > > > This doesn't seem to apply anymore... > > I'll rephrase it. > > > > + * > > > + * The caller is required to set @desc->type to the expected bus type. > > > > Is it worth mentioning that only V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL > > and V4L2_MBUS_FRAME_DESC_TYPE_CSI2 are supported ? > > I'll add that. > > > > + * > > > + * Return: %0 on success or negative error code on failure. > > > + */ > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > + struct v4l2_mbus_frame_desc *desc); > > > > With the documentation addressed > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-16 16:16 ` Laurent Pinchart @ 2026-04-21 12:18 ` Sakari Ailus 2026-04-21 22:18 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-21 12:18 UTC (permalink / raw) To: Laurent Pinchart Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Laurent, On Thu, Apr 16, 2026 at 07:16:54PM +0300, Laurent Pinchart wrote: > On Mon, Apr 13, 2026 at 11:07:07AM +0300, Sakari Ailus wrote: > > On Fri, Apr 10, 2026 at 12:53:42PM +0200, Jacopo Mondi wrote: > > > On Wed, Apr 08, 2026 at 06:39:33PM +0300, Sakari Ailus wrote: > > > > Introduce v4l2_subdev_get_frame_desc() in order to facilitate implementing > > > > drivers that need frame descriptors. If the remote sub-device does not > > > > support frame descriptors, v4l2_subdev_get_frame_desc() creates one (with > > > > a single entry) opportunistically, thus avoiding the need to add frame > > > > descriptor support to sensor drivers the device for which only generates a > > s/the device for which/whose device/ I guess that'd work, too. > > I think all sensor drivers should implement .get_frame_desc(), possibly > with a helper. Is there a need to? It's largely just extra churn for more than 80 drivers -- this can also be extended to cover routes so few of these drivers would in the end need anything driver-specific. But the option for that needs to remain. > > > > > single stream, or managing the situation on the caller side. > > That part I agree with, we currently need to manage the situation on the > caller side because not all subdevs implement the operation. That will > still be the case for a while, so this helper is useful. > > Can you also replace manual calls to .get_frame_desc() with the helper ? > Some of the existing callers implement fallbacks, I fonud them at least > in > > drivers/media/platform/broadcom/bcm2835-unicam.c > drivers/media/platform/raspberrypi/rp1-cfe/cfe.c > drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c > drivers/media/platform/ti/cal/cal.c > > (directly in the function that calls .get_frame_desc(), or in its > caller) > > Replacing those will ensure the helper works as expected. Sure. I'll add more patches for that. > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > --- > > > > drivers/media/v4l2-core/v4l2-subdev.c | 96 +++++++++++++++++++++++++++ > > > > include/media/v4l2-subdev.h | 20 ++++++ > > > > 2 files changed, 116 insertions(+) > > > > > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > > > index 647587c0499a..40b28e070726 100644 > > > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > > > @@ -20,6 +20,7 @@ > > > > #include <linux/version.h> > > > > #include <linux/videodev2.h> > > > > > > > > +#include <media/mipi-csi2.h> > > > > #include <media/v4l2-ctrls.h> > > > > #include <media/v4l2-device.h> > > > > #include <media/v4l2-event.h> > > > > @@ -2758,3 +2759,98 @@ void v4l2_subdev_put_privacy_led(struct v4l2_subdev *sd) > > > > #endif > > > > } > > > > EXPORT_SYMBOL_GPL(v4l2_subdev_put_privacy_led); > > > > + > > > > +static int get_mipi_dt_for_mbus(u32 code) > > v4l2_subdev_get_mipi_dt_for_mbus() > > Or move the function to v4l2-common.c, name it mipi_csi2_dt_for_mbus() > and declare it in include/media/mipi-csi2.h. How about calling it mipi_csi2_dt_for_mbus()? I think it can be located in v4l2-common.c for now, no need to add a separate file just for this; all users would effectively be related to V4L2 anyway. > > > > > +{ > > > > + switch (code) { > > > > + case MEDIA_BUS_FMT_BGR888_1X24: > > > > + return MIPI_CSI2_DT_RGB888; > > > > + case MEDIA_BUS_FMT_Y8_1X8: > > > > + case MEDIA_BUS_FMT_SBGGR8_1X8: > > > > + case MEDIA_BUS_FMT_SGBRG8_1X8: > > > > + case MEDIA_BUS_FMT_SGRBG8_1X8: > > > > + case MEDIA_BUS_FMT_SRGGB8_1X8: > > > > + return MIPI_CSI2_DT_RAW8; > > > > + case MEDIA_BUS_FMT_Y10_1X10: > > > > + case MEDIA_BUS_FMT_SBGGR10_1X10: > > > > + case MEDIA_BUS_FMT_SGBRG10_1X10: > > > > + case MEDIA_BUS_FMT_SGRBG10_1X10: > > > > + case MEDIA_BUS_FMT_SRGGB10_1X10: > > > > + return MIPI_CSI2_DT_RAW10; > > > > + case MEDIA_BUS_FMT_Y12_1X12: > > > > + case MEDIA_BUS_FMT_SBGGR12_1X12: > > > > + case MEDIA_BUS_FMT_SGBRG12_1X12: > > > > + case MEDIA_BUS_FMT_SGRBG12_1X12: > > > > + case MEDIA_BUS_FMT_SRGGB12_1X12: > > > > + return MIPI_CSI2_DT_RAW12; > > > > + case MEDIA_BUS_FMT_Y14_1X14: > > > > + case MEDIA_BUS_FMT_SBGGR14_1X14: > > > > + case MEDIA_BUS_FMT_SGBRG14_1X14: > > > > + case MEDIA_BUS_FMT_SGRBG14_1X14: > > > > + case MEDIA_BUS_FMT_SRGGB14_1X14: > > > > + return MIPI_CSI2_DT_RAW14; > > > > + case MEDIA_BUS_FMT_Y16_1X16: > > > > + case MEDIA_BUS_FMT_SBGGR16_1X16: > > > > + case MEDIA_BUS_FMT_SGBRG16_1X16: > > > > + case MEDIA_BUS_FMT_SGRBG16_1X16: > > > > + case MEDIA_BUS_FMT_SRGGB16_1X16: > > > > + return MIPI_CSI2_DT_RAW16; > > > > + case MEDIA_BUS_FMT_SBGGR20_1X20: > > > > + case MEDIA_BUS_FMT_SGBRG20_1X20: > > > > + case MEDIA_BUS_FMT_SGRBG20_1X20: > > > > + case MEDIA_BUS_FMT_SRGGB20_1X20: > > > > + return MIPI_CSI2_DT_RAW20; > > > > + default: > > > > + return -EINVAL; > > > > + } > > > > +} > > > > + > > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > > + struct v4l2_mbus_frame_desc *desc) > > > > +{ > > > > + struct v4l2_subdev_format subdev_fmt = { > > > > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > > > > + .pad = pad, > > > > + }; > > > > + int ret; > > > > + > > > > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > > > > + unsigned int type = desc->type; > > > > + > > > > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > > > > + > > > > + if (desc->type != type) > > > > + return -EINVAL; > > I'd add a dev_err() here. There are .get_frame_desc() callers that check > if the returned type matches what they expect and log an error > otherwise. When using this helper the check can't be performed in the > callera any more, leading to possibly hard to debug issues if no message > is printed. dev_err_once()? > > > > > + > > > > + return ret; > > > > + } > > > > + > > > > + if (desc->type != V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL && > > > > + desc->type != V4L2_MBUS_FRAME_DESC_TYPE_CSI2) > > > > + return -EINVAL; > > > > + > > > > + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, > > > > + &subdev_fmt); > > > > + if (ret) > > > > + return ret; > > > > + > > > > + struct v4l2_mbus_frame_desc_entry entry = { > > > > + .pixelcode = subdev_fmt.format.code, > > > > + }; > > > > + > > > > + if (desc->type == V4L2_MBUS_FRAME_DESC_TYPE_CSI2) { > > > > + int dt; > > > > + > > > > + dt = get_mipi_dt_for_mbus(subdev_fmt.format.code); > > > > + if (dt < 0) > > > > + return dt; > > > > + > > > > + entry.bus.csi2.dt = dt; > > > > + } > > > > + > > > > + desc->entry[0] = entry; > > > > + desc->num_entries = 1; > > > > + > > > > + return 0; > > > > +} > > > > +EXPORT_SYMBOL_GPL(v4l2_subdev_get_frame_desc); > > > > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > > > > index 4588992b4417..93b672edd08e 100644 > > > > --- a/include/media/v4l2-subdev.h > > > > +++ b/include/media/v4l2-subdev.h > > > > @@ -2058,4 +2058,24 @@ void v4l2_subdev_notify_event(struct v4l2_subdev *sd, > > > > */ > > > > bool v4l2_subdev_is_streaming(struct v4l2_subdev *sd); > > > > > > > > +/** > > > > + * v4l2_subdev_get_frame_desc() - Get a pad's frame descriptor > > > > + * @sd: The sub-device > > > > + * @pad: The number of the pad in @sd from which to obtain the frame descriptor > > > > + * @desc: A pointer to a frame descriptor, with its type field set > > > > + * > > > > + * Obtain a frame descriptor from a sub-device. If the sub-device supports the > > > > + * get_frame_desc pad operation, its result is returned, just like calling it > > > > + * directly using v4l2_subdev_call(). If the sub-device driver does not support > > > > + * it, then one containing a single entry is created using the information from > > s/one /a frame descriptor/ Yes. > > > > > + * the sub-device active state, which this function locks for the duration of > > > > + * the call to obtain it. > > > > > > This doesn't seem to apply anymore... > > > > I'll rephrase it. > > > > > > + * > > > > + * The caller is required to set @desc->type to the expected bus type. > > > > > > Is it worth mentioning that only V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL > > > and V4L2_MBUS_FRAME_DESC_TYPE_CSI2 are supported ? > > > > I'll add that. > > > > > > + * > > > > + * Return: %0 on success or negative error code on failure. > > > > + */ > > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > > + struct v4l2_mbus_frame_desc *desc); > > > > > > With the documentation addressed > > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-21 12:18 ` Sakari Ailus @ 2026-04-21 22:18 ` Laurent Pinchart 2026-04-22 8:26 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-21 22:18 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Tue, Apr 21, 2026 at 03:18:26PM +0300, Sakari Ailus wrote: > On Thu, Apr 16, 2026 at 07:16:54PM +0300, Laurent Pinchart wrote: > > On Mon, Apr 13, 2026 at 11:07:07AM +0300, Sakari Ailus wrote: > > > On Fri, Apr 10, 2026 at 12:53:42PM +0200, Jacopo Mondi wrote: > > > > On Wed, Apr 08, 2026 at 06:39:33PM +0300, Sakari Ailus wrote: > > > > > Introduce v4l2_subdev_get_frame_desc() in order to facilitate implementing > > > > > drivers that need frame descriptors. If the remote sub-device does not > > > > > support frame descriptors, v4l2_subdev_get_frame_desc() creates one (with > > > > > a single entry) opportunistically, thus avoiding the need to add frame > > > > > descriptor support to sensor drivers the device for which only generates a > > > > s/the device for which/whose device/ > > I guess that'd work, too. > > > I think all sensor drivers should implement .get_frame_desc(), possibly > > with a helper. > > Is there a need to? It's largely just extra churn for more than 80 drivers > -- this can also be extended to cover routes so few of these drivers would > in the end need anything driver-specific. But the option for that needs to > remain. I don't think it's much extra churn if the operation can be implemented with a helper. It would be a single additional line to plug the helper in the ops table, and it won't consume more memory. This is certainly not high on the todo list, and once we get there, maybe you will convinced me that handling missing .get_frame_desc() in v4l2_subdev_get_frame_desc() is the better option :-) > > > > > single stream, or managing the situation on the caller side. > > > > That part I agree with, we currently need to manage the situation on the > > caller side because not all subdevs implement the operation. That will > > still be the case for a while, so this helper is useful. > > > > Can you also replace manual calls to .get_frame_desc() with the helper ? > > Some of the existing callers implement fallbacks, I fonud them at least > > in > > > > drivers/media/platform/broadcom/bcm2835-unicam.c > > drivers/media/platform/raspberrypi/rp1-cfe/cfe.c > > drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c > > drivers/media/platform/ti/cal/cal.c > > > > (directly in the function that calls .get_frame_desc(), or in its > > caller) > > > > Replacing those will ensure the helper works as expected. > > Sure. I'll add more patches for that. > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > > --- > > > > > drivers/media/v4l2-core/v4l2-subdev.c | 96 +++++++++++++++++++++++++++ > > > > > include/media/v4l2-subdev.h | 20 ++++++ > > > > > 2 files changed, 116 insertions(+) > > > > > > > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > > > > index 647587c0499a..40b28e070726 100644 > > > > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > > > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > > > > @@ -20,6 +20,7 @@ > > > > > #include <linux/version.h> > > > > > #include <linux/videodev2.h> > > > > > > > > > > +#include <media/mipi-csi2.h> > > > > > #include <media/v4l2-ctrls.h> > > > > > #include <media/v4l2-device.h> > > > > > #include <media/v4l2-event.h> > > > > > @@ -2758,3 +2759,98 @@ void v4l2_subdev_put_privacy_led(struct v4l2_subdev *sd) > > > > > #endif > > > > > } > > > > > EXPORT_SYMBOL_GPL(v4l2_subdev_put_privacy_led); > > > > > + > > > > > +static int get_mipi_dt_for_mbus(u32 code) > > > > v4l2_subdev_get_mipi_dt_for_mbus() > > > > Or move the function to v4l2-common.c, name it mipi_csi2_dt_for_mbus() > > and declare it in include/media/mipi-csi2.h. > > How about calling it mipi_csi2_dt_for_mbus()? I think it can be located in > v4l2-common.c for now, no need to add a separate file just for this; all > users would effectively be related to V4L2 anyway. Yes, that's what I proposed :-) > > > > > +{ > > > > > + switch (code) { > > > > > + case MEDIA_BUS_FMT_BGR888_1X24: > > > > > + return MIPI_CSI2_DT_RGB888; > > > > > + case MEDIA_BUS_FMT_Y8_1X8: > > > > > + case MEDIA_BUS_FMT_SBGGR8_1X8: > > > > > + case MEDIA_BUS_FMT_SGBRG8_1X8: > > > > > + case MEDIA_BUS_FMT_SGRBG8_1X8: > > > > > + case MEDIA_BUS_FMT_SRGGB8_1X8: > > > > > + return MIPI_CSI2_DT_RAW8; > > > > > + case MEDIA_BUS_FMT_Y10_1X10: > > > > > + case MEDIA_BUS_FMT_SBGGR10_1X10: > > > > > + case MEDIA_BUS_FMT_SGBRG10_1X10: > > > > > + case MEDIA_BUS_FMT_SGRBG10_1X10: > > > > > + case MEDIA_BUS_FMT_SRGGB10_1X10: > > > > > + return MIPI_CSI2_DT_RAW10; > > > > > + case MEDIA_BUS_FMT_Y12_1X12: > > > > > + case MEDIA_BUS_FMT_SBGGR12_1X12: > > > > > + case MEDIA_BUS_FMT_SGBRG12_1X12: > > > > > + case MEDIA_BUS_FMT_SGRBG12_1X12: > > > > > + case MEDIA_BUS_FMT_SRGGB12_1X12: > > > > > + return MIPI_CSI2_DT_RAW12; > > > > > + case MEDIA_BUS_FMT_Y14_1X14: > > > > > + case MEDIA_BUS_FMT_SBGGR14_1X14: > > > > > + case MEDIA_BUS_FMT_SGBRG14_1X14: > > > > > + case MEDIA_BUS_FMT_SGRBG14_1X14: > > > > > + case MEDIA_BUS_FMT_SRGGB14_1X14: > > > > > + return MIPI_CSI2_DT_RAW14; > > > > > + case MEDIA_BUS_FMT_Y16_1X16: > > > > > + case MEDIA_BUS_FMT_SBGGR16_1X16: > > > > > + case MEDIA_BUS_FMT_SGBRG16_1X16: > > > > > + case MEDIA_BUS_FMT_SGRBG16_1X16: > > > > > + case MEDIA_BUS_FMT_SRGGB16_1X16: > > > > > + return MIPI_CSI2_DT_RAW16; > > > > > + case MEDIA_BUS_FMT_SBGGR20_1X20: > > > > > + case MEDIA_BUS_FMT_SGBRG20_1X20: > > > > > + case MEDIA_BUS_FMT_SGRBG20_1X20: > > > > > + case MEDIA_BUS_FMT_SRGGB20_1X20: > > > > > + return MIPI_CSI2_DT_RAW20; > > > > > + default: > > > > > + return -EINVAL; > > > > > + } > > > > > +} > > > > > + > > > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > > > + struct v4l2_mbus_frame_desc *desc) > > > > > +{ > > > > > + struct v4l2_subdev_format subdev_fmt = { > > > > > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > > > > > + .pad = pad, > > > > > + }; > > > > > + int ret; > > > > > + > > > > > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > > > > > + unsigned int type = desc->type; > > > > > + > > > > > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > > > > > + > > > > > + if (desc->type != type) > > > > > + return -EINVAL; > > > > I'd add a dev_err() here. There are .get_frame_desc() callers that check > > if the returned type matches what they expect and log an error > > otherwise. When using this helper the check can't be performed in the > > callera any more, leading to possibly hard to debug issues if no message > > is printed. > > dev_err_once()? Is there a need to limit it to printing the message once only ? It will only occur if an incompatible source is connected, which shouldn't happen in normal circumstances. > > > > > + > > > > > + return ret; > > > > > + } > > > > > + > > > > > + if (desc->type != V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL && > > > > > + desc->type != V4L2_MBUS_FRAME_DESC_TYPE_CSI2) > > > > > + return -EINVAL; > > > > > + > > > > > + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, > > > > > + &subdev_fmt); > > > > > + if (ret) > > > > > + return ret; > > > > > + > > > > > + struct v4l2_mbus_frame_desc_entry entry = { > > > > > + .pixelcode = subdev_fmt.format.code, > > > > > + }; > > > > > + > > > > > + if (desc->type == V4L2_MBUS_FRAME_DESC_TYPE_CSI2) { > > > > > + int dt; > > > > > + > > > > > + dt = get_mipi_dt_for_mbus(subdev_fmt.format.code); > > > > > + if (dt < 0) > > > > > + return dt; > > > > > + > > > > > + entry.bus.csi2.dt = dt; > > > > > + } > > > > > + > > > > > + desc->entry[0] = entry; > > > > > + desc->num_entries = 1; > > > > > + > > > > > + return 0; > > > > > +} > > > > > +EXPORT_SYMBOL_GPL(v4l2_subdev_get_frame_desc); > > > > > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > > > > > index 4588992b4417..93b672edd08e 100644 > > > > > --- a/include/media/v4l2-subdev.h > > > > > +++ b/include/media/v4l2-subdev.h > > > > > @@ -2058,4 +2058,24 @@ void v4l2_subdev_notify_event(struct v4l2_subdev *sd, > > > > > */ > > > > > bool v4l2_subdev_is_streaming(struct v4l2_subdev *sd); > > > > > > > > > > +/** > > > > > + * v4l2_subdev_get_frame_desc() - Get a pad's frame descriptor > > > > > + * @sd: The sub-device > > > > > + * @pad: The number of the pad in @sd from which to obtain the frame descriptor > > > > > + * @desc: A pointer to a frame descriptor, with its type field set > > > > > + * > > > > > + * Obtain a frame descriptor from a sub-device. If the sub-device supports the > > > > > + * get_frame_desc pad operation, its result is returned, just like calling it > > > > > + * directly using v4l2_subdev_call(). If the sub-device driver does not support > > > > > + * it, then one containing a single entry is created using the information from > > > > s/one /a frame descriptor/ > > Yes. > > > > > > + * the sub-device active state, which this function locks for the duration of > > > > > + * the call to obtain it. > > > > > > > > This doesn't seem to apply anymore... > > > > > > I'll rephrase it. > > > > > > > > + * > > > > > + * The caller is required to set @desc->type to the expected bus type. > > > > > > > > Is it worth mentioning that only V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL > > > > and V4L2_MBUS_FRAME_DESC_TYPE_CSI2 are supported ? > > > > > > I'll add that. > > > > > > > > + * > > > > > + * Return: %0 on success or negative error code on failure. > > > > > + */ > > > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > > > + struct v4l2_mbus_frame_desc *desc); > > > > > > > > With the documentation addressed > > > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-21 22:18 ` Laurent Pinchart @ 2026-04-22 8:26 ` Sakari Ailus 2026-04-22 9:02 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-22 8:26 UTC (permalink / raw) To: Laurent Pinchart Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Laurent, On Wed, Apr 22, 2026 at 01:18:17AM +0300, Laurent Pinchart wrote: > > > > > > +static int get_mipi_dt_for_mbus(u32 code) > > > > > > v4l2_subdev_get_mipi_dt_for_mbus() > > > > > > Or move the function to v4l2-common.c, name it mipi_csi2_dt_for_mbus() > > > and declare it in include/media/mipi-csi2.h. > > > > How about calling it mipi_csi2_dt_for_mbus()? I think it can be located in > > v4l2-common.c for now, no need to add a separate file just for this; all > > users would effectively be related to V4L2 anyway. > > Yes, that's what I proposed :-) Well, that's good then. :-) ... > > > > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > > > > + struct v4l2_mbus_frame_desc *desc) > > > > > > +{ > > > > > > + struct v4l2_subdev_format subdev_fmt = { > > > > > > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > > > > > > + .pad = pad, > > > > > > + }; > > > > > > + int ret; > > > > > > + > > > > > > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > > > > > > + unsigned int type = desc->type; > > > > > > + > > > > > > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > > > > > > + > > > > > > + if (desc->type != type) > > > > > > + return -EINVAL; > > > > > > I'd add a dev_err() here. There are .get_frame_desc() callers that check > > > if the returned type matches what they expect and log an error > > > otherwise. When using this helper the check can't be performed in the > > > callera any more, leading to possibly hard to debug issues if no message > > > is printed. > > > > dev_err_once()? > > Is there a need to limit it to printing the message once only ? It will > only occur if an incompatible source is connected, which shouldn't > happen in normal circumstances. Yes, but still enables filling logs with that message. A single one in this case should be enough. -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-22 8:26 ` Sakari Ailus @ 2026-04-22 9:02 ` Laurent Pinchart 2026-04-22 10:02 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-22 9:02 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Wed, Apr 22, 2026 at 11:26:56AM +0300, Sakari Ailus wrote: > On Wed, Apr 22, 2026 at 01:18:17AM +0300, Laurent Pinchart wrote: > > > > > > > +static int get_mipi_dt_for_mbus(u32 code) > > > > > > > > v4l2_subdev_get_mipi_dt_for_mbus() > > > > > > > > Or move the function to v4l2-common.c, name it mipi_csi2_dt_for_mbus() > > > > and declare it in include/media/mipi-csi2.h. > > > > > > How about calling it mipi_csi2_dt_for_mbus()? I think it can be located in > > > v4l2-common.c for now, no need to add a separate file just for this; all > > > users would effectively be related to V4L2 anyway. > > > > Yes, that's what I proposed :-) > > Well, that's good then. :-) > > ... > > > > > > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > > > > > + struct v4l2_mbus_frame_desc *desc) > > > > > > > +{ > > > > > > > + struct v4l2_subdev_format subdev_fmt = { > > > > > > > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > > > > > > > + .pad = pad, > > > > > > > + }; > > > > > > > + int ret; > > > > > > > + > > > > > > > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > > > > > > > + unsigned int type = desc->type; > > > > > > > + > > > > > > > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > > > > > > > + > > > > > > > + if (desc->type != type) > > > > > > > + return -EINVAL; > > > > > > > > I'd add a dev_err() here. There are .get_frame_desc() callers that check > > > > if the returned type matches what they expect and log an error > > > > otherwise. When using this helper the check can't be performed in the > > > > callera any more, leading to possibly hard to debug issues if no message > > > > is printed. > > > > > > dev_err_once()? > > > > Is there a need to limit it to printing the message once only ? It will > > only occur if an incompatible source is connected, which shouldn't > > happen in normal circumstances. > > Yes, but still enables filling logs with that message. A single one in this > case should be enough. Is it user-triggerable without a serious bug in drivers ? -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-22 9:02 ` Laurent Pinchart @ 2026-04-22 10:02 ` Sakari Ailus 2026-04-22 10:47 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-22 10:02 UTC (permalink / raw) To: Laurent Pinchart Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Wed, Apr 22, 2026 at 12:02:56PM +0300, Laurent Pinchart wrote: > > > > > > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > > > > > > + struct v4l2_mbus_frame_desc *desc) > > > > > > > > +{ > > > > > > > > + struct v4l2_subdev_format subdev_fmt = { > > > > > > > > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > > > > > > > > + .pad = pad, > > > > > > > > + }; > > > > > > > > + int ret; > > > > > > > > + > > > > > > > > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > > > > > > > > + unsigned int type = desc->type; > > > > > > > > + > > > > > > > > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > > > > > > > > + > > > > > > > > + if (desc->type != type) > > > > > > > > + return -EINVAL; > > > > > > > > > > I'd add a dev_err() here. There are .get_frame_desc() callers that check > > > > > if the returned type matches what they expect and log an error > > > > > otherwise. When using this helper the check can't be performed in the > > > > > callera any more, leading to possibly hard to debug issues if no message > > > > > is printed. > > > > > > > > dev_err_once()? > > > > > > Is there a need to limit it to printing the message once only ? It will > > > only occur if an incompatible source is connected, which shouldn't > > > happen in normal circumstances. > > > > Yes, but still enables filling logs with that message. A single one in this > > case should be enough. > > Is it user-triggerable without a serious bug in drivers ? No. But one message still tells about the problem, doesn't it? -- Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-22 10:02 ` Sakari Ailus @ 2026-04-22 10:47 ` Laurent Pinchart 2026-04-22 10:48 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-22 10:47 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Wed, Apr 22, 2026 at 01:02:32PM +0300, Sakari Ailus wrote: > On Wed, Apr 22, 2026 at 12:02:56PM +0300, Laurent Pinchart wrote: > > > > > > > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > > > > > > > + struct v4l2_mbus_frame_desc *desc) > > > > > > > > > +{ > > > > > > > > > + struct v4l2_subdev_format subdev_fmt = { > > > > > > > > > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > > > > > > > > > + .pad = pad, > > > > > > > > > + }; > > > > > > > > > + int ret; > > > > > > > > > + > > > > > > > > > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > > > > > > > > > + unsigned int type = desc->type; > > > > > > > > > + > > > > > > > > > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > > > > > > > > > + > > > > > > > > > + if (desc->type != type) > > > > > > > > > + return -EINVAL; > > > > > > > > > > > > I'd add a dev_err() here. There are .get_frame_desc() callers that check > > > > > > if the returned type matches what they expect and log an error > > > > > > otherwise. When using this helper the check can't be performed in the > > > > > > callera any more, leading to possibly hard to debug issues if no message > > > > > > is printed. > > > > > > > > > > dev_err_once()? > > > > > > > > Is there a need to limit it to printing the message once only ? It will > > > > only occur if an incompatible source is connected, which shouldn't > > > > happen in normal circumstances. > > > > > > Yes, but still enables filling logs with that message. A single one in this > > > case should be enough. > > > > Is it user-triggerable without a serious bug in drivers ? > > No. But one message still tells about the problem, doesn't it? Yes, but it then means a reboot is necessary during development every time this error occurs. It also means that if two errors originate from different callers only one message will be printed, which is also not optimal for development. If this error was triggerable by userspace in normal circumstances then I'd still avoid _once() but go for dev_dbg(). -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-22 10:47 ` Laurent Pinchart @ 2026-04-22 10:48 ` Sakari Ailus 2026-04-22 10:54 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-22 10:48 UTC (permalink / raw) To: Laurent Pinchart Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Wed, Apr 22, 2026 at 01:47:29PM +0300, Laurent Pinchart wrote: > On Wed, Apr 22, 2026 at 01:02:32PM +0300, Sakari Ailus wrote: > > On Wed, Apr 22, 2026 at 12:02:56PM +0300, Laurent Pinchart wrote: > > > > > > > > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > > > > > > > > + struct v4l2_mbus_frame_desc *desc) > > > > > > > > > > +{ > > > > > > > > > > + struct v4l2_subdev_format subdev_fmt = { > > > > > > > > > > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > > > > > > > > > > + .pad = pad, > > > > > > > > > > + }; > > > > > > > > > > + int ret; > > > > > > > > > > + > > > > > > > > > > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > > > > > > > > > > + unsigned int type = desc->type; > > > > > > > > > > + > > > > > > > > > > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > > > > > > > > > > + > > > > > > > > > > + if (desc->type != type) > > > > > > > > > > + return -EINVAL; > > > > > > > > > > > > > > I'd add a dev_err() here. There are .get_frame_desc() callers that check > > > > > > > if the returned type matches what they expect and log an error > > > > > > > otherwise. When using this helper the check can't be performed in the > > > > > > > callera any more, leading to possibly hard to debug issues if no message > > > > > > > is printed. > > > > > > > > > > > > dev_err_once()? > > > > > > > > > > Is there a need to limit it to printing the message once only ? It will > > > > > only occur if an incompatible source is connected, which shouldn't > > > > > happen in normal circumstances. > > > > > > > > Yes, but still enables filling logs with that message. A single one in this > > > > case should be enough. > > > > > > Is it user-triggerable without a serious bug in drivers ? > > > > No. But one message still tells about the problem, doesn't it? > > Yes, but it then means a reboot is necessary during development every > time this error occurs. It also means that if two errors originate from > different callers only one message will be printed, which is also not > optimal for development. > > If this error was triggerable by userspace in normal circumstances then > I'd still avoid _once() but go for dev_dbg(). Presumably anyone debugging this would have dynamic debug enabled here. So dev_dbg()? -- Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() 2026-04-22 10:48 ` Sakari Ailus @ 2026-04-22 10:54 ` Laurent Pinchart 0 siblings, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-22 10:54 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Wed, Apr 22, 2026 at 01:48:58PM +0300, Sakari Ailus wrote: > On Wed, Apr 22, 2026 at 01:47:29PM +0300, Laurent Pinchart wrote: > > On Wed, Apr 22, 2026 at 01:02:32PM +0300, Sakari Ailus wrote: > > > On Wed, Apr 22, 2026 at 12:02:56PM +0300, Laurent Pinchart wrote: > > > > > > > > > > > +int v4l2_subdev_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > > > > > > > > > > > + struct v4l2_mbus_frame_desc *desc) > > > > > > > > > > > +{ > > > > > > > > > > > + struct v4l2_subdev_format subdev_fmt = { > > > > > > > > > > > + .which = V4L2_SUBDEV_FORMAT_ACTIVE, > > > > > > > > > > > + .pad = pad, > > > > > > > > > > > + }; > > > > > > > > > > > + int ret; > > > > > > > > > > > + > > > > > > > > > > > + if (v4l2_subdev_has_op(sd, pad, get_frame_desc)) { > > > > > > > > > > > + unsigned int type = desc->type; > > > > > > > > > > > + > > > > > > > > > > > + ret = v4l2_subdev_call(sd, pad, get_frame_desc, pad, desc); > > > > > > > > > > > + > > > > > > > > > > > + if (desc->type != type) > > > > > > > > > > > + return -EINVAL; > > > > > > > > > > > > > > > > I'd add a dev_err() here. There are .get_frame_desc() callers that check > > > > > > > > if the returned type matches what they expect and log an error > > > > > > > > otherwise. When using this helper the check can't be performed in the > > > > > > > > callera any more, leading to possibly hard to debug issues if no message > > > > > > > > is printed. > > > > > > > > > > > > > > dev_err_once()? > > > > > > > > > > > > Is there a need to limit it to printing the message once only ? It will > > > > > > only occur if an incompatible source is connected, which shouldn't > > > > > > happen in normal circumstances. > > > > > > > > > > Yes, but still enables filling logs with that message. A single one in this > > > > > case should be enough. > > > > > > > > Is it user-triggerable without a serious bug in drivers ? > > > > > > No. But one message still tells about the problem, doesn't it? > > > > Yes, but it then means a reboot is necessary during development every > > time this error occurs. It also means that if two errors originate from > > different callers only one message will be printed, which is also not > > optimal for development. > > > > If this error was triggerable by userspace in normal circumstances then > > I'd still avoid _once() but go for dev_dbg(). > > Presumably anyone debugging this would have dynamic debug enabled here. > > So dev_dbg()? I proposed dev_err() as that's what some existing drivers do, but I'd be OK going for dev_dbg(). You may want to ask maintainers of the drivers that will be affected. -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 25/29] media: v4l2-subdev: Move subdev client capabilities into a new struct 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (23 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-10 13:31 ` Jacopo Mondi 2026-04-08 15:39 ` [PATCH v4 26/29] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops Sakari Ailus ` (3 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Add struct v4l2_subdev_client_info to hold sub-device client capability bits that used to be stored in the client_caps field of struct v4l2_subdev_fh. The intent is to enable passing this struct to sub-device pad operation callbacks for capability information. The main reason why this is a new struct instead of a u64 field is that modifying the callback arguments requires touching almost every sub-device driver and that is desirable to avoid in the future, should more than the client capability bits need to be known to the callbacks. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> --- drivers/media/v4l2-core/v4l2-subdev.c | 8 ++++---- include/media/v4l2-subdev.h | 12 ++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index 40b28e070726..eaa408832c6b 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -612,7 +612,7 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, case VIDIOC_SUBDEV_S_FRAME_INTERVAL: { struct v4l2_subdev_frame_interval *fi = arg; - if (!(subdev_fh->client_caps & + if (!(subdev_fh->ci.client_caps & V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH)) fi->which = V4L2_SUBDEV_FORMAT_ACTIVE; @@ -652,7 +652,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, struct v4l2_subdev_fh *subdev_fh = to_v4l2_subdev_fh(vfh); bool ro_subdev = test_bit(V4L2_FL_SUBDEV_RO_DEVNODE, &vdev->flags); bool streams_subdev = sd->flags & V4L2_SUBDEV_FL_STREAMS; - bool client_supports_streams = subdev_fh->client_caps & + bool client_supports_streams = subdev_fh->ci.client_caps & V4L2_SUBDEV_CLIENT_CAP_STREAMS; int rval; @@ -1119,7 +1119,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, case VIDIOC_SUBDEV_G_CLIENT_CAP: { struct v4l2_subdev_client_capability *client_cap = arg; - client_cap->capabilities = subdev_fh->client_caps; + client_cap->capabilities = subdev_fh->ci.client_caps; return 0; } @@ -1139,7 +1139,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, client_cap->capabilities &= (V4L2_SUBDEV_CLIENT_CAP_STREAMS | V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH); - subdev_fh->client_caps = client_cap->capabilities; + subdev_fh->ci.client_caps = client_cap->capabilities; return 0; } diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 93b672edd08e..e0861acc638d 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -734,6 +734,14 @@ struct v4l2_subdev_state { struct v4l2_subdev_stream_configs stream_configs; }; +/** + * struct v4l2_subdev_client_info - Sub-device client information + * @client_caps: bitmask of ``V4L2_SUBDEV_CLIENT_CAP_*`` + */ +struct v4l2_subdev_client_info { + u64 client_caps; +}; + /** * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations * @@ -1129,14 +1137,14 @@ struct v4l2_subdev { * @vfh: pointer to &struct v4l2_fh * @state: pointer to &struct v4l2_subdev_state * @owner: module pointer to the owner of this file handle - * @client_caps: bitmask of ``V4L2_SUBDEV_CLIENT_CAP_*`` + * @ci: sub-device client info related to this file handle */ struct v4l2_subdev_fh { struct v4l2_fh vfh; struct module *owner; #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) struct v4l2_subdev_state *state; - u64 client_caps; + struct v4l2_subdev_client_info ci; #endif }; -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 25/29] media: v4l2-subdev: Move subdev client capabilities into a new struct 2026-04-08 15:39 ` [PATCH v4 25/29] media: v4l2-subdev: Move subdev client capabilities into a new struct Sakari Ailus @ 2026-04-10 13:31 ` Jacopo Mondi 2026-04-13 8:11 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Jacopo Mondi @ 2026-04-10 13:31 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, laurent.pinchart, 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, André 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 Hi Sakari On Wed, Apr 08, 2026 at 06:39:34PM +0300, Sakari Ailus wrote: > Add struct v4l2_subdev_client_info to hold sub-device client capability > bits that used to be stored in the client_caps field of struct > v4l2_subdev_fh. The intent is to enable passing this struct to sub-device > pad operation callbacks for capability information. The main reason why > this is a new struct instead of a u64 field is that modifying the callback > arguments requires touching almost every sub-device driver and that is > desirable to avoid in the future, should more than the client capability bits > need to be known to the callbacks. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > --- > drivers/media/v4l2-core/v4l2-subdev.c | 8 ++++---- > include/media/v4l2-subdev.h | 12 ++++++++++-- > 2 files changed, 14 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > index 40b28e070726..eaa408832c6b 100644 > --- a/drivers/media/v4l2-core/v4l2-subdev.c > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > @@ -612,7 +612,7 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, > case VIDIOC_SUBDEV_S_FRAME_INTERVAL: { > struct v4l2_subdev_frame_interval *fi = arg; > > - if (!(subdev_fh->client_caps & > + if (!(subdev_fh->ci.client_caps & > V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH)) > fi->which = V4L2_SUBDEV_FORMAT_ACTIVE; > > @@ -652,7 +652,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > struct v4l2_subdev_fh *subdev_fh = to_v4l2_subdev_fh(vfh); > bool ro_subdev = test_bit(V4L2_FL_SUBDEV_RO_DEVNODE, &vdev->flags); > bool streams_subdev = sd->flags & V4L2_SUBDEV_FL_STREAMS; > - bool client_supports_streams = subdev_fh->client_caps & > + bool client_supports_streams = subdev_fh->ci.client_caps & > V4L2_SUBDEV_CLIENT_CAP_STREAMS; > int rval; > > @@ -1119,7 +1119,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > case VIDIOC_SUBDEV_G_CLIENT_CAP: { > struct v4l2_subdev_client_capability *client_cap = arg; > > - client_cap->capabilities = subdev_fh->client_caps; > + client_cap->capabilities = subdev_fh->ci.client_caps; > > return 0; > } > @@ -1139,7 +1139,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > client_cap->capabilities &= (V4L2_SUBDEV_CLIENT_CAP_STREAMS | > V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH); > > - subdev_fh->client_caps = client_cap->capabilities; > + subdev_fh->ci.client_caps = client_cap->capabilities; I'm sorry for being annoying, but the discussion on v2 ended with the question on why we can't propagate the client caps to the drivers using the subdev state. I understand we have the active state which is stored in the subdev and not per-file handle. But ioctls are called on a file handle and it seems trivial to me copy the caps from the subdev_fh to the active state. It would result in a much smaller set of changes. What am I missing ? > > return 0; > } > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > index 93b672edd08e..e0861acc638d 100644 > --- a/include/media/v4l2-subdev.h > +++ b/include/media/v4l2-subdev.h > @@ -734,6 +734,14 @@ struct v4l2_subdev_state { > struct v4l2_subdev_stream_configs stream_configs; > }; > > +/** > + * struct v4l2_subdev_client_info - Sub-device client information > + * @client_caps: bitmask of ``V4L2_SUBDEV_CLIENT_CAP_*`` > + */ > +struct v4l2_subdev_client_info { > + u64 client_caps; > +}; > + > /** > * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations > * > @@ -1129,14 +1137,14 @@ struct v4l2_subdev { > * @vfh: pointer to &struct v4l2_fh > * @state: pointer to &struct v4l2_subdev_state > * @owner: module pointer to the owner of this file handle > - * @client_caps: bitmask of ``V4L2_SUBDEV_CLIENT_CAP_*`` > + * @ci: sub-device client info related to this file handle > */ > struct v4l2_subdev_fh { > struct v4l2_fh vfh; > struct module *owner; > #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) > struct v4l2_subdev_state *state; > - u64 client_caps; > + struct v4l2_subdev_client_info ci; > #endif > }; > > -- > 2.47.3 > > ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 25/29] media: v4l2-subdev: Move subdev client capabilities into a new struct 2026-04-10 13:31 ` Jacopo Mondi @ 2026-04-13 8:11 ` Sakari Ailus 2026-04-13 12:42 ` Jacopo Mondi 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-13 8:11 UTC (permalink / raw) To: Jacopo Mondi Cc: linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Jacopo, On Fri, Apr 10, 2026 at 03:31:32PM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Wed, Apr 08, 2026 at 06:39:34PM +0300, Sakari Ailus wrote: > > Add struct v4l2_subdev_client_info to hold sub-device client capability > > bits that used to be stored in the client_caps field of struct > > v4l2_subdev_fh. The intent is to enable passing this struct to sub-device > > pad operation callbacks for capability information. The main reason why > > this is a new struct instead of a u64 field is that modifying the callback > > arguments requires touching almost every sub-device driver and that is > > desirable to avoid in the future, should more than the client capability bits > > need to be known to the callbacks. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > > --- > > drivers/media/v4l2-core/v4l2-subdev.c | 8 ++++---- > > include/media/v4l2-subdev.h | 12 ++++++++++-- > > 2 files changed, 14 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > index 40b28e070726..eaa408832c6b 100644 > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > @@ -612,7 +612,7 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, > > case VIDIOC_SUBDEV_S_FRAME_INTERVAL: { > > struct v4l2_subdev_frame_interval *fi = arg; > > > > - if (!(subdev_fh->client_caps & > > + if (!(subdev_fh->ci.client_caps & > > V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH)) > > fi->which = V4L2_SUBDEV_FORMAT_ACTIVE; > > > > @@ -652,7 +652,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > struct v4l2_subdev_fh *subdev_fh = to_v4l2_subdev_fh(vfh); > > bool ro_subdev = test_bit(V4L2_FL_SUBDEV_RO_DEVNODE, &vdev->flags); > > bool streams_subdev = sd->flags & V4L2_SUBDEV_FL_STREAMS; > > - bool client_supports_streams = subdev_fh->client_caps & > > + bool client_supports_streams = subdev_fh->ci.client_caps & > > V4L2_SUBDEV_CLIENT_CAP_STREAMS; > > int rval; > > > > @@ -1119,7 +1119,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > case VIDIOC_SUBDEV_G_CLIENT_CAP: { > > struct v4l2_subdev_client_capability *client_cap = arg; > > > > - client_cap->capabilities = subdev_fh->client_caps; > > + client_cap->capabilities = subdev_fh->ci.client_caps; > > > > return 0; > > } > > @@ -1139,7 +1139,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > client_cap->capabilities &= (V4L2_SUBDEV_CLIENT_CAP_STREAMS | > > V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH); > > > > - subdev_fh->client_caps = client_cap->capabilities; > > + subdev_fh->ci.client_caps = client_cap->capabilities; > > > I'm sorry for being annoying, but the discussion on v2 ended with the > question on why we can't propagate the client caps to the drivers > using the subdev state. > > I understand we have the active state which is stored in the subdev > and not per-file handle. But ioctls are called on a file handle and it > seems trivial to me copy the caps from the subdev_fh to the active > state. > > It would result in a much smaller set of changes. > > What am I missing ? I thought the discussion ended with the conclusion that we can't do that as the sub-device active state isn't bound to a file handle. :-) -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 25/29] media: v4l2-subdev: Move subdev client capabilities into a new struct 2026-04-13 8:11 ` Sakari Ailus @ 2026-04-13 12:42 ` Jacopo Mondi 2026-04-16 17:30 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Jacopo Mondi @ 2026-04-13 12:42 UTC (permalink / raw) To: Sakari Ailus Cc: Jacopo Mondi, linux-media, hans, laurent.pinchart, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Sakari On Mon, Apr 13, 2026 at 11:11:33AM +0300, Sakari Ailus wrote: > Hi Jacopo, > > On Fri, Apr 10, 2026 at 03:31:32PM +0200, Jacopo Mondi wrote: > > Hi Sakari > > > > On Wed, Apr 08, 2026 at 06:39:34PM +0300, Sakari Ailus wrote: > > > Add struct v4l2_subdev_client_info to hold sub-device client capability > > > bits that used to be stored in the client_caps field of struct > > > v4l2_subdev_fh. The intent is to enable passing this struct to sub-device > > > pad operation callbacks for capability information. The main reason why > > > this is a new struct instead of a u64 field is that modifying the callback > > > arguments requires touching almost every sub-device driver and that is > > > desirable to avoid in the future, should more than the client capability bits > > > need to be known to the callbacks. > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > > > --- > > > drivers/media/v4l2-core/v4l2-subdev.c | 8 ++++---- > > > include/media/v4l2-subdev.h | 12 ++++++++++-- > > > 2 files changed, 14 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > > index 40b28e070726..eaa408832c6b 100644 > > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > > @@ -612,7 +612,7 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, > > > case VIDIOC_SUBDEV_S_FRAME_INTERVAL: { > > > struct v4l2_subdev_frame_interval *fi = arg; > > > > > > - if (!(subdev_fh->client_caps & > > > + if (!(subdev_fh->ci.client_caps & > > > V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH)) > > > fi->which = V4L2_SUBDEV_FORMAT_ACTIVE; > > > > > > @@ -652,7 +652,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > > struct v4l2_subdev_fh *subdev_fh = to_v4l2_subdev_fh(vfh); > > > bool ro_subdev = test_bit(V4L2_FL_SUBDEV_RO_DEVNODE, &vdev->flags); > > > bool streams_subdev = sd->flags & V4L2_SUBDEV_FL_STREAMS; > > > - bool client_supports_streams = subdev_fh->client_caps & > > > + bool client_supports_streams = subdev_fh->ci.client_caps & > > > V4L2_SUBDEV_CLIENT_CAP_STREAMS; > > > int rval; > > > > > > @@ -1119,7 +1119,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > > case VIDIOC_SUBDEV_G_CLIENT_CAP: { > > > struct v4l2_subdev_client_capability *client_cap = arg; > > > > > > - client_cap->capabilities = subdev_fh->client_caps; > > > + client_cap->capabilities = subdev_fh->ci.client_caps; > > > > > > return 0; > > > } > > > @@ -1139,7 +1139,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > > client_cap->capabilities &= (V4L2_SUBDEV_CLIENT_CAP_STREAMS | > > > V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH); > > > > > > - subdev_fh->client_caps = client_cap->capabilities; > > > + subdev_fh->ci.client_caps = client_cap->capabilities; > > > > > > I'm sorry for being annoying, but the discussion on v2 ended with the > > question on why we can't propagate the client caps to the drivers > > using the subdev state. > > > > I understand we have the active state which is stored in the subdev > > and not per-file handle. But ioctls are called on a file handle and it > > seems trivial to me copy the caps from the subdev_fh to the active > > state. > > > > It would result in a much smaller set of changes. > > > > What am I missing ? > > I thought the discussion ended with the conclusion that we can't do that as > the sub-device active state isn't bound to a file handle. :-) > Can you clarify why this can't happen in your opinion ? Yes, the active state is not bound to any fh, but all ioctls operations are issued on an fh, so it's trivial to copy the caps flags in the active state before passing it to drivers. If this is not preferred because it feels like an hack I understand it, it actually is, but I would like to think in perspective here. We want contexts, I think that's clear. In the design I proposed the active state will be moved from the subdev to the context (when available). A state lives in a context which is bound to file handle. Getting the caps from a state is then a matter of providing a helpers in the form of a chain of container_of. The active_state which lives in the subdev will be used as a "default" state, to support userspace application which are not context-aware. Would it be so bad to populate a v4l2_subdev_fh * in the active state stored in the subdev to indicate on which file handle an ioctl has been called on and retrieve the caps from there, so that the same (name tbd) v4l2_subdev_get_state_caps(struct v4l2_subdev_state *state) could be used ? Adding the caps argument to driver's ioctl handlers to me pollutes the interface diminishing the value of the state-centric interface we are trying to implement. > -- > Kind regards, > > Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 25/29] media: v4l2-subdev: Move subdev client capabilities into a new struct 2026-04-13 12:42 ` Jacopo Mondi @ 2026-04-16 17:30 ` Laurent Pinchart 2026-04-23 7:02 ` Jacopo Mondi 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 17:30 UTC (permalink / raw) To: Jacopo Mondi Cc: Sakari Ailus, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar On Mon, Apr 13, 2026 at 02:42:03PM +0200, Jacopo Mondi wrote: > On Mon, Apr 13, 2026 at 11:11:33AM +0300, Sakari Ailus wrote: > > On Fri, Apr 10, 2026 at 03:31:32PM +0200, Jacopo Mondi wrote: > > > On Wed, Apr 08, 2026 at 06:39:34PM +0300, Sakari Ailus wrote: > > > > Add struct v4l2_subdev_client_info to hold sub-device client capability > > > > bits that used to be stored in the client_caps field of struct > > > > v4l2_subdev_fh. The intent is to enable passing this struct to sub-device > > > > pad operation callbacks for capability information. The main reason why > > > > this is a new struct instead of a u64 field is that modifying the callback > > > > arguments requires touching almost every sub-device driver and that is > > > > desirable to avoid in the future, should more than the client capability bits > > > > need to be known to the callbacks. > > > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > > > > --- > > > > drivers/media/v4l2-core/v4l2-subdev.c | 8 ++++---- > > > > include/media/v4l2-subdev.h | 12 ++++++++++-- > > > > 2 files changed, 14 insertions(+), 6 deletions(-) > > > > > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > > > index 40b28e070726..eaa408832c6b 100644 > > > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > > > @@ -612,7 +612,7 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, > > > > case VIDIOC_SUBDEV_S_FRAME_INTERVAL: { > > > > struct v4l2_subdev_frame_interval *fi = arg; > > > > > > > > - if (!(subdev_fh->client_caps & > > > > + if (!(subdev_fh->ci.client_caps & > > > > V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH)) > > > > fi->which = V4L2_SUBDEV_FORMAT_ACTIVE; > > > > > > > > @@ -652,7 +652,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > > > struct v4l2_subdev_fh *subdev_fh = to_v4l2_subdev_fh(vfh); > > > > bool ro_subdev = test_bit(V4L2_FL_SUBDEV_RO_DEVNODE, &vdev->flags); > > > > bool streams_subdev = sd->flags & V4L2_SUBDEV_FL_STREAMS; > > > > - bool client_supports_streams = subdev_fh->client_caps & > > > > + bool client_supports_streams = subdev_fh->ci.client_caps & > > > > V4L2_SUBDEV_CLIENT_CAP_STREAMS; > > > > int rval; > > > > > > > > @@ -1119,7 +1119,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > > > case VIDIOC_SUBDEV_G_CLIENT_CAP: { > > > > struct v4l2_subdev_client_capability *client_cap = arg; > > > > > > > > - client_cap->capabilities = subdev_fh->client_caps; > > > > + client_cap->capabilities = subdev_fh->ci.client_caps; > > > > > > > > return 0; > > > > } > > > > @@ -1139,7 +1139,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > > > client_cap->capabilities &= (V4L2_SUBDEV_CLIENT_CAP_STREAMS | > > > > V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH); > > > > > > > > - subdev_fh->client_caps = client_cap->capabilities; > > > > + subdev_fh->ci.client_caps = client_cap->capabilities; > > > > > > I'm sorry for being annoying, but the discussion on v2 ended with the > > > question on why we can't propagate the client caps to the drivers > > > using the subdev state. > > > > > > I understand we have the active state which is stored in the subdev > > > and not per-file handle. But ioctls are called on a file handle and it > > > seems trivial to me copy the caps from the subdev_fh to the active > > > state. > > > > > > It would result in a much smaller set of changes. > > > > > > What am I missing ? > > > > I thought the discussion ended with the conclusion that we can't do that as > > the sub-device active state isn't bound to a file handle. :-) > > Can you clarify why this can't happen in your opinion ? > > Yes, the active state is not bound to any fh, but all ioctls > operations are issued on an fh, so it's trivial to copy the caps flags > in the active state before passing it to drivers. > > If this is not preferred because it feels like an hack I understand > it, it actually is, but I would like to think in perspective here. Storing the client caps in the state would be a hack indeed. The state is meant to be an object that represents the state of the device. Using it to store caps of a client means we'll need to ensure at least that no two clients will ever use the same state at the same time (which only applies to the active state), and that a state will always be associated with a client when a subdev operation is called. To ensure the former, we need to lock the active state before setting the caps field in the state, and keep it locked to call the subdev operation is called. The current implementation of the subdev ioctl handling code complies with those requirements. For the latter, it largely depends on which operation we're talking about. This series only adds the v4l2_subdev_client_info pointer to four operations: .get_fmt(), .set_fmt(), .get_selection() and .set_selection(). There are very few state-aware drivers calling the format operations manually on a subdev managed by a different driver, and even less calling the selection operations, and I don't expect that list to grow. Storing the caps in the state would be doable today, but I'm concerned it will cause issues later and restrict us in our ability to use subdev states. It could however be argued that introducing the new v4l2_subdev_client_info argument could be delayed to that point in time. All this being said, the only usage of client caps in subdev drivers today is conversion of existing sensor drivers to the new raw camera sensor model without breaking userspace. We have decided to propagate the V4L2_SUBDEV_CLIENT_CAP_COMMON_RAW_SENSOR capability to drivers to handle this, because we didn't find a way to handle it in the subdev core, but maybe there's a better solution we overlooked ? By the way, I don't think passing the client info pointer to the .get_fmt() operation is needed. > We want contexts, I think that's clear. > > In the design I proposed the active state will be moved from the > subdev to the context (when available). A state lives in a context > which is bound to file handle. Getting the caps from a state is then a > matter of providing a helpers in the form of a chain of container_of. > > The active_state which lives in the subdev will be used as a "default" > state, to support userspace application which are not context-aware. > > Would it be so bad to populate a v4l2_subdev_fh * in the active state > stored in the subdev to indicate on which file handle an ioctl has > been called on and retrieve the caps from there, so that the same > (name tbd) v4l2_subdev_get_state_caps(struct v4l2_subdev_state *state) > could be used ? I think that will cause trouble. States can be accessed directly from a client context (e.g. when servicing a subdev ioctl), but also from other contexts (e.g. pipeline validation when starting streaming). In the latter case no operation requiring client caps should be called. If we store client caps in the state, I fear we'll start accessing them from places where they shouldn't be accessed, and it would become hard to untangle it later. > Adding the caps argument to driver's ioctl handlers to me pollutes the > interface diminishing the value of the state-centric interface we are > trying to implement. It's still state-centric. -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 25/29] media: v4l2-subdev: Move subdev client capabilities into a new struct 2026-04-16 17:30 ` Laurent Pinchart @ 2026-04-23 7:02 ` Jacopo Mondi 0 siblings, 0 replies; 116+ messages in thread From: Jacopo Mondi @ 2026-04-23 7:02 UTC (permalink / raw) To: Laurent Pinchart Cc: Jacopo Mondi, Sakari Ailus, linux-media, hans, 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, André Apitzsch, Heimir Thor Sverrisson, Kieran Bingham, Mehdi Djait, Ricardo Ribalda Delgado, Hans de Goede, Tomi Valkeinen, David Plowman, Yu, Ong Hock, Ng, Khai Wen, Jai Luthra, Rishikesh Donadkar Hi Laurent On Thu, Apr 16, 2026 at 08:30:15PM +0300, Laurent Pinchart wrote: > On Mon, Apr 13, 2026 at 02:42:03PM +0200, Jacopo Mondi wrote: > > On Mon, Apr 13, 2026 at 11:11:33AM +0300, Sakari Ailus wrote: > > > On Fri, Apr 10, 2026 at 03:31:32PM +0200, Jacopo Mondi wrote: > > > > On Wed, Apr 08, 2026 at 06:39:34PM +0300, Sakari Ailus wrote: > > > > > Add struct v4l2_subdev_client_info to hold sub-device client capability > > > > > bits that used to be stored in the client_caps field of struct > > > > > v4l2_subdev_fh. The intent is to enable passing this struct to sub-device > > > > > pad operation callbacks for capability information. The main reason why > > > > > this is a new struct instead of a u64 field is that modifying the callback > > > > > arguments requires touching almost every sub-device driver and that is > > > > > desirable to avoid in the future, should more than the client capability bits > > > > > need to be known to the callbacks. > > > > > > > > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > > > > > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> > > > > > --- > > > > > drivers/media/v4l2-core/v4l2-subdev.c | 8 ++++---- > > > > > include/media/v4l2-subdev.h | 12 ++++++++++-- > > > > > 2 files changed, 14 insertions(+), 6 deletions(-) > > > > > > > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > > > > index 40b28e070726..eaa408832c6b 100644 > > > > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > > > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > > > > @@ -612,7 +612,7 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, > > > > > case VIDIOC_SUBDEV_S_FRAME_INTERVAL: { > > > > > struct v4l2_subdev_frame_interval *fi = arg; > > > > > > > > > > - if (!(subdev_fh->client_caps & > > > > > + if (!(subdev_fh->ci.client_caps & > > > > > V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH)) > > > > > fi->which = V4L2_SUBDEV_FORMAT_ACTIVE; > > > > > > > > > > @@ -652,7 +652,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > > > > struct v4l2_subdev_fh *subdev_fh = to_v4l2_subdev_fh(vfh); > > > > > bool ro_subdev = test_bit(V4L2_FL_SUBDEV_RO_DEVNODE, &vdev->flags); > > > > > bool streams_subdev = sd->flags & V4L2_SUBDEV_FL_STREAMS; > > > > > - bool client_supports_streams = subdev_fh->client_caps & > > > > > + bool client_supports_streams = subdev_fh->ci.client_caps & > > > > > V4L2_SUBDEV_CLIENT_CAP_STREAMS; > > > > > int rval; > > > > > > > > > > @@ -1119,7 +1119,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > > > > case VIDIOC_SUBDEV_G_CLIENT_CAP: { > > > > > struct v4l2_subdev_client_capability *client_cap = arg; > > > > > > > > > > - client_cap->capabilities = subdev_fh->client_caps; > > > > > + client_cap->capabilities = subdev_fh->ci.client_caps; > > > > > > > > > > return 0; > > > > > } > > > > > @@ -1139,7 +1139,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > > > > client_cap->capabilities &= (V4L2_SUBDEV_CLIENT_CAP_STREAMS | > > > > > V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH); > > > > > > > > > > - subdev_fh->client_caps = client_cap->capabilities; > > > > > + subdev_fh->ci.client_caps = client_cap->capabilities; > > > > > > > > I'm sorry for being annoying, but the discussion on v2 ended with the > > > > question on why we can't propagate the client caps to the drivers > > > > using the subdev state. > > > > > > > > I understand we have the active state which is stored in the subdev > > > > and not per-file handle. But ioctls are called on a file handle and it > > > > seems trivial to me copy the caps from the subdev_fh to the active > > > > state. > > > > > > > > It would result in a much smaller set of changes. > > > > > > > > What am I missing ? > > > > > > I thought the discussion ended with the conclusion that we can't do that as > > > the sub-device active state isn't bound to a file handle. :-) > > > > Can you clarify why this can't happen in your opinion ? > > > > Yes, the active state is not bound to any fh, but all ioctls > > operations are issued on an fh, so it's trivial to copy the caps flags > > in the active state before passing it to drivers. > > > > If this is not preferred because it feels like an hack I understand > > it, it actually is, but I would like to think in perspective here. > > Storing the client caps in the state would be a hack indeed. The state > is meant to be an object that represents the state of the device. > > Using it to store caps of a client means we'll need to ensure at least > that no two clients will ever use the same state at the same time (which > only applies to the active state), and that a state will always be > associated with a client when a subdev operation is called. > > To ensure the former, we need to lock the active state before setting > the caps field in the state, and keep it locked to call the subdev > operation is called. > > The current implementation of the subdev ioctl handling code complies > with those requirements. > > For the latter, it largely depends on which operation we're talking > about. This series only adds the v4l2_subdev_client_info pointer to four > operations: .get_fmt(), .set_fmt(), .get_selection() and > .set_selection(). There are very few state-aware drivers calling the > format operations manually on a subdev managed by a different driver, > and even less calling the selection operations, and I don't expect that > list to grow. > > Storing the caps in the state would be doable today, but I'm concerned > it will cause issues later and restrict us in our ability to use subdev > states. It could however be argued that introducing the new > v4l2_subdev_client_info argument could be delayed to that point in time. > > All this being said, the only usage of client caps in subdev drivers > today is conversion of existing sensor drivers to the new raw camera > sensor model without breaking userspace. We have decided to propagate > the V4L2_SUBDEV_CLIENT_CAP_COMMON_RAW_SENSOR capability to drivers to > handle this, because we didn't find a way to handle it in the subdev > core, but maybe there's a better solution we overlooked ? > > By the way, I don't think passing the client info pointer to the > .get_fmt() operation is needed. > > > We want contexts, I think that's clear. > > > > In the design I proposed the active state will be moved from the > > subdev to the context (when available). A state lives in a context > > which is bound to file handle. Getting the caps from a state is then a > > matter of providing a helpers in the form of a chain of container_of. > > > > The active_state which lives in the subdev will be used as a "default" > > state, to support userspace application which are not context-aware. > > > > Would it be so bad to populate a v4l2_subdev_fh * in the active state > > stored in the subdev to indicate on which file handle an ioctl has > > been called on and retrieve the caps from there, so that the same > > (name tbd) v4l2_subdev_get_state_caps(struct v4l2_subdev_state *state) > > could be used ? > > I think that will cause trouble. States can be accessed directly from a > client context (e.g. when servicing a subdev ioctl), but also from other > contexts (e.g. pipeline validation when starting streaming). In the > latter case no operation requiring client caps should be called. If we > store client caps in the state, I fear we'll start accessing them from > places where they shouldn't be accessed, and it would become hard to > untangle it later. I think this is the key point: drivers can access the state from context where we can't guarantee a client is available (if I'm not mistaken .s_stream() is one of them). At the moment we don't need client caps in any of those places, but I wouldn't feel confortable betting on this in the long run. > > > Adding the caps argument to driver's ioctl handlers to me pollutes the > > interface diminishing the value of the state-centric interface we are > > trying to implement. > > It's still state-centric. > Fair, it still is, my point was that going through the state would have given a cleaner interface. I'm still not in-love with adding caps to the ioctl handlers as it feels like they will only be used by drivers that will go through the transition to the RAW camera model, but it will affect all the other ones as well. > -- > Regards, > > Laurent Pinchart > ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 26/29] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (24 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 25/29] media: v4l2-subdev: Move subdev client capabilities into a new struct Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-16 17:32 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 27/29] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state Sakari Ailus ` (2 subsequent siblings) 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 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 <sakari.ailus@linux.intel.com> --- drivers/media/v4l2-core/v4l2-subdev.c | 72 +++++++++++++++++++-------- include/media/v4l2-subdev.h | 9 +++- 2 files changed, 60 insertions(+), 21 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index eaa408832c6b..7723e37a0ff5 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -246,19 +246,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, @@ -309,19 +311,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, @@ -524,6 +528,21 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable) v4l2_subdev_unlock_state(state); \ return ret; \ } +#define DEFINE_CI_STATE_WRAPPER(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 */ @@ -535,15 +554,24 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable) return call_##f(sd, state, arg); \ } +#define DEFINE_CI_STATE_WRAPPER(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) \ + { \ + return call_##f(sd, ci, state, arg); \ + } + #endif /* CONFIG_MEDIA_CONTROLLER */ -DEFINE_STATE_WRAPPER(get_fmt, struct v4l2_subdev_format); -DEFINE_STATE_WRAPPER(set_fmt, struct v4l2_subdev_format); +DEFINE_CI_STATE_WRAPPER(get_fmt, struct v4l2_subdev_format); +DEFINE_CI_STATE_WRAPPER(set_fmt, struct v4l2_subdev_format); DEFINE_STATE_WRAPPER(enum_mbus_code, struct v4l2_subdev_mbus_code_enum); DEFINE_STATE_WRAPPER(enum_frame_size, struct v4l2_subdev_frame_size_enum); DEFINE_STATE_WRAPPER(enum_frame_interval, struct v4l2_subdev_frame_interval_enum); -DEFINE_STATE_WRAPPER(get_selection, struct v4l2_subdev_selection); -DEFINE_STATE_WRAPPER(set_selection, struct v4l2_subdev_selection); +DEFINE_CI_STATE_WRAPPER(get_selection, struct v4l2_subdev_selection); +DEFINE_CI_STATE_WRAPPER(set_selection, struct v4l2_subdev_selection); static const struct v4l2_subdev_pad_ops v4l2_subdev_call_pad_wrappers = { .get_fmt = call_get_fmt_state, @@ -805,7 +833,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, memset(format->reserved, 0, sizeof(format->reserved)); memset(format->format.reserved, 0, sizeof(format->format.reserved)); - return v4l2_subdev_call(sd, pad, get_fmt, state, format); + return v4l2_subdev_call(sd, pad, get_fmt, &subdev_fh->ci, state, + format); } case VIDIOC_SUBDEV_S_FMT: { @@ -819,7 +848,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, memset(format->reserved, 0, sizeof(format->reserved)); memset(format->format.reserved, 0, sizeof(format->format.reserved)); - return v4l2_subdev_call(sd, pad, set_fmt, state, format); + return v4l2_subdev_call(sd, pad, set_fmt, &subdev_fh->ci, state, + format); } case VIDIOC_SUBDEV_G_CROP: { @@ -836,8 +866,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel.stream = crop->stream; sel.target = V4L2_SEL_TGT_CROP; - rval = v4l2_subdev_call( - sd, pad, get_selection, state, &sel); + rval = v4l2_subdev_call(sd, pad, get_selection, &subdev_fh->ci, + state, &sel); crop->rect = sel.r; @@ -862,8 +892,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel.target = V4L2_SEL_TGT_CROP; sel.r = crop->rect; - rval = v4l2_subdev_call( - sd, pad, set_selection, state, &sel); + rval = v4l2_subdev_call(sd, pad, set_selection, &subdev_fh->ci, + state, &sel); crop->rect = sel.r; @@ -933,8 +963,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel->stream = 0; memset(sel->reserved, 0, sizeof(sel->reserved)); - return v4l2_subdev_call( - sd, pad, get_selection, state, sel); + return v4l2_subdev_call(sd, pad, get_selection, &subdev_fh->ci, + state, sel); } case VIDIOC_SUBDEV_S_SELECTION: { @@ -947,8 +977,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel->stream = 0; memset(sel->reserved, 0, sizeof(sel->reserved)); - return v4l2_subdev_call( - sd, pad, set_selection, state, sel); + return v4l2_subdev_call(sd, pad, set_selection, &subdev_fh->ci, + state, sel); } case VIDIOC_G_EDID: { @@ -1343,7 +1373,7 @@ v4l2_subdev_link_validate_get_format(struct media_pad *pad, u32 stream, else state = v4l2_subdev_lock_and_get_active_state(sd); - ret = v4l2_subdev_call(sd, pad, get_fmt, state, fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, state, fmt); if (!states_locked && state) v4l2_subdev_unlock_state(state); @@ -1924,7 +1954,9 @@ v4l2_subdev_init_stream_configs(struct v4l2_subdev_stream_configs *stream_config return 0; } -int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, +int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, + struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { struct v4l2_mbus_framefmt *fmt; diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index e0861acc638d..1ce1c18f84a9 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -850,15 +850,19 @@ struct v4l2_subdev_pad_ops { struct v4l2_subdev_state *state, struct v4l2_subdev_frame_interval_enum *fie); int (*get_fmt)(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format); int (*set_fmt)(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format); int (*get_selection)(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel); int (*set_selection)(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel); int (*get_frame_interval)(struct v4l2_subdev *sd, @@ -1461,6 +1465,7 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state, * @sd: subdevice * @state: subdevice state * @format: pointer to &struct v4l2_subdev_format + * @ci: pointer to sub-device client information, including client capabilities * * Fill @format->format field based on the information in the @format struct. * @@ -1470,7 +1475,9 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state, * * Returns 0 on success, error value otherwise. */ -int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, +int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, + struct v4l2_subdev_state *state, struct v4l2_subdev_format *format); /** -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 26/29] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops 2026-04-08 15:39 ` [PATCH v4 26/29] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops Sakari Ailus @ 2026-04-16 17:32 ` Laurent Pinchart 0 siblings, 0 replies; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 17:32 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Wed, Apr 08, 2026 at 06:39:35PM +0300, 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. I don't think we need to add the client info to .get_fmt(). .get_fmt() should just retrieve the format from the state, and that should not depend on whether or not V4L2_SUBDEV_CLIENT_CAP_COMMON_RAW_SENSOR is set. > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > --- > drivers/media/v4l2-core/v4l2-subdev.c | 72 +++++++++++++++++++-------- > include/media/v4l2-subdev.h | 9 +++- > 2 files changed, 60 insertions(+), 21 deletions(-) > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > index eaa408832c6b..7723e37a0ff5 100644 > --- a/drivers/media/v4l2-core/v4l2-subdev.c > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > @@ -246,19 +246,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, > @@ -309,19 +311,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, > @@ -524,6 +528,21 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable) > v4l2_subdev_unlock_state(state); \ > return ret; \ > } > +#define DEFINE_CI_STATE_WRAPPER(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 */ > > @@ -535,15 +554,24 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable) > return call_##f(sd, state, arg); \ > } > > +#define DEFINE_CI_STATE_WRAPPER(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) \ > + { \ > + return call_##f(sd, ci, state, arg); \ > + } > + > #endif /* CONFIG_MEDIA_CONTROLLER */ > > -DEFINE_STATE_WRAPPER(get_fmt, struct v4l2_subdev_format); > -DEFINE_STATE_WRAPPER(set_fmt, struct v4l2_subdev_format); > +DEFINE_CI_STATE_WRAPPER(get_fmt, struct v4l2_subdev_format); > +DEFINE_CI_STATE_WRAPPER(set_fmt, struct v4l2_subdev_format); > DEFINE_STATE_WRAPPER(enum_mbus_code, struct v4l2_subdev_mbus_code_enum); > DEFINE_STATE_WRAPPER(enum_frame_size, struct v4l2_subdev_frame_size_enum); > DEFINE_STATE_WRAPPER(enum_frame_interval, struct v4l2_subdev_frame_interval_enum); > -DEFINE_STATE_WRAPPER(get_selection, struct v4l2_subdev_selection); > -DEFINE_STATE_WRAPPER(set_selection, struct v4l2_subdev_selection); > +DEFINE_CI_STATE_WRAPPER(get_selection, struct v4l2_subdev_selection); > +DEFINE_CI_STATE_WRAPPER(set_selection, struct v4l2_subdev_selection); > > static const struct v4l2_subdev_pad_ops v4l2_subdev_call_pad_wrappers = { > .get_fmt = call_get_fmt_state, > @@ -805,7 +833,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > memset(format->reserved, 0, sizeof(format->reserved)); > memset(format->format.reserved, 0, sizeof(format->format.reserved)); > - return v4l2_subdev_call(sd, pad, get_fmt, state, format); > + return v4l2_subdev_call(sd, pad, get_fmt, &subdev_fh->ci, state, > + format); > } > > case VIDIOC_SUBDEV_S_FMT: { > @@ -819,7 +848,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > > memset(format->reserved, 0, sizeof(format->reserved)); > memset(format->format.reserved, 0, sizeof(format->format.reserved)); > - return v4l2_subdev_call(sd, pad, set_fmt, state, format); > + return v4l2_subdev_call(sd, pad, set_fmt, &subdev_fh->ci, state, > + format); > } > > case VIDIOC_SUBDEV_G_CROP: { > @@ -836,8 +866,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > sel.stream = crop->stream; > sel.target = V4L2_SEL_TGT_CROP; > > - rval = v4l2_subdev_call( > - sd, pad, get_selection, state, &sel); > + rval = v4l2_subdev_call(sd, pad, get_selection, &subdev_fh->ci, > + state, &sel); > > crop->rect = sel.r; > > @@ -862,8 +892,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > sel.target = V4L2_SEL_TGT_CROP; > sel.r = crop->rect; > > - rval = v4l2_subdev_call( > - sd, pad, set_selection, state, &sel); > + rval = v4l2_subdev_call(sd, pad, set_selection, &subdev_fh->ci, > + state, &sel); > > crop->rect = sel.r; > > @@ -933,8 +963,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > sel->stream = 0; > > memset(sel->reserved, 0, sizeof(sel->reserved)); > - return v4l2_subdev_call( > - sd, pad, get_selection, state, sel); > + return v4l2_subdev_call(sd, pad, get_selection, &subdev_fh->ci, > + state, sel); > } > > case VIDIOC_SUBDEV_S_SELECTION: { > @@ -947,8 +977,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, > sel->stream = 0; > > memset(sel->reserved, 0, sizeof(sel->reserved)); > - return v4l2_subdev_call( > - sd, pad, set_selection, state, sel); > + return v4l2_subdev_call(sd, pad, set_selection, &subdev_fh->ci, > + state, sel); > } > > case VIDIOC_G_EDID: { > @@ -1343,7 +1373,7 @@ v4l2_subdev_link_validate_get_format(struct media_pad *pad, u32 stream, > else > state = v4l2_subdev_lock_and_get_active_state(sd); > > - ret = v4l2_subdev_call(sd, pad, get_fmt, state, fmt); > + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, state, fmt); > > if (!states_locked && state) > v4l2_subdev_unlock_state(state); > @@ -1924,7 +1954,9 @@ v4l2_subdev_init_stream_configs(struct v4l2_subdev_stream_configs *stream_config > return 0; > } > > -int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, > +int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, > + const struct v4l2_subdev_client_info *ci, > + struct v4l2_subdev_state *state, > struct v4l2_subdev_format *format) > { > struct v4l2_mbus_framefmt *fmt; > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > index e0861acc638d..1ce1c18f84a9 100644 > --- a/include/media/v4l2-subdev.h > +++ b/include/media/v4l2-subdev.h > @@ -850,15 +850,19 @@ struct v4l2_subdev_pad_ops { > struct v4l2_subdev_state *state, > struct v4l2_subdev_frame_interval_enum *fie); > int (*get_fmt)(struct v4l2_subdev *sd, > + const struct v4l2_subdev_client_info *ci, > struct v4l2_subdev_state *state, > struct v4l2_subdev_format *format); > int (*set_fmt)(struct v4l2_subdev *sd, > + const struct v4l2_subdev_client_info *ci, > struct v4l2_subdev_state *state, > struct v4l2_subdev_format *format); > int (*get_selection)(struct v4l2_subdev *sd, > + const struct v4l2_subdev_client_info *ci, > struct v4l2_subdev_state *state, > struct v4l2_subdev_selection *sel); > int (*set_selection)(struct v4l2_subdev *sd, > + const struct v4l2_subdev_client_info *ci, > struct v4l2_subdev_state *state, > struct v4l2_subdev_selection *sel); > int (*get_frame_interval)(struct v4l2_subdev *sd, > @@ -1461,6 +1465,7 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state, > * @sd: subdevice > * @state: subdevice state > * @format: pointer to &struct v4l2_subdev_format > + * @ci: pointer to sub-device client information, including client capabilities > * > * Fill @format->format field based on the information in the @format struct. > * > @@ -1470,7 +1475,9 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state, > * > * Returns 0 on success, error value otherwise. > */ > -int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, > +int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, > + const struct v4l2_subdev_client_info *ci, > + struct v4l2_subdev_state *state, > struct v4l2_subdev_format *format); > > /** -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 27/29] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (25 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 26/29] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-16 17:38 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 28/29] media: v4l2-subdev: Perform client info changes to i2c drivers Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 29/29] media: v4l2-subdev: Add struct v4l2_subdev_client_info argument to pad ops Sakari Ailus 28 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Add v4l2_subdev_call_ci_active_state(), to call sub-device pad ops that take struct v4l2_subdev_client_info pointer as an argument. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- 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 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* Re: [PATCH v4 27/29] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state 2026-04-08 15:39 ` [PATCH v4 27/29] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state Sakari Ailus @ 2026-04-16 17:38 ` Laurent Pinchart 2026-04-21 16:04 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-16 17:38 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 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 <sakari.ailus@linux.intel.com> > --- > 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 ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 27/29] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state 2026-04-16 17:38 ` Laurent Pinchart @ 2026-04-21 16:04 ` Sakari Ailus 2026-04-21 16:12 ` Laurent Pinchart 0 siblings, 1 reply; 116+ messages in thread From: Sakari Ailus @ 2026-04-21 16:04 UTC (permalink / raw) To: Laurent Pinchart Cc: linux-media, hans, 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, André 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 Hi Laurent, On Thu, Apr 16, 2026 at 08:38:21PM +0300, Laurent Pinchart wrote: > 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. That'd make the arguments for set_fmt and get_fmt different. I'm not sure if that'd be a problem in practice, perhaps not. I could imagine in the end we'll need to include the client flags in more callbacks than set_fmt(). It might not be a bad idea to add them to all pad ops. Of course we could revisit this later when needed. -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 27/29] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state 2026-04-21 16:04 ` Sakari Ailus @ 2026-04-21 16:12 ` Laurent Pinchart 2026-04-21 16:34 ` Sakari Ailus 0 siblings, 1 reply; 116+ messages in thread From: Laurent Pinchart @ 2026-04-21 16:12 UTC (permalink / raw) To: Sakari Ailus Cc: linux-media, hans, 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, André 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 On Tue, Apr 21, 2026 at 07:04:26PM +0300, Sakari Ailus wrote: > On Thu, Apr 16, 2026 at 08:38:21PM +0300, Laurent Pinchart wrote: > > 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. > > That'd make the arguments for set_fmt and get_fmt different. I'm not sure > if that'd be a problem in practice, perhaps not. All drivers should eventually implement .get_fmt() using the v4l2_subdev_get_fmt() helper. There should be no need for client info there. > I could imagine in the end we'll need to include the client flags in more > callbacks than set_fmt(). It might not be a bad idea to add them to all pad > ops. Of course we could revisit this later when needed. We should really minimize addition of new client caps flags, and really, really try to implement them all in the subdev core. -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 116+ messages in thread
* Re: [PATCH v4 27/29] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state 2026-04-21 16:12 ` Laurent Pinchart @ 2026-04-21 16:34 ` Sakari Ailus 0 siblings, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-21 16:34 UTC (permalink / raw) To: Laurent Pinchart Cc: linux-media, hans, 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, André 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 Hi Laurent, On Tue, Apr 21, 2026 at 07:12:20PM +0300, Laurent Pinchart wrote: > On Tue, Apr 21, 2026 at 07:04:26PM +0300, Sakari Ailus wrote: > > On Thu, Apr 16, 2026 at 08:38:21PM +0300, Laurent Pinchart wrote: > > > 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. > > > > That'd make the arguments for set_fmt and get_fmt different. I'm not sure > > if that'd be a problem in practice, perhaps not. > > All drivers should eventually implement .get_fmt() using the > v4l2_subdev_get_fmt() helper. There should be no need for client info > there. > > > I could imagine in the end we'll need to include the client flags in more > > callbacks than set_fmt(). It might not be a bad idea to add them to all pad > > ops. Of course we could revisit this later when needed. > > We should really minimize addition of new client caps flags, and really, > really try to implement them all in the subdev core. Yes -- if we can. In this case the common raw sensor model affects how the driver's UAPI works so there's no really an option. I could imagine there are other such capability flags as well. But let's see. -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 116+ messages in thread
* [PATCH v4 28/29] media: v4l2-subdev: Perform client info changes to i2c drivers 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (26 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 27/29] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 29/29] media: v4l2-subdev: Add struct v4l2_subdev_client_info argument to pad ops Sakari Ailus 28 siblings, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Perform client info argument related changes to two i2c drivers (s5k5baf and tc358743). These changes are not done by Coccinelle scripts in the following patch and will be squashed to the previous patch eventually. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/og01a1b.c | 2 +- drivers/media/i2c/s5k5baf.c | 1 + drivers/media/i2c/tc358743.c | 2 +- drivers/media/pci/intel/ipu6/ipu6-isys-subdev.h | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/og01a1b.c b/drivers/media/i2c/og01a1b.c index 1675f0460969..1d109ca75d76 100644 --- a/drivers/media/i2c/og01a1b.c +++ b/drivers/media/i2c/og01a1b.c @@ -763,7 +763,7 @@ static int og01a1b_init_state(struct v4l2_subdev *sd, }, }; - og01a1b_set_format(sd, state, &fmt); + og01a1b_set_format(sd, NULL, state, &fmt); return 0; } diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c index d1d00eca8708..a580b7e63302 100644 --- a/drivers/media/i2c/s5k5baf.c +++ b/drivers/media/i2c/s5k5baf.c @@ -1463,6 +1463,7 @@ static bool s5k5baf_cmp_rect(const struct v4l2_rect *r1, } static int s5k5baf_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index a0ca19359c43..59f509aa1939 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1822,7 +1822,7 @@ static int tc358743_set_fmt(struct v4l2_subdev *sd, struct tc358743_state *state = to_state(sd); u32 code = format->format.code; /* is overwritten by get_fmt */ - int ret = tc358743_get_fmt(sd, sd_state, format); + int ret = tc358743_get_fmt(sd, ci, sd_state, format); if (code == MEDIA_BUS_FMT_RGB888_1X24 || code == MEDIA_BUS_FMT_UYVY8_1X16) diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-subdev.h b/drivers/media/pci/intel/ipu6/ipu6-isys-subdev.h index 35069099c364..d4f76d513dc6 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys-subdev.h +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-subdev.h @@ -31,6 +31,7 @@ bool ipu6_isys_is_bayer_format(u32 code); u32 ipu6_isys_convert_bayer_order(u32 code, int x, int y); int ipu6_isys_subdev_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt); int ipu6_isys_subdev_enum_mbus_code(struct v4l2_subdev *sd, -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
* [PATCH v4 29/29] media: v4l2-subdev: Add struct v4l2_subdev_client_info argument to pad ops 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus ` (27 preceding siblings ...) 2026-04-08 15:39 ` [PATCH v4 28/29] media: v4l2-subdev: Perform client info changes to i2c drivers Sakari Ailus @ 2026-04-08 15:39 ` Sakari Ailus 28 siblings, 0 replies; 116+ messages in thread From: Sakari Ailus @ 2026-04-08 15:39 UTC (permalink / raw) To: linux-media Cc: hans, laurent.pinchart, 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, André 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 Add const struct v4l2_subdev_client_info argument to the sub-device pad ops get_fmt, set_fmt, get_selection and set_selection. This patch has been entirely generated using Coccinelle and will be squashed to the previous patch before merging. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/adv7170.c | 2 ++ drivers/media/i2c/adv7175.c | 2 ++ drivers/media/i2c/adv7180.c | 4 ++- drivers/media/i2c/adv7183.c | 4 ++- drivers/media/i2c/adv748x/adv748x-afe.c | 4 ++- drivers/media/i2c/adv748x/adv748x-csi2.c | 3 ++- drivers/media/i2c/adv748x/adv748x-hdmi.c | 4 ++- drivers/media/i2c/adv7511-v4l2.c | 2 ++ drivers/media/i2c/adv7604.c | 3 +++ drivers/media/i2c/adv7842.c | 4 ++- drivers/media/i2c/ak881x.c | 2 ++ drivers/media/i2c/alvium-csi2.c | 3 +++ drivers/media/i2c/ar0521.c | 2 ++ drivers/media/i2c/ccs/ccs-core.c | 15 ++++++++--- drivers/media/i2c/cx25840/cx25840-core.c | 1 + drivers/media/i2c/ds90ub913.c | 3 ++- drivers/media/i2c/ds90ub953.c | 3 ++- drivers/media/i2c/ds90ub960.c | 3 ++- drivers/media/i2c/et8ek8/et8ek8_driver.c | 2 ++ drivers/media/i2c/gc0308.c | 1 + drivers/media/i2c/gc0310.c | 1 + drivers/media/i2c/gc05a2.c | 4 ++- drivers/media/i2c/gc08a3.c | 4 ++- drivers/media/i2c/gc2145.c | 2 ++ drivers/media/i2c/hi556.c | 3 +++ drivers/media/i2c/hi846.c | 3 +++ drivers/media/i2c/hi847.c | 2 ++ drivers/media/i2c/imx111.c | 1 + drivers/media/i2c/imx208.c | 2 ++ drivers/media/i2c/imx214.c | 4 ++- drivers/media/i2c/imx219.c | 4 ++- drivers/media/i2c/imx258.c | 3 +++ drivers/media/i2c/imx274.c | 4 +++ drivers/media/i2c/imx283.c | 2 ++ drivers/media/i2c/imx290.c | 4 ++- drivers/media/i2c/imx296.c | 7 +++-- drivers/media/i2c/imx319.c | 2 ++ drivers/media/i2c/imx334.c | 4 ++- drivers/media/i2c/imx335.c | 4 ++- drivers/media/i2c/imx355.c | 2 ++ drivers/media/i2c/imx412.c | 4 ++- drivers/media/i2c/imx415.c | 4 ++- drivers/media/i2c/isl7998x.c | 2 ++ drivers/media/i2c/lt6911uxe.c | 5 ++-- drivers/media/i2c/max9286.c | 3 ++- drivers/media/i2c/max96714.c | 3 ++- drivers/media/i2c/max96717.c | 3 ++- drivers/media/i2c/ml86v7667.c | 1 + drivers/media/i2c/mt9m001.c | 6 ++++- drivers/media/i2c/mt9m111.c | 4 +++ drivers/media/i2c/mt9m114.c | 6 +++++ drivers/media/i2c/mt9p031.c | 4 +++ drivers/media/i2c/mt9t112.c | 4 +++ drivers/media/i2c/mt9v011.c | 1 + drivers/media/i2c/mt9v032.c | 4 +++ drivers/media/i2c/mt9v111.c | 2 ++ drivers/media/i2c/og01a1b.c | 1 + drivers/media/i2c/og0ve1b.c | 3 ++- drivers/media/i2c/os05b10.c | 2 ++ drivers/media/i2c/ov01a10.c | 3 +++ drivers/media/i2c/ov02a10.c | 4 ++- drivers/media/i2c/ov02c10.c | 1 + drivers/media/i2c/ov02e10.c | 2 ++ drivers/media/i2c/ov08d10.c | 2 ++ drivers/media/i2c/ov08x40.c | 2 ++ drivers/media/i2c/ov13858.c | 2 ++ drivers/media/i2c/ov13b10.c | 2 ++ drivers/media/i2c/ov2640.c | 3 +++ drivers/media/i2c/ov2659.c | 2 ++ drivers/media/i2c/ov2680.c | 4 +++ drivers/media/i2c/ov2685.c | 3 +++ drivers/media/i2c/ov2732.c | 4 ++- drivers/media/i2c/ov2735.c | 4 ++- drivers/media/i2c/ov2740.c | 1 + drivers/media/i2c/ov4689.c | 2 ++ drivers/media/i2c/ov5640.c | 3 +++ drivers/media/i2c/ov5645.c | 4 ++- drivers/media/i2c/ov5647.c | 3 +++ drivers/media/i2c/ov5648.c | 2 ++ drivers/media/i2c/ov5670.c | 3 +++ drivers/media/i2c/ov5675.c | 3 +++ drivers/media/i2c/ov5693.c | 4 +++ drivers/media/i2c/ov5695.c | 2 ++ drivers/media/i2c/ov6211.c | 3 ++- drivers/media/i2c/ov64a40.c | 2 ++ drivers/media/i2c/ov7251.c | 5 +++- drivers/media/i2c/ov7670.c | 2 ++ drivers/media/i2c/ov772x.c | 3 +++ drivers/media/i2c/ov7740.c | 2 ++ drivers/media/i2c/ov8856.c | 2 ++ drivers/media/i2c/ov8858.c | 3 ++- drivers/media/i2c/ov8865.c | 3 +++ drivers/media/i2c/ov9282.c | 5 +++- drivers/media/i2c/ov9640.c | 2 ++ drivers/media/i2c/ov9650.c | 2 ++ drivers/media/i2c/ov9734.c | 2 ++ drivers/media/i2c/rdacm20.c | 1 + drivers/media/i2c/rdacm21.c | 1 + drivers/media/i2c/rj54n1cb0c.c | 4 +++ drivers/media/i2c/s5c73m3/s5c73m3-core.c | 4 +++ drivers/media/i2c/s5k3m5.c | 4 ++- drivers/media/i2c/s5k5baf.c | 3 +++ drivers/media/i2c/s5k6a3.c | 2 ++ drivers/media/i2c/s5kjn1.c | 4 ++- drivers/media/i2c/saa6752hs.c | 2 ++ drivers/media/i2c/saa7115.c | 1 + drivers/media/i2c/saa717x.c | 1 + drivers/media/i2c/st-mipid02.c | 1 + drivers/media/i2c/t4ka3.c | 3 +++ drivers/media/i2c/tc358743.c | 2 ++ drivers/media/i2c/tc358746.c | 3 ++- drivers/media/i2c/tda1997x.c | 2 ++ drivers/media/i2c/thp7312.c | 1 + drivers/media/i2c/tvp514x.c | 2 ++ drivers/media/i2c/tvp5150.c | 3 +++ drivers/media/i2c/tvp7002.c | 4 ++- drivers/media/i2c/tw9900.c | 2 ++ drivers/media/i2c/tw9910.c | 3 +++ drivers/media/i2c/vd55g1.c | 4 ++- drivers/media/i2c/vd56g3.c | 4 ++- drivers/media/i2c/vgxy61.c | 5 +++- drivers/media/pci/cobalt/cobalt-driver.c | 8 +++--- drivers/media/pci/cobalt/cobalt-v4l2.c | 14 +++++----- drivers/media/pci/cx18/cx18-av-core.c | 1 + drivers/media/pci/cx18/cx18-controls.c | 2 +- drivers/media/pci/cx18/cx18-ioctl.c | 2 +- drivers/media/pci/cx23885/cx23885-video.c | 4 +-- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 5 ++-- drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 2 ++ .../media/pci/intel/ipu6/ipu6-isys-subdev.c | 3 ++- drivers/media/pci/intel/ivsc/mei_csi.c | 1 + drivers/media/pci/ivtv/ivtv-controls.c | 2 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +- drivers/media/pci/saa7134/saa7134-empress.c | 6 ++--- .../platform/amlogic/c3/isp/c3-isp-capture.c | 2 +- .../platform/amlogic/c3/isp/c3-isp-core.c | 1 + .../platform/amlogic/c3/isp/c3-isp-resizer.c | 3 +++ .../amlogic/c3/mipi-adapter/c3-mipi-adap.c | 3 ++- .../amlogic/c3/mipi-csi2/c3-mipi-csi2.c | 3 ++- .../platform/arm/mali-c55/mali-c55-capture.c | 2 +- .../platform/arm/mali-c55/mali-c55-isp.c | 5 +++- .../platform/arm/mali-c55/mali-c55-resizer.c | 15 ++++++++--- .../platform/arm/mali-c55/mali-c55-tpg.c | 1 + drivers/media/platform/atmel/atmel-isi.c | 4 +-- .../media/platform/broadcom/bcm2835-unicam.c | 3 ++- drivers/media/platform/cadence/cdns-csi2rx.c | 7 ++--- drivers/media/platform/cadence/cdns-csi2tx.c | 7 +++-- drivers/media/platform/intel/pxa_camera.c | 6 ++--- drivers/media/platform/marvell/mcam-core.c | 4 +-- .../platform/microchip/microchip-csi2dc.c | 2 ++ .../platform/microchip/microchip-isc-base.c | 1 + .../platform/microchip/microchip-isc-scaler.c | 3 +++ drivers/media/platform/nxp/imx-mipi-csis.c | 5 ++-- drivers/media/platform/nxp/imx7-media-csi.c | 3 ++- .../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 3 ++- .../platform/nxp/imx8-isi/imx8-isi-pipe.c | 3 +++ drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 3 ++- .../media/platform/qcom/camss/camss-csid.c | 4 ++- .../media/platform/qcom/camss/camss-csiphy.c | 4 ++- .../media/platform/qcom/camss/camss-ispif.c | 4 ++- drivers/media/platform/qcom/camss/camss-vfe.c | 17 +++++++----- .../media/platform/qcom/camss/camss-video.c | 2 +- .../media/platform/raspberrypi/rp1-cfe/csi2.c | 1 + .../platform/raspberrypi/rp1-cfe/pisp-fe.c | 3 ++- drivers/media/platform/renesas/rcar-csi2.c | 3 ++- .../media/platform/renesas/rcar-isp/csisp.c | 3 ++- .../platform/renesas/rcar-vin/rcar-v4l2.c | 2 +- drivers/media/platform/renesas/renesas-ceu.c | 7 ++--- .../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 3 ++- .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 3 ++- .../platform/renesas/rzg2l-cru/rzg2l-video.c | 2 +- .../renesas/rzv2h-ivc/rzv2h-ivc-subdev.c | 3 ++- .../media/platform/renesas/vsp1/vsp1_brx.c | 3 +++ .../media/platform/renesas/vsp1/vsp1_drm.c | 26 ++++++++++++------- .../media/platform/renesas/vsp1/vsp1_entity.c | 4 ++- .../media/platform/renesas/vsp1/vsp1_histo.c | 9 +++++-- .../media/platform/renesas/vsp1/vsp1_hsit.c | 1 + .../media/platform/renesas/vsp1/vsp1_rwpf.c | 3 +++ .../media/platform/renesas/vsp1/vsp1_sru.c | 1 + .../media/platform/renesas/vsp1/vsp1_uds.c | 1 + .../media/platform/renesas/vsp1/vsp1_video.c | 2 +- .../media/platform/renesas/vsp1/vsp1_vspx.c | 3 ++- .../platform/rockchip/rkcif/rkcif-interface.c | 5 +++- .../platform/rockchip/rkisp1/rkisp1-capture.c | 2 +- .../platform/rockchip/rkisp1/rkisp1-csi.c | 3 ++- .../platform/rockchip/rkisp1/rkisp1-isp.c | 3 +++ .../platform/rockchip/rkisp1/rkisp1-resizer.c | 3 +++ .../samsung/exynos4-is/fimc-capture.c | 13 +++++++--- .../samsung/exynos4-is/fimc-isp-video.c | 5 ++-- .../platform/samsung/exynos4-is/fimc-isp.c | 2 ++ .../platform/samsung/exynos4-is/fimc-lite.c | 8 ++++-- .../platform/samsung/exynos4-is/mipi-csis.c | 2 ++ .../samsung/s3c-camif/camif-capture.c | 7 ++++- .../platform/samsung/s3c-camif/camif-core.c | 4 +-- drivers/media/platform/st/stm32/stm32-csi.c | 1 + drivers/media/platform/st/stm32/stm32-dcmi.c | 6 ++--- .../st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 3 ++- .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 3 +++ .../st/stm32/stm32-dcmipp/dcmipp-input.c | 1 + .../platform/sunxi/sun4i-csi/sun4i_v4l2.c | 2 ++ .../sunxi/sun6i-csi/sun6i_csi_bridge.c | 2 ++ .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 2 ++ .../sun8i_a83t_mipi_csi2.c | 2 ++ .../media/platform/synopsys/dw-mipi-csi2rx.c | 3 ++- .../media/platform/ti/am437x/am437x-vpfe.c | 4 +-- drivers/media/platform/ti/cal/cal-camerarx.c | 3 ++- drivers/media/platform/ti/cal/cal-video.c | 6 ++--- .../media/platform/ti/davinci/vpif_capture.c | 2 +- .../platform/ti/j721e-csi2rx/j721e-csi2rx.c | 2 +- drivers/media/platform/ti/omap3isp/ispccdc.c | 6 ++++- drivers/media/platform/ti/omap3isp/ispccp2.c | 4 ++- drivers/media/platform/ti/omap3isp/ispcsi2.c | 4 ++- .../media/platform/ti/omap3isp/isppreview.c | 6 ++++- .../media/platform/ti/omap3isp/ispresizer.c | 6 ++++- drivers/media/platform/ti/omap3isp/ispvideo.c | 12 ++++----- drivers/media/platform/ti/vpe/vip.c | 7 ++--- drivers/media/platform/via/via-camera.c | 4 +-- drivers/media/platform/video-mux.c | 1 + .../media/platform/xilinx/xilinx-csi2rxss.c | 2 ++ drivers/media/platform/xilinx/xilinx-dma.c | 2 +- drivers/media/platform/xilinx/xilinx-tpg.c | 2 ++ drivers/media/test-drivers/vimc/vimc-common.c | 2 +- .../media/test-drivers/vimc/vimc-debayer.c | 3 ++- drivers/media/test-drivers/vimc/vimc-scaler.c | 3 +++ drivers/media/test-drivers/vimc/vimc-sensor.c | 1 + drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 4 +-- drivers/media/usb/dvb-usb/cxusb-analog.c | 6 +++-- drivers/media/usb/em28xx/em28xx-camera.c | 2 +- drivers/media/usb/go7007/go7007-v4l2.c | 2 +- drivers/media/usb/go7007/s2250-board.c | 1 + drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- .../media/atomisp/i2c/atomisp-gc2235.c | 2 ++ .../media/atomisp/i2c/atomisp-ov2722.c | 2 ++ .../staging/media/atomisp/pci/atomisp_cmd.c | 16 ++++++++---- .../staging/media/atomisp/pci/atomisp_csi2.c | 2 ++ .../media/atomisp/pci/atomisp_subdev.c | 4 +++ .../staging/media/atomisp/pci/atomisp_v4l2.c | 8 +++--- .../media/deprecated/atmel/atmel-isc-base.c | 4 +-- drivers/staging/media/imx/imx-ic-prp.c | 2 ++ drivers/staging/media/imx/imx-ic-prpencvf.c | 2 ++ drivers/staging/media/imx/imx-media-capture.c | 14 ++++++---- drivers/staging/media/imx/imx-media-csi.c | 4 +++ drivers/staging/media/imx/imx-media-utils.c | 2 +- drivers/staging/media/imx/imx-media-vdic.c | 2 ++ drivers/staging/media/imx/imx6-mipi-csi2.c | 2 ++ drivers/staging/media/ipu3/ipu3-v4l2.c | 4 +++ drivers/staging/media/ipu7/ipu7-isys-csi2.c | 2 ++ drivers/staging/media/ipu7/ipu7-isys-subdev.c | 3 ++- .../media/sunxi/sun6i-isp/sun6i_isp_proc.c | 2 ++ drivers/staging/media/tegra-video/csi.c | 2 ++ drivers/staging/media/tegra-video/vi.c | 12 ++++----- 252 files changed, 678 insertions(+), 209 deletions(-) diff --git a/drivers/media/i2c/adv7170.c b/drivers/media/i2c/adv7170.c index ef8682b980b4..6ad3dab4c79b 100644 --- a/drivers/media/i2c/adv7170.c +++ b/drivers/media/i2c/adv7170.c @@ -261,6 +261,7 @@ static int adv7170_enum_mbus_code(struct v4l2_subdev *sd, } static int adv7170_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -284,6 +285,7 @@ static int adv7170_get_fmt(struct v4l2_subdev *sd, } static int adv7170_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/adv7175.c b/drivers/media/i2c/adv7175.c index 384da1ec5bf9..6ef4d53c2781 100644 --- a/drivers/media/i2c/adv7175.c +++ b/drivers/media/i2c/adv7175.c @@ -299,6 +299,7 @@ static int adv7175_enum_mbus_code(struct v4l2_subdev *sd, } static int adv7175_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -322,6 +323,7 @@ static int adv7175_get_fmt(struct v4l2_subdev *sd, } static int adv7175_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index 669b0b3165b1..a5e6aa5a77e7 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -755,6 +755,7 @@ static int adv7180_set_field_mode(struct adv7180_state *state) } static int adv7180_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -771,6 +772,7 @@ static int adv7180_get_pad_format(struct v4l2_subdev *sd, } static int adv7180_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -808,7 +810,7 @@ static int adv7180_init_state(struct v4l2_subdev *sd, : V4L2_SUBDEV_FORMAT_ACTIVE, }; - return adv7180_set_pad_format(sd, sd_state, &fmt); + return adv7180_set_pad_format(sd, NULL, sd_state, &fmt); } static int adv7180_get_mbus_config(struct v4l2_subdev *sd, diff --git a/drivers/media/i2c/adv7183.c b/drivers/media/i2c/adv7183.c index 25a31a6dd456..7b8afc225b4a 100644 --- a/drivers/media/i2c/adv7183.c +++ b/drivers/media/i2c/adv7183.c @@ -420,6 +420,7 @@ static int adv7183_enum_mbus_code(struct v4l2_subdev *sd, } static int adv7183_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -446,6 +447,7 @@ static int adv7183_set_fmt(struct v4l2_subdev *sd, } static int adv7183_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -598,7 +600,7 @@ static int adv7183_probe(struct i2c_client *client) adv7183_s_std(sd, decoder->std); fmt.format.width = 720; fmt.format.height = 576; - adv7183_set_fmt(sd, NULL, &fmt); + adv7183_set_fmt(sd, NULL, NULL, &fmt); /* initialize the hardware to the default control values */ ret = v4l2_ctrl_handler_setup(hdl); diff --git a/drivers/media/i2c/adv748x/adv748x-afe.c b/drivers/media/i2c/adv748x/adv748x-afe.c index 678199196b84..d487cef3a979 100644 --- a/drivers/media/i2c/adv748x/adv748x-afe.c +++ b/drivers/media/i2c/adv748x/adv748x-afe.c @@ -326,6 +326,7 @@ static int adv748x_afe_enum_mbus_code(struct v4l2_subdev *sd, } static int adv748x_afe_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -349,6 +350,7 @@ static int adv748x_afe_get_format(struct v4l2_subdev *sd, } static int adv748x_afe_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -359,7 +361,7 @@ static int adv748x_afe_set_format(struct v4l2_subdev *sd, return -EINVAL; if (sdformat->which == V4L2_SUBDEV_FORMAT_ACTIVE) - return adv748x_afe_get_format(sd, sd_state, sdformat); + return adv748x_afe_get_format(sd, NULL, sd_state, sdformat); mbusformat = v4l2_subdev_state_get_format(sd_state, sdformat->pad); *mbusformat = sdformat->format; diff --git a/drivers/media/i2c/adv748x/adv748x-csi2.c b/drivers/media/i2c/adv748x/adv748x-csi2.c index ebe7da8ebed7..aa7515266c3a 100644 --- a/drivers/media/i2c/adv748x/adv748x-csi2.c +++ b/drivers/media/i2c/adv748x/adv748x-csi2.c @@ -226,6 +226,7 @@ static bool adv748x_csi2_is_fmt_supported(struct adv748x_csi2 *tx, u32 code) } static int adv748x_csi2_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -233,7 +234,7 @@ static int adv748x_csi2_set_format(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mbusformat; if (sdformat->pad == ADV748X_CSI2_SOURCE) - return v4l2_subdev_get_fmt(sd, sd_state, sdformat); + return v4l2_subdev_get_fmt(sd, NULL, sd_state, sdformat); /* * Make sure the format is supported, if not default it to diff --git a/drivers/media/i2c/adv748x/adv748x-hdmi.c b/drivers/media/i2c/adv748x/adv748x-hdmi.c index b154dea29ba2..63819d5d218e 100644 --- a/drivers/media/i2c/adv748x/adv748x-hdmi.c +++ b/drivers/media/i2c/adv748x/adv748x-hdmi.c @@ -418,6 +418,7 @@ static int adv748x_hdmi_enum_mbus_code(struct v4l2_subdev *sd, } static int adv748x_hdmi_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -440,6 +441,7 @@ static int adv748x_hdmi_get_format(struct v4l2_subdev *sd, } static int adv748x_hdmi_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -449,7 +451,7 @@ static int adv748x_hdmi_set_format(struct v4l2_subdev *sd, return -EINVAL; if (sdformat->which == V4L2_SUBDEV_FORMAT_ACTIVE) - return adv748x_hdmi_get_format(sd, sd_state, sdformat); + return adv748x_hdmi_get_format(sd, NULL, sd_state, sdformat); mbusformat = v4l2_subdev_state_get_format(sd_state, sdformat->pad); *mbusformat = sdformat->format; diff --git a/drivers/media/i2c/adv7511-v4l2.c b/drivers/media/i2c/adv7511-v4l2.c index 853c7806de92..159d4d93b133 100644 --- a/drivers/media/i2c/adv7511-v4l2.c +++ b/drivers/media/i2c/adv7511-v4l2.c @@ -1241,6 +1241,7 @@ static void adv7511_fill_format(struct adv7511_state *state, } static int adv7511_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1273,6 +1274,7 @@ static int adv7511_get_fmt(struct v4l2_subdev *sd, } static int adv7511_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 67116a4ef134..94a874f2fed4 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1920,6 +1920,7 @@ static void adv76xx_setup_format(struct adv76xx_state *state) } static int adv76xx_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1943,6 +1944,7 @@ static int adv76xx_get_format(struct v4l2_subdev *sd, } static int adv76xx_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1963,6 +1965,7 @@ static int adv76xx_get_selection(struct v4l2_subdev *sd, } static int adv76xx_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index ea6966c0605e..1c0755c79b3e 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c @@ -2072,6 +2072,7 @@ static void adv7842_setup_format(struct adv7842_state *state) } static int adv7842_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -2110,6 +2111,7 @@ static int adv7842_get_format(struct v4l2_subdev *sd, } static int adv7842_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -2120,7 +2122,7 @@ static int adv7842_set_format(struct v4l2_subdev *sd, return -EINVAL; if (state->mode == ADV7842_MODE_SDP) - return adv7842_get_format(sd, sd_state, format); + return adv7842_get_format(sd, NULL, sd_state, format); info = adv7842_format_info(state, format->format.code); if (info == NULL) diff --git a/drivers/media/i2c/ak881x.c b/drivers/media/i2c/ak881x.c index ee575d01a676..7d96b0cdec36 100644 --- a/drivers/media/i2c/ak881x.c +++ b/drivers/media/i2c/ak881x.c @@ -91,6 +91,7 @@ static int ak881x_s_register(struct v4l2_subdev *sd, #endif static int ak881x_fill_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -122,6 +123,7 @@ static int ak881x_enum_mbus_code(struct v4l2_subdev *sd, } static int ak881x_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c index 955b7072a560..130925b6dfed 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -1887,6 +1887,7 @@ static int alvium_init_state(struct v4l2_subdev *sd, } static int alvium_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1922,6 +1923,7 @@ static int alvium_set_fmt(struct v4l2_subdev *sd, } static int alvium_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1957,6 +1959,7 @@ static int alvium_set_selection(struct v4l2_subdev *sd, } static int alvium_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ar0521.c b/drivers/media/i2c/ar0521.c index ed324c2d87aa..070aa3a4d87c 100644 --- a/drivers/media/i2c/ar0521.c +++ b/drivers/media/i2c/ar0521.c @@ -437,6 +437,7 @@ static void ar0521_adj_fmt(struct v4l2_mbus_framefmt *fmt) } static int ar0521_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -457,6 +458,7 @@ static int ar0521_get_fmt(struct v4l2_subdev *sd, } static int ar0521_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index aa4dd7e7cf5a..1cd4db3f5708 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -2148,6 +2148,7 @@ static u32 ccs_get_mbus_code(struct v4l2_subdev *subdev, unsigned int pad) } static int ccs_get_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2189,6 +2190,7 @@ static void ccs_propagate(struct v4l2_subdev *subdev, } static int ccs_set_format_source(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2200,7 +2202,7 @@ static int ccs_set_format_source(struct v4l2_subdev *subdev, unsigned int i; int rval; - rval = ccs_get_format(subdev, sd_state, fmt); + rval = ccs_get_format(subdev, NULL, sd_state, fmt); if (rval) return rval; @@ -2242,6 +2244,7 @@ static int ccs_set_format_source(struct v4l2_subdev *subdev, } static int ccs_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2252,7 +2255,7 @@ static int ccs_set_format(struct v4l2_subdev *subdev, if (fmt->pad == ssd->source_pad) { int rval; - rval = ccs_set_format_source(subdev, sd_state, fmt); + rval = ccs_set_format_source(subdev, NULL, sd_state, fmt); return rval; } @@ -2467,6 +2470,7 @@ static void ccs_set_compose_scaler(struct v4l2_subdev *subdev, } /* We're only called on source pads. This function sets scaling. */ static int ccs_set_compose(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -2536,6 +2540,7 @@ static int ccs_sel_supported(struct v4l2_subdev *subdev, } static int ccs_set_crop(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -2587,6 +2592,7 @@ static void ccs_get_native_size(struct ccs_subdev *ssd, struct v4l2_rect *r) } static int ccs_get_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -2633,6 +2639,7 @@ static int ccs_get_selection(struct v4l2_subdev *subdev, } static int ccs_set_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -2655,10 +2662,10 @@ static int ccs_set_selection(struct v4l2_subdev *subdev, switch (sel->target) { case V4L2_SEL_TGT_CROP: - ret = ccs_set_crop(subdev, sd_state, sel); + ret = ccs_set_crop(subdev, NULL, sd_state, sel); break; case V4L2_SEL_TGT_COMPOSE: - ret = ccs_set_compose(subdev, sd_state, sel); + ret = ccs_set_compose(subdev, NULL, sd_state, sel); break; default: ret = -EINVAL; diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c index 69d5cc648c0f..4d1d6cb980e5 100644 --- a/drivers/media/i2c/cx25840/cx25840-core.c +++ b/drivers/media/i2c/cx25840/cx25840-core.c @@ -1771,6 +1771,7 @@ static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) /* ----------------------------------------------------------------------- */ static int cx25840_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/ds90ub913.c b/drivers/media/i2c/ds90ub913.c index 49aa5f4a172c..b452ff233db3 100644 --- a/drivers/media/i2c/ds90ub913.c +++ b/drivers/media/i2c/ds90ub913.c @@ -373,6 +373,7 @@ static int ub913_set_routing(struct v4l2_subdev *sd, } static int ub913_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -386,7 +387,7 @@ static int ub913_set_fmt(struct v4l2_subdev *sd, /* Source format is fully defined by the sink format, so not settable */ if (format->pad == UB913_PAD_SOURCE) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); finfo = ub913_find_format(format->format.code); if (!finfo) { diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c index a8ab67f4137f..8bcb82e0ad2d 100644 --- a/drivers/media/i2c/ds90ub953.c +++ b/drivers/media/i2c/ds90ub953.c @@ -426,6 +426,7 @@ static int ub953_set_routing(struct v4l2_subdev *sd, static int ub953_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -438,7 +439,7 @@ static int ub953_set_fmt(struct v4l2_subdev *sd, /* No transcoding, source and sink formats must match. */ if (format->pad == UB953_PAD_SOURCE) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); /* Set sink format */ fmt = v4l2_subdev_state_get_format(state, format->pad, format->stream); diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c index d50e977cf6ce..fab7b6335b0d 100644 --- a/drivers/media/i2c/ds90ub960.c +++ b/drivers/media/i2c/ds90ub960.c @@ -4045,6 +4045,7 @@ static int ub960_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, } static int ub960_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -4056,7 +4057,7 @@ static int ub960_set_fmt(struct v4l2_subdev *sd, /* No transcoding, source and sink formats must match. */ if (ub960_pad_is_source(priv, format->pad)) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); /* * Default to the first format if the requested media bus code isn't diff --git a/drivers/media/i2c/et8ek8/et8ek8_driver.c b/drivers/media/i2c/et8ek8/et8ek8_driver.c index 50121c3e5b48..915bd60f3ac4 100644 --- a/drivers/media/i2c/et8ek8/et8ek8_driver.c +++ b/drivers/media/i2c/et8ek8/et8ek8_driver.c @@ -996,6 +996,7 @@ __et8ek8_get_pad_format(struct et8ek8_sensor *sensor, } static int et8ek8_get_pad_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1013,6 +1014,7 @@ static int et8ek8_get_pad_format(struct v4l2_subdev *subdev, } static int et8ek8_set_pad_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/gc0308.c b/drivers/media/i2c/gc0308.c index cbcda0e18ff1..064766b6f627 100644 --- a/drivers/media/i2c/gc0308.c +++ b/drivers/media/i2c/gc0308.c @@ -1044,6 +1044,7 @@ static void gc0308_update_pad_format(const struct gc0308_frame_size *mode, } static int gc0308_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/gc0310.c b/drivers/media/i2c/gc0310.c index 7af4d66f42a0..741ec64a2d68 100644 --- a/drivers/media/i2c/gc0310.c +++ b/drivers/media/i2c/gc0310.c @@ -362,6 +362,7 @@ static void gc0310_fill_format(struct v4l2_mbus_framefmt *fmt) } static int gc0310_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/gc05a2.c b/drivers/media/i2c/gc05a2.c index 8ba17f80fffe..e2cae5f3f77e 100644 --- a/drivers/media/i2c/gc05a2.c +++ b/drivers/media/i2c/gc05a2.c @@ -731,6 +731,7 @@ static void gc05a2_update_pad_format(struct gc05a2 *gc08a3, } static int gc05a2_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -762,6 +763,7 @@ static int gc05a2_set_format(struct v4l2_subdev *sd, } static int gc05a2_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -796,7 +798,7 @@ static int gc05a2_init_state(struct v4l2_subdev *sd, }, }; - gc05a2_set_format(sd, state, &fmt); + gc05a2_set_format(sd, NULL, state, &fmt); return 0; } diff --git a/drivers/media/i2c/gc08a3.c b/drivers/media/i2c/gc08a3.c index 11fd936db9c3..ce80976e3a2a 100644 --- a/drivers/media/i2c/gc08a3.c +++ b/drivers/media/i2c/gc08a3.c @@ -706,6 +706,7 @@ static void gc08a3_update_pad_format(struct gc08a3 *gc08a3, } static int gc08a3_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -738,6 +739,7 @@ static int gc08a3_set_format(struct v4l2_subdev *sd, } static int gc08a3_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -772,7 +774,7 @@ static int gc08a3_init_state(struct v4l2_subdev *sd, }, }; - gc08a3_set_format(sd, state, &fmt); + gc08a3_set_format(sd, NULL, state, &fmt); return 0; } diff --git a/drivers/media/i2c/gc2145.c b/drivers/media/i2c/gc2145.c index b215963a2648..661a59641f19 100644 --- a/drivers/media/i2c/gc2145.c +++ b/drivers/media/i2c/gc2145.c @@ -709,6 +709,7 @@ static int gc2145_init_state(struct v4l2_subdev *sd, } static int gc2145_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -774,6 +775,7 @@ static int gc2145_enum_frame_size(struct v4l2_subdev *sd, } static int gc2145_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/hi556.c b/drivers/media/i2c/hi556.c index de573cee4451..58d912db4f2f 100644 --- a/drivers/media/i2c/hi556.c +++ b/drivers/media/i2c/hi556.c @@ -960,6 +960,7 @@ __hi556_get_pad_crop(struct hi556 *hi556, } static int hi556_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1071,6 +1072,7 @@ static int hi556_set_stream(struct v4l2_subdev *sd, int enable) } static int hi556_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1113,6 +1115,7 @@ static int hi556_set_format(struct v4l2_subdev *sd, } static int hi556_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/hi846.c b/drivers/media/i2c/hi846.c index a3f77b8434ca..802c79ac5f93 100644 --- a/drivers/media/i2c/hi846.c +++ b/drivers/media/i2c/hi846.c @@ -1688,6 +1688,7 @@ static int __maybe_unused hi846_resume(struct device *dev) } static int hi846_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1775,6 +1776,7 @@ static int hi846_set_format(struct v4l2_subdev *sd, } static int hi846_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1840,6 +1842,7 @@ static int hi846_enum_frame_size(struct v4l2_subdev *sd, } static int hi846_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/hi847.c b/drivers/media/i2c/hi847.c index def01aa07b2f..6ddb5cf9b6ba 100644 --- a/drivers/media/i2c/hi847.c +++ b/drivers/media/i2c/hi847.c @@ -2639,6 +2639,7 @@ static int hi847_set_stream(struct v4l2_subdev *sd, int enable) } static int hi847_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2682,6 +2683,7 @@ static int hi847_set_format(struct v4l2_subdev *sd, } static int hi847_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/imx111.c b/drivers/media/i2c/imx111.c index 8eb919788ef7..5b860fa052b1 100644 --- a/drivers/media/i2c/imx111.c +++ b/drivers/media/i2c/imx111.c @@ -1122,6 +1122,7 @@ static int imx111_enum_frame_size(struct v4l2_subdev *sd, } static int imx111_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/imx208.c b/drivers/media/i2c/imx208.c index d5350bb46f14..16407ff86f53 100644 --- a/drivers/media/i2c/imx208.c +++ b/drivers/media/i2c/imx208.c @@ -560,6 +560,7 @@ static int __imx208_get_pad_format(struct imx208 *imx208, } static int imx208_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -574,6 +575,7 @@ static int imx208_get_pad_format(struct v4l2_subdev *sd, } static int imx208_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c index d4945b192776..96833f2bf287 100644 --- a/drivers/media/i2c/imx214.c +++ b/drivers/media/i2c/imx214.c @@ -662,6 +662,7 @@ static const struct v4l2_subdev_core_ops imx214_core_ops = { }; static int imx214_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -717,6 +718,7 @@ static int imx214_set_format(struct v4l2_subdev *sd, } static int imx214_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -754,7 +756,7 @@ static int imx214_entity_init_state(struct v4l2_subdev *subdev, fmt.format.width = imx214_modes[0].width; fmt.format.height = imx214_modes[0].height; - imx214_set_format(subdev, sd_state, &fmt); + imx214_set_format(subdev, NULL, sd_state, &fmt); return 0; } diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 5a85d76af65a..67b02fa338d0 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -818,6 +818,7 @@ static int imx219_enum_frame_size(struct v4l2_subdev *sd, } static int imx219_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -917,6 +918,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, } static int imx219_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -959,7 +961,7 @@ static int imx219_init_state(struct v4l2_subdev *sd, }, }; - return imx219_set_pad_format(sd, state, &fmt); + return imx219_set_pad_format(sd, NULL, state, &fmt); } static const struct v4l2_subdev_video_ops imx219_video_ops = { diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c index bc9ee449a87c..bc3aa2b2ff6e 100644 --- a/drivers/media/i2c/imx258.c +++ b/drivers/media/i2c/imx258.c @@ -899,6 +899,7 @@ static int __imx258_get_pad_format(struct imx258 *imx258, } static int imx258_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -913,6 +914,7 @@ static int imx258_get_pad_format(struct v4l2_subdev *sd, } static int imx258_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -988,6 +990,7 @@ __imx258_get_pad_crop(struct imx258 *imx258, } static int imx258_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c index 241821572e03..b2d3772b0ba7 100644 --- a/drivers/media/i2c/imx274.c +++ b/drivers/media/i2c/imx274.c @@ -1052,6 +1052,7 @@ static int __imx274_change_compose(struct stimx274 *imx274, } static int imx274_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1064,6 +1065,7 @@ static int imx274_get_fmt(struct v4l2_subdev *sd, } static int imx274_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1097,6 +1099,7 @@ static int imx274_set_fmt(struct v4l2_subdev *sd, } static int imx274_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1213,6 +1216,7 @@ static int imx274_set_selection_crop(struct stimx274 *imx274, } static int imx274_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/imx283.c b/drivers/media/i2c/imx283.c index 38ea1902f2c2..e3cd27ca238e 100644 --- a/drivers/media/i2c/imx283.c +++ b/drivers/media/i2c/imx283.c @@ -958,6 +958,7 @@ static void imx283_set_framing_limits(struct imx283 *imx283, } static int imx283_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1260,6 +1261,7 @@ static int imx283_identify_module(struct imx283 *imx283) } static int imx283_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c index 21cbc81cb2ed..d562a9aa455c 100644 --- a/drivers/media/i2c/imx290.c +++ b/drivers/media/i2c/imx290.c @@ -1149,6 +1149,7 @@ static int imx290_enum_frame_size(struct v4l2_subdev *sd, } static int imx290_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1187,6 +1188,7 @@ static int imx290_set_fmt(struct v4l2_subdev *sd, } static int imx290_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1246,7 +1248,7 @@ static int imx290_entity_init_state(struct v4l2_subdev *subdev, }, }; - imx290_set_fmt(subdev, sd_state, &fmt); + imx290_set_fmt(subdev, NULL, sd_state, &fmt); return 0; } diff --git a/drivers/media/i2c/imx296.c b/drivers/media/i2c/imx296.c index 69636db11a2b..74bb295799fd 100644 --- a/drivers/media/i2c/imx296.c +++ b/drivers/media/i2c/imx296.c @@ -675,6 +675,7 @@ static int imx296_enum_frame_size(struct v4l2_subdev *sd, } static int imx296_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -726,6 +727,7 @@ static int imx296_set_format(struct v4l2_subdev *sd, } static int imx296_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -751,6 +753,7 @@ static int imx296_get_selection(struct v4l2_subdev *sd, } static int imx296_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -812,8 +815,8 @@ static int imx296_init_state(struct v4l2_subdev *sd, }, }; - imx296_set_selection(sd, state, &sel); - imx296_set_format(sd, state, &format); + imx296_set_selection(sd, NULL, state, &sel); + imx296_set_format(sd, NULL, state, &format); return 0; } diff --git a/drivers/media/i2c/imx319.c b/drivers/media/i2c/imx319.c index 953310ef3046..097e29544d01 100644 --- a/drivers/media/i2c/imx319.c +++ b/drivers/media/i2c/imx319.c @@ -2015,6 +2015,7 @@ static int imx319_do_get_pad_format(struct imx319 *imx319, } static int imx319_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2030,6 +2031,7 @@ static int imx319_get_pad_format(struct v4l2_subdev *sd, static int imx319_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index 553a16b84f4d..b2ae0887cc09 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -722,6 +722,7 @@ static void imx334_fill_pad_format(struct imx334 *imx334, } static int imx334_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -741,6 +742,7 @@ static int imx334_get_pad_format(struct v4l2_subdev *sd, } static int imx334_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -786,7 +788,7 @@ static int imx334_init_state(struct v4l2_subdev *sd, ~(imx334->link_freq_bitmap), __ffs(imx334->link_freq_bitmap)); - return imx334_set_pad_format(sd, sd_state, &fmt); + return imx334_set_pad_format(sd, NULL, sd_state, &fmt); } static int imx334_set_framefmt(struct imx334 *imx334) diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c index 1f777a1a8192..8f29d9f2da83 100644 --- a/drivers/media/i2c/imx335.c +++ b/drivers/media/i2c/imx335.c @@ -844,6 +844,7 @@ static void imx335_fill_pad_format(struct imx335 *imx335, } static int imx335_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -901,10 +902,11 @@ static int imx335_init_state(struct v4l2_subdev *sd, ~(imx335->link_freq_bitmap), __ffs(imx335->link_freq_bitmap)); - return imx335_set_pad_format(sd, sd_state, &fmt); + return imx335_set_pad_format(sd, NULL, sd_state, &fmt); } static int imx335_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c index 27a5c212a527..0257fc3e2a9c 100644 --- a/drivers/media/i2c/imx355.c +++ b/drivers/media/i2c/imx355.c @@ -1330,6 +1330,7 @@ static int imx355_do_get_pad_format(struct imx355 *imx355, } static int imx355_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1345,6 +1346,7 @@ static int imx355_get_pad_format(struct v4l2_subdev *sd, static int imx355_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c index 2705af2f16c0..a10ef2a99963 100644 --- a/drivers/media/i2c/imx412.c +++ b/drivers/media/i2c/imx412.c @@ -674,6 +674,7 @@ static void imx412_fill_pad_format(struct imx412 *imx412, } static int imx412_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -696,6 +697,7 @@ static int imx412_get_pad_format(struct v4l2_subdev *sd, } static int imx412_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -733,7 +735,7 @@ static int imx412_init_state(struct v4l2_subdev *sd, fmt.which = sd_state ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; imx412_fill_pad_format(imx412, &supported_mode, &fmt); - return imx412_set_pad_format(sd, sd_state, &fmt); + return imx412_set_pad_format(sd, NULL, sd_state, &fmt); } /** diff --git a/drivers/media/i2c/imx415.c b/drivers/media/i2c/imx415.c index 0b424c17e880..f70c36e45a25 100644 --- a/drivers/media/i2c/imx415.c +++ b/drivers/media/i2c/imx415.c @@ -1021,6 +1021,7 @@ static int imx415_enum_frame_size(struct v4l2_subdev *sd, } static int imx415_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -1042,6 +1043,7 @@ static int imx415_set_format(struct v4l2_subdev *sd, } static int imx415_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1070,7 +1072,7 @@ static int imx415_init_state(struct v4l2_subdev *sd, }, }; - imx415_set_format(sd, state, &format); + imx415_set_format(sd, NULL, state, &format); return 0; } diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c index 5ffd53e005ee..356fc020cb45 100644 --- a/drivers/media/i2c/isl7998x.c +++ b/drivers/media/i2c/isl7998x.c @@ -997,6 +997,7 @@ static int isl7998x_enum_frame_size(struct v4l2_subdev *sd, } static int isl7998x_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1027,6 +1028,7 @@ static int isl7998x_get_fmt(struct v4l2_subdev *sd, } static int isl7998x_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/lt6911uxe.c b/drivers/media/i2c/lt6911uxe.c index bdefdd157e69..c9da174dbfa6 100644 --- a/drivers/media/i2c/lt6911uxe.c +++ b/drivers/media/i2c/lt6911uxe.c @@ -384,6 +384,7 @@ static int lt6911uxe_disable_streams(struct v4l2_subdev *sd, } static int lt6911uxe_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -439,7 +440,7 @@ static int lt6911uxe_init_state(struct v4l2_subdev *sd, : V4L2_SUBDEV_FORMAT_ACTIVE, }; - return lt6911uxe_set_format(sd, sd_state, &fmt); + return lt6911uxe_set_format(sd, NULL, sd_state, &fmt); } static const struct v4l2_subdev_video_ops lt6911uxe_video_ops = { @@ -562,7 +563,7 @@ static irqreturn_t lt6911uxe_threaded_irq_fn(int irq, void *dev_id) * As a HDMI to CSI2 bridge, it needs to update the format in time * when the HDMI source changes. */ - lt6911uxe_set_format(sd, state, &fmt); + lt6911uxe_set_format(sd, NULL, state, &fmt); v4l2_subdev_unlock_state(state); return IRQ_HANDLED; diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index ac0712ce1e65..d877626edcf0 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -910,6 +910,7 @@ static int max9286_enum_mbus_code(struct v4l2_subdev *sd, } static int max9286_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -922,7 +923,7 @@ static int max9286_set_fmt(struct v4l2_subdev *sd, * from the sinks. */ if (format->pad == MAX9286_SRC_PAD) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); /* Validate the format. */ for (i = 0; i < ARRAY_SIZE(max9286_formats); ++i) { diff --git a/drivers/media/i2c/max96714.c b/drivers/media/i2c/max96714.c index e3e625e6f11a..e64d327fee21 100644 --- a/drivers/media/i2c/max96714.c +++ b/drivers/media/i2c/max96714.c @@ -327,6 +327,7 @@ static int max96714_disable_streams(struct v4l2_subdev *sd, } static int max96714_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -339,7 +340,7 @@ static int max96714_set_fmt(struct v4l2_subdev *sd, /* No transcoding, source and sink formats must match. */ if (format->pad == MAX96714_PAD_SOURCE) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); fmt = v4l2_subdev_state_get_format(state, format->pad, format->stream); if (!fmt) diff --git a/drivers/media/i2c/max96717.c b/drivers/media/i2c/max96717.c index 72f021b1a7b9..58bb2bf341db 100644 --- a/drivers/media/i2c/max96717.c +++ b/drivers/media/i2c/max96717.c @@ -414,6 +414,7 @@ static int max96717_set_routing(struct v4l2_subdev *sd, } static int max96717_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -427,7 +428,7 @@ static int max96717_set_fmt(struct v4l2_subdev *sd, /* No transcoding, source and sink formats must match. */ if (format->pad == MAX96717_PAD_SOURCE) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); /* Set sink format */ fmt = v4l2_subdev_state_get_format(state, format->pad, format->stream); diff --git a/drivers/media/i2c/ml86v7667.c b/drivers/media/i2c/ml86v7667.c index 57ba3693649a..0db1e8114751 100644 --- a/drivers/media/i2c/ml86v7667.c +++ b/drivers/media/i2c/ml86v7667.c @@ -200,6 +200,7 @@ static int ml86v7667_enum_mbus_code(struct v4l2_subdev *sd, } static int ml86v7667_fill_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/mt9m001.c b/drivers/media/i2c/mt9m001.c index 7a6114d18dfc..139154957571 100644 --- a/drivers/media/i2c/mt9m001.c +++ b/drivers/media/i2c/mt9m001.c @@ -248,6 +248,7 @@ static int mt9m001_s_stream(struct v4l2_subdev *sd, int enable) } static int mt9m001_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -289,6 +290,7 @@ static int mt9m001_set_selection(struct v4l2_subdev *sd, } static int mt9m001_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -314,6 +316,7 @@ static int mt9m001_get_selection(struct v4l2_subdev *sd, } static int mt9m001_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -359,7 +362,7 @@ static int mt9m001_s_fmt(struct v4l2_subdev *sd, int ret; /* No support for scaling so far, just crop. TODO: use skipping */ - ret = mt9m001_set_selection(sd, NULL, &sel); + ret = mt9m001_set_selection(sd, NULL, NULL, &sel); if (!ret) { mf->width = mt9m001->rect.width; mf->height = mt9m001->rect.height; @@ -371,6 +374,7 @@ static int mt9m001_s_fmt(struct v4l2_subdev *sd, } static int mt9m001_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index 3532c7c38bec..ac4461b465cf 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -446,6 +446,7 @@ static int mt9m111_reset(struct mt9m111 *mt9m111) } static int mt9m111_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -490,6 +491,7 @@ static int mt9m111_set_selection(struct v4l2_subdev *sd, } static int mt9m111_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -515,6 +517,7 @@ static int mt9m111_get_selection(struct v4l2_subdev *sd, } static int mt9m111_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -617,6 +620,7 @@ static int mt9m111_set_pixfmt(struct mt9m111 *mt9m111, } static int mt9m111_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c index e395e2d14e97..813345bfa195 100644 --- a/drivers/media/i2c/mt9m114.c +++ b/drivers/media/i2c/mt9m114.c @@ -1255,6 +1255,7 @@ static int mt9m114_pa_enum_framesizes(struct v4l2_subdev *sd, } static int mt9m114_pa_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -1282,6 +1283,7 @@ static int mt9m114_pa_set_fmt(struct v4l2_subdev *sd, } static int mt9m114_pa_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -1305,6 +1307,7 @@ static int mt9m114_pa_get_selection(struct v4l2_subdev *sd, } static int mt9m114_pa_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -1878,6 +1881,7 @@ static void mt9m114_ifp_update_sel_and_src_fmt(struct v4l2_subdev_state *state) } static int mt9m114_ifp_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -1924,6 +1928,7 @@ static int mt9m114_ifp_set_fmt(struct v4l2_subdev *sd, } static int mt9m114_ifp_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -1983,6 +1988,7 @@ static int mt9m114_ifp_get_selection(struct v4l2_subdev *sd, } static int mt9m114_ifp_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c index ea5d43d925ff..d78a6e814d61 100644 --- a/drivers/media/i2c/mt9p031.c +++ b/drivers/media/i2c/mt9p031.c @@ -574,6 +574,7 @@ __mt9p031_get_pad_crop(struct mt9p031 *mt9p031, } static int mt9p031_get_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -585,6 +586,7 @@ static int mt9p031_get_format(struct v4l2_subdev *subdev, } static int mt9p031_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -623,6 +625,7 @@ static int mt9p031_set_format(struct v4l2_subdev *subdev, } static int mt9p031_get_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -647,6 +650,7 @@ static int mt9p031_get_selection(struct v4l2_subdev *subdev, } static int mt9p031_set_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/mt9t112.c b/drivers/media/i2c/mt9t112.c index 2d2c840fc002..97452ab2bd89 100644 --- a/drivers/media/i2c/mt9t112.c +++ b/drivers/media/i2c/mt9t112.c @@ -872,6 +872,7 @@ static int mt9t112_set_params(struct mt9t112_priv *priv, } static int mt9t112_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -897,6 +898,7 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd, } static int mt9t112_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -912,6 +914,7 @@ static int mt9t112_set_selection(struct v4l2_subdev *sd, } static int mt9t112_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -953,6 +956,7 @@ static int mt9t112_s_fmt(struct v4l2_subdev *sd, } static int mt9t112_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/mt9v011.c b/drivers/media/i2c/mt9v011.c index 055b7915260a..d6faa4974bf8 100644 --- a/drivers/media/i2c/mt9v011.c +++ b/drivers/media/i2c/mt9v011.c @@ -336,6 +336,7 @@ static int mt9v011_enum_mbus_code(struct v4l2_subdev *sd, } static int mt9v011_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c index d4359d5b92bb..994bb7aa0cb5 100644 --- a/drivers/media/i2c/mt9v032.c +++ b/drivers/media/i2c/mt9v032.c @@ -468,6 +468,7 @@ static int mt9v032_enum_frame_size(struct v4l2_subdev *subdev, } static int mt9v032_get_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -503,6 +504,7 @@ static unsigned int mt9v032_calc_ratio(unsigned int input, unsigned int output) } static int mt9v032_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -547,6 +549,7 @@ static int mt9v032_set_format(struct v4l2_subdev *subdev, } static int mt9v032_get_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -561,6 +564,7 @@ static int mt9v032_get_selection(struct v4l2_subdev *subdev, } static int mt9v032_set_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/mt9v111.c b/drivers/media/i2c/mt9v111.c index 64a758c95ab7..6b7d72efb3e7 100644 --- a/drivers/media/i2c/mt9v111.c +++ b/drivers/media/i2c/mt9v111.c @@ -868,6 +868,7 @@ static int mt9v111_enum_frame_size(struct v4l2_subdev *subdev, } static int mt9v111_get_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -886,6 +887,7 @@ static int mt9v111_get_format(struct v4l2_subdev *subdev, } static int mt9v111_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/og01a1b.c b/drivers/media/i2c/og01a1b.c index 1d109ca75d76..d18b10fb0a1f 100644 --- a/drivers/media/i2c/og01a1b.c +++ b/drivers/media/i2c/og01a1b.c @@ -677,6 +677,7 @@ static int og01a1b_disable_streams(struct v4l2_subdev *sd, } static int og01a1b_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/og0ve1b.c b/drivers/media/i2c/og0ve1b.c index 84a28cdcade1..84682389d989 100644 --- a/drivers/media/i2c/og0ve1b.c +++ b/drivers/media/i2c/og0ve1b.c @@ -481,6 +481,7 @@ static int og0ve1b_disable_streams(struct v4l2_subdev *sd, } static int og0ve1b_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -544,7 +545,7 @@ static int og0ve1b_init_state(struct v4l2_subdev *sd, }, }; - og0ve1b_set_pad_format(sd, state, &fmt); + og0ve1b_set_pad_format(sd, NULL, state, &fmt); return 0; } diff --git a/drivers/media/i2c/os05b10.c b/drivers/media/i2c/os05b10.c index e0453c988e4a..a46cfa513e98 100644 --- a/drivers/media/i2c/os05b10.c +++ b/drivers/media/i2c/os05b10.c @@ -595,6 +595,7 @@ static int os05b10_set_framing_limits(struct os05b10 *os05b10, } static int os05b10_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -624,6 +625,7 @@ static int os05b10_set_pad_format(struct v4l2_subdev *sd, } static int os05b10_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov01a10.c b/drivers/media/i2c/ov01a10.c index 8a29e5b4b6ba..b9a7dacd603e 100644 --- a/drivers/media/i2c/ov01a10.c +++ b/drivers/media/i2c/ov01a10.c @@ -634,6 +634,7 @@ static void ov01a10_update_blank_ctrls(struct ov01a10 *ov01a10, } static int ov01a10_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -715,6 +716,7 @@ static int ov01a10_enum_frame_size(struct v4l2_subdev *sd, } static int ov01a10_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -747,6 +749,7 @@ static int ov01a10_get_selection(struct v4l2_subdev *sd, } static int ov01a10_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov02a10.c b/drivers/media/i2c/ov02a10.c index 143dcfe10445..7fc267963d04 100644 --- a/drivers/media/i2c/ov02a10.c +++ b/drivers/media/i2c/ov02a10.c @@ -296,6 +296,7 @@ static void ov02a10_fill_fmt(const struct ov02a10_mode *mode, } static int ov02a10_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -328,6 +329,7 @@ static int ov02a10_set_fmt(struct v4l2_subdev *sd, } static int ov02a10_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -523,7 +525,7 @@ static int ov02a10_init_state(struct v4l2_subdev *sd, } }; - ov02a10_set_fmt(sd, sd_state, &fmt); + ov02a10_set_fmt(sd, NULL, sd_state, &fmt); return 0; } diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c index cf93d36032e1..d622f5dcac60 100644 --- a/drivers/media/i2c/ov02c10.c +++ b/drivers/media/i2c/ov02c10.c @@ -701,6 +701,7 @@ static int ov02c10_power_on(struct device *dev) } static int ov02c10_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c index 4a64cba99991..fde8cdf4b88f 100644 --- a/drivers/media/i2c/ov02e10.c +++ b/drivers/media/i2c/ov02e10.c @@ -590,6 +590,7 @@ static int ov02e10_power_on(struct device *dev) } static int ov02e10_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -642,6 +643,7 @@ static int ov02e10_set_format(struct v4l2_subdev *sd, } static int ov02e10_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov08d10.c b/drivers/media/i2c/ov08d10.c index 9adef5446a61..3cd7a5d1e66a 100644 --- a/drivers/media/i2c/ov08d10.c +++ b/drivers/media/i2c/ov08d10.c @@ -1178,6 +1178,7 @@ static int ov08d10_set_stream(struct v4l2_subdev *sd, int enable) } static int ov08d10_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1226,6 +1227,7 @@ static int ov08d10_set_format(struct v4l2_subdev *sd, } static int ov08d10_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov08x40.c b/drivers/media/i2c/ov08x40.c index 5eaf454f4763..1bbe8f056e08 100644 --- a/drivers/media/i2c/ov08x40.c +++ b/drivers/media/i2c/ov08x40.c @@ -1829,6 +1829,7 @@ static int ov08x40_do_get_pad_format(struct ov08x40 *ov08x, } static int ov08x40_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1844,6 +1845,7 @@ static int ov08x40_get_pad_format(struct v4l2_subdev *sd, static int ov08x40_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c index 162b49046990..aa48abfb4eb5 100644 --- a/drivers/media/i2c/ov13858.c +++ b/drivers/media/i2c/ov13858.c @@ -1330,6 +1330,7 @@ static int ov13858_do_get_pad_format(struct ov13858 *ov13858, } static int ov13858_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1345,6 +1346,7 @@ static int ov13858_get_pad_format(struct v4l2_subdev *sd, static int ov13858_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov13b10.c b/drivers/media/i2c/ov13b10.c index 5421874732bc..a96c045b913f 100644 --- a/drivers/media/i2c/ov13b10.c +++ b/drivers/media/i2c/ov13b10.c @@ -1096,6 +1096,7 @@ static int ov13b10_do_get_pad_format(struct ov13b10 *ov13b, } static int ov13b10_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1111,6 +1112,7 @@ static int ov13b10_get_pad_format(struct v4l2_subdev *sd, static int ov13b10_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index d27fc2df64e6..8b9b3b951bc2 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -909,6 +909,7 @@ static int ov2640_set_params(struct i2c_client *client, } static int ov2640_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -938,6 +939,7 @@ static int ov2640_get_fmt(struct v4l2_subdev *sd, } static int ov2640_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1028,6 +1030,7 @@ static int ov2640_enum_mbus_code(struct v4l2_subdev *sd, } static int ov2640_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c index 061401b020fc..479cbff65f84 100644 --- a/drivers/media/i2c/ov2659.c +++ b/drivers/media/i2c/ov2659.c @@ -1022,6 +1022,7 @@ static int ov2659_enum_frame_sizes(struct v4l2_subdev *sd, } static int ov2659_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1080,6 +1081,7 @@ static void __ov2659_try_frame_size(struct v4l2_mbus_framefmt *mf, } static int ov2659_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c index 78e63bd1b35b..e817297d9596 100644 --- a/drivers/media/i2c/ov2680.c +++ b/drivers/media/i2c/ov2680.c @@ -623,6 +623,7 @@ static int ov2680_enum_mbus_code(struct v4l2_subdev *sd, } static int ov2680_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -640,6 +641,7 @@ static int ov2680_get_fmt(struct v4l2_subdev *sd, } static int ov2680_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -704,6 +706,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd, } static int ov2680_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -734,6 +737,7 @@ static int ov2680_get_selection(struct v4l2_subdev *sd, } static int ov2680_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c index 4911a4eea126..f9a5c5075fc9 100644 --- a/drivers/media/i2c/ov2685.c +++ b/drivers/media/i2c/ov2685.c @@ -340,6 +340,7 @@ static void ov2685_fill_fmt(const struct ov2685_mode *mode, } static int ov2685_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -353,6 +354,7 @@ static int ov2685_set_fmt(struct v4l2_subdev *sd, } static int ov2685_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -413,6 +415,7 @@ __ov2685_get_pad_crop(struct ov2685 *ov2685, } static int ov2685_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov2732.c b/drivers/media/i2c/ov2732.c index 40035320fec6..57dd0dd3fd85 100644 --- a/drivers/media/i2c/ov2732.c +++ b/drivers/media/i2c/ov2732.c @@ -281,6 +281,7 @@ static int ov2732_enum_frame_size(struct v4l2_subdev *sd, } static int ov2732_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -317,6 +318,7 @@ static int ov2732_set_fmt(struct v4l2_subdev *sd, } static int ov2732_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -442,7 +444,7 @@ static int ov2732_init_state(struct v4l2_subdev *sd, } }; - return ov2732_set_fmt(sd, sd_state, &fmt); + return ov2732_set_fmt(sd, NULL, sd_state, &fmt); } static const struct v4l2_subdev_internal_ops ov2732_internal_ops = { diff --git a/drivers/media/i2c/ov2735.c b/drivers/media/i2c/ov2735.c index dcb1add1fd9f..90d8be72b559 100644 --- a/drivers/media/i2c/ov2735.c +++ b/drivers/media/i2c/ov2735.c @@ -674,6 +674,7 @@ static int ov2735_disable_streams(struct v4l2_subdev *sd, } static int ov2735_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -742,6 +743,7 @@ static int ov2735_set_framing_limits(struct ov2735 *ov2735, } static int ov2735_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -792,7 +794,7 @@ static int ov2735_init_state(struct v4l2_subdev *sd, }, }; - ov2735_set_pad_format(sd, state, &fmt); + ov2735_set_pad_format(sd, NULL, state, &fmt); return 0; } diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c index fb590dfadda1..4023b5b7ca82 100644 --- a/drivers/media/i2c/ov2740.c +++ b/drivers/media/i2c/ov2740.c @@ -1023,6 +1023,7 @@ static int ov2740_set_stream(struct v4l2_subdev *sd, int enable) } static int ov2740_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov4689.c b/drivers/media/i2c/ov4689.c index a59d25b09b5b..466b6f74d982 100644 --- a/drivers/media/i2c/ov4689.c +++ b/drivers/media/i2c/ov4689.c @@ -330,6 +330,7 @@ static void ov4689_fill_fmt(const struct ov4689_mode *mode, } static int ov4689_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -385,6 +386,7 @@ static int ov4689_enable_test_pattern(struct ov4689 *ov4689, u32 pattern) } static int ov4689_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 85ecc23b3587..051e066d3e8e 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -2786,6 +2786,7 @@ static int ov5640_try_frame_interval(struct ov5640_dev *sensor, } static int ov5640_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -2948,6 +2949,7 @@ static int ov5640_update_pixel_rate(struct ov5640_dev *sensor) } static int ov5640_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -2994,6 +2996,7 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd, } static int ov5640_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index b10d408034a1..149b09aafa72 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -848,6 +848,7 @@ static int ov5645_enum_frame_size(struct v4l2_subdev *subdev, } static int ov5645_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -905,12 +906,13 @@ static int ov5645_init_state(struct v4l2_subdev *subdev, }, }; - ov5645_set_format(subdev, sd_state, &fmt); + ov5645_set_format(subdev, NULL, sd_state, &fmt); return 0; } static int ov5645_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c index db9bd2892140..ce705c01a30e 100644 --- a/drivers/media/i2c/ov5647.c +++ b/drivers/media/i2c/ov5647.c @@ -762,6 +762,7 @@ static int ov5647_enum_frame_size(struct v4l2_subdev *sd, } static int ov5647_get_pad_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -787,6 +788,7 @@ static int ov5647_get_pad_fmt(struct v4l2_subdev *sd, } static int ov5647_set_pad_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -837,6 +839,7 @@ static int ov5647_set_pad_fmt(struct v4l2_subdev *sd, } static int ov5647_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov5648.c b/drivers/media/i2c/ov5648.c index f0b839cd65f1..29583025f081 100644 --- a/drivers/media/i2c/ov5648.c +++ b/drivers/media/i2c/ov5648.c @@ -2194,6 +2194,7 @@ static void ov5648_mbus_format_fill(struct v4l2_mbus_framefmt *mbus_format, } static int ov5648_get_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -2215,6 +2216,7 @@ static int ov5648_get_fmt(struct v4l2_subdev *subdev, } static int ov5648_set_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index 04b3183b7bcb..1d3b3e8aae8e 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -2272,6 +2272,7 @@ static int ov5670_do_get_pad_format(struct ov5670 *ov5670, } static int ov5670_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2286,6 +2287,7 @@ static int ov5670_get_pad_format(struct v4l2_subdev *sd, } static int ov5670_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2554,6 +2556,7 @@ __ov5670_get_pad_crop(struct ov5670 *sensor, struct v4l2_subdev_state *state, } static int ov5670_get_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov5675.c b/drivers/media/i2c/ov5675.c index 508149485248..fd7f8bb62b8f 100644 --- a/drivers/media/i2c/ov5675.c +++ b/drivers/media/i2c/ov5675.c @@ -1016,6 +1016,7 @@ static int ov5675_power_on(struct device *dev) } static int ov5675_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1057,6 +1058,7 @@ static int ov5675_set_format(struct v4l2_subdev *sd, } static int ov5675_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1075,6 +1077,7 @@ static int ov5675_get_format(struct v4l2_subdev *sd, } static int ov5675_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index 4cc796bbee92..d624f5c476f9 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -796,6 +796,7 @@ __ov5693_get_pad_crop(struct ov5693_device *ov5693, } static int ov5693_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -807,6 +808,7 @@ static int ov5693_get_fmt(struct v4l2_subdev *sd, } static int ov5693_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -882,6 +884,7 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd, } static int ov5693_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -915,6 +918,7 @@ static int ov5693_get_selection(struct v4l2_subdev *sd, } static int ov5693_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov5695.c b/drivers/media/i2c/ov5695.c index 5bb6ce7b3237..71c0f3f5c203 100644 --- a/drivers/media/i2c/ov5695.c +++ b/drivers/media/i2c/ov5695.c @@ -805,6 +805,7 @@ ov5695_find_best_fit(struct v4l2_subdev_format *fmt) } static int ov5695_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -838,6 +839,7 @@ static int ov5695_set_fmt(struct v4l2_subdev *sd, } static int ov5695_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov6211.c b/drivers/media/i2c/ov6211.c index 034d5d57d67e..2ad31b2c5249 100644 --- a/drivers/media/i2c/ov6211.c +++ b/drivers/media/i2c/ov6211.c @@ -459,6 +459,7 @@ static int ov6211_disable_streams(struct v4l2_subdev *sd, } static int ov6211_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -522,7 +523,7 @@ static int ov6211_init_state(struct v4l2_subdev *sd, }, }; - ov6211_set_pad_format(sd, state, &fmt); + ov6211_set_pad_format(sd, NULL, state, &fmt); return 0; } diff --git a/drivers/media/i2c/ov64a40.c b/drivers/media/i2c/ov64a40.c index 78b62c169b99..7beddf480b8a 100644 --- a/drivers/media/i2c/ov64a40.c +++ b/drivers/media/i2c/ov64a40.c @@ -3107,6 +3107,7 @@ static int ov64a40_enum_frame_size(struct v4l2_subdev *sd, } static int ov64a40_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -3138,6 +3139,7 @@ static int ov64a40_get_selection(struct v4l2_subdev *sd, } static int ov64a40_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c index 27afc3fc0175..32da4630fd9c 100644 --- a/drivers/media/i2c/ov7251.c +++ b/drivers/media/i2c/ov7251.c @@ -1150,6 +1150,7 @@ __ov7251_get_pad_format(struct ov7251 *ov7251, } static int ov7251_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1214,6 +1215,7 @@ ov7251_find_mode_by_ival(struct ov7251 *ov7251, struct v4l2_fract *timeperframe) } static int ov7251_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1296,12 +1298,13 @@ static int ov7251_init_state(struct v4l2_subdev *subdev, } }; - ov7251_set_format(subdev, sd_state, &fmt); + ov7251_set_format(subdev, NULL, sd_state, &fmt); return 0; } static int ov7251_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index 0cb96b6c9990..125a80256f34 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c @@ -1098,6 +1098,7 @@ static int ov7670_apply_fmt(struct v4l2_subdev *sd) * Set a format. */ static int ov7670_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1133,6 +1134,7 @@ static int ov7670_set_fmt(struct v4l2_subdev *sd, } static int ov7670_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c index 062e1023a411..66123d9a7b98 100644 --- a/drivers/media/i2c/ov772x.c +++ b/drivers/media/i2c/ov772x.c @@ -1171,6 +1171,7 @@ static int ov772x_set_params(struct ov772x_priv *priv, } static int ov772x_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1193,6 +1194,7 @@ static int ov772x_get_selection(struct v4l2_subdev *sd, } static int ov772x_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1212,6 +1214,7 @@ static int ov772x_get_fmt(struct v4l2_subdev *sd, } static int ov772x_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/ov7740.c b/drivers/media/i2c/ov7740.c index 632fb80469be..7f637703b865 100644 --- a/drivers/media/i2c/ov7740.c +++ b/drivers/media/i2c/ov7740.c @@ -766,6 +766,7 @@ static int ov7740_try_fmt_internal(struct v4l2_subdev *sd, } static int ov7740_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -808,6 +809,7 @@ static int ov7740_set_fmt(struct v4l2_subdev *sd, } static int ov7740_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c index 8bedb47cd7cf..6164e95def8c 100644 --- a/drivers/media/i2c/ov8856.c +++ b/drivers/media/i2c/ov8856.c @@ -2132,6 +2132,7 @@ static int ov8856_power_off(struct device *dev) } static int ov8856_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2178,6 +2179,7 @@ static int ov8856_set_format(struct v4l2_subdev *sd, } static int ov8856_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov8858.c b/drivers/media/i2c/ov8858.c index 3f45f7fab833..0bfc4350a8c9 100644 --- a/drivers/media/i2c/ov8858.c +++ b/drivers/media/i2c/ov8858.c @@ -1409,6 +1409,7 @@ static const struct v4l2_subdev_video_ops ov8858_video_ops = { */ static int ov8858_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -1486,7 +1487,7 @@ static int ov8858_init_state(struct v4l2_subdev *sd, }, }; - ov8858_set_fmt(sd, sd_state, &fmt); + ov8858_set_fmt(sd, NULL, sd_state, &fmt); return 0; } diff --git a/drivers/media/i2c/ov8865.c b/drivers/media/i2c/ov8865.c index a8586df14f77..35871264fc96 100644 --- a/drivers/media/i2c/ov8865.c +++ b/drivers/media/i2c/ov8865.c @@ -2668,6 +2668,7 @@ static void ov8865_mbus_format_fill(struct v4l2_mbus_framefmt *mbus_format, } static int ov8865_get_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -2689,6 +2690,7 @@ static int ov8865_get_fmt(struct v4l2_subdev *subdev, } static int ov8865_set_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -2797,6 +2799,7 @@ __ov8865_get_pad_crop(struct ov8865_sensor *sensor, } static int ov8865_get_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c index 5b6f897a74fc..f190ca0a3b73 100644 --- a/drivers/media/i2c/ov9282.c +++ b/drivers/media/i2c/ov9282.c @@ -761,6 +761,7 @@ static void ov9282_fill_pad_format(struct ov9282 *ov9282, } static int ov9282_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -780,6 +781,7 @@ static int ov9282_get_pad_format(struct v4l2_subdev *sd, } static int ov9282_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -826,7 +828,7 @@ static int ov9282_init_state(struct v4l2_subdev *sd, ov9282_fill_pad_format(ov9282, &supported_modes[DEFAULT_MODE], ov9282->code, &fmt); - return ov9282_set_pad_format(sd, sd_state, &fmt); + return ov9282_set_pad_format(sd, NULL, sd_state, &fmt); } static const struct v4l2_rect * @@ -845,6 +847,7 @@ __ov9282_get_pad_crop(struct ov9282 *ov9282, } static int ov9282_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov9640.c b/drivers/media/i2c/ov9640.c index 2190c52b1433..12c430b5dc80 100644 --- a/drivers/media/i2c/ov9640.c +++ b/drivers/media/i2c/ov9640.c @@ -519,6 +519,7 @@ static int ov9640_s_fmt(struct v4l2_subdev *sd, } static int ov9640_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -563,6 +564,7 @@ static int ov9640_enum_mbus_code(struct v4l2_subdev *sd, } static int ov9640_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/ov9650.c b/drivers/media/i2c/ov9650.c index c94e8fe29f22..4f7e9cf47f1d 100644 --- a/drivers/media/i2c/ov9650.c +++ b/drivers/media/i2c/ov9650.c @@ -1181,6 +1181,7 @@ static int ov965x_set_frame_interval(struct v4l2_subdev *sd, } static int ov965x_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1226,6 +1227,7 @@ static void __ov965x_try_frame_size(struct v4l2_mbus_framefmt *mf, } static int ov965x_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/ov9734.c b/drivers/media/i2c/ov9734.c index 0eaf33807fc9..ea7ea871f7fb 100644 --- a/drivers/media/i2c/ov9734.c +++ b/drivers/media/i2c/ov9734.c @@ -681,6 +681,7 @@ static int ov9734_set_stream(struct v4l2_subdev *sd, int enable) } static int ov9734_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -722,6 +723,7 @@ static int ov9734_set_format(struct v4l2_subdev *sd, } static int ov9734_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c index 52e8e2620b4d..51dc3a2bf4e3 100644 --- a/drivers/media/i2c/rdacm20.c +++ b/drivers/media/i2c/rdacm20.c @@ -415,6 +415,7 @@ static int rdacm20_enum_mbus_code(struct v4l2_subdev *sd, } static int rdacm20_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c index bcab462708c7..433227548371 100644 --- a/drivers/media/i2c/rdacm21.c +++ b/drivers/media/i2c/rdacm21.c @@ -294,6 +294,7 @@ static int rdacm21_enum_mbus_code(struct v4l2_subdev *sd, } static int rdacm21_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/rj54n1cb0c.c b/drivers/media/i2c/rj54n1cb0c.c index e95342d706c3..99069d655631 100644 --- a/drivers/media/i2c/rj54n1cb0c.c +++ b/drivers/media/i2c/rj54n1cb0c.c @@ -541,6 +541,7 @@ static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h, s32 *out_w, s32 *out_h); static int rj54n1_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -578,6 +579,7 @@ static int rj54n1_set_selection(struct v4l2_subdev *sd, } static int rj54n1_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -603,6 +605,7 @@ static int rj54n1_get_selection(struct v4l2_subdev *sd, } static int rj54n1_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -973,6 +976,7 @@ static int rj54n1_reg_init(struct i2c_client *client) } static int rj54n1_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c index ab31ee2b596b..e81ffe3571d3 100644 --- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c +++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c @@ -995,6 +995,7 @@ static int s5c73m3_oif_get_pad_code(int pad, int index) } static int s5c73m3_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1030,6 +1031,7 @@ static int s5c73m3_get_fmt(struct v4l2_subdev *sd, } static int s5c73m3_oif_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1069,6 +1071,7 @@ static int s5c73m3_oif_get_fmt(struct v4l2_subdev *sd, } static int s5c73m3_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1108,6 +1111,7 @@ static int s5c73m3_set_fmt(struct v4l2_subdev *sd, } static int s5c73m3_oif_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/s5k3m5.c b/drivers/media/i2c/s5k3m5.c index c591b580d2e7..bdf5bea78685 100644 --- a/drivers/media/i2c/s5k3m5.c +++ b/drivers/media/i2c/s5k3m5.c @@ -958,6 +958,7 @@ static void s5k3m5_update_pad_format(struct s5k3m5 *s5k3m5, } static int s5k3m5_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -1038,6 +1039,7 @@ static int s5k3m5_enum_frame_size(struct v4l2_subdev *sd, } static int s5k3m5_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1075,7 +1077,7 @@ static int s5k3m5_init_state(struct v4l2_subdev *sd, }, }; - s5k3m5_set_pad_format(sd, state, &fmt); + s5k3m5_set_pad_format(sd, NULL, state, &fmt); return 0; } diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c index a580b7e63302..2b786829effd 100644 --- a/drivers/media/i2c/s5k5baf.c +++ b/drivers/media/i2c/s5k5baf.c @@ -1276,6 +1276,7 @@ static int s5k5baf_try_isp_format(struct v4l2_mbus_framefmt *mf) } static int s5k5baf_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1307,6 +1308,7 @@ static int s5k5baf_get_fmt(struct v4l2_subdev *sd, } static int s5k5baf_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1370,6 +1372,7 @@ static int s5k5baf_is_bound_target(u32 target) } static int s5k5baf_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/s5k6a3.c b/drivers/media/i2c/s5k6a3.c index ba6477e88da3..eebe1bfa3897 100644 --- a/drivers/media/i2c/s5k6a3.c +++ b/drivers/media/i2c/s5k6a3.c @@ -131,6 +131,7 @@ static struct v4l2_mbus_framefmt *__s5k6a3_get_format( } static int s5k6a3_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -149,6 +150,7 @@ static int s5k6a3_set_fmt(struct v4l2_subdev *sd, } static int s5k6a3_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/s5kjn1.c b/drivers/media/i2c/s5kjn1.c index a707cb740556..80d713ba3a1e 100644 --- a/drivers/media/i2c/s5kjn1.c +++ b/drivers/media/i2c/s5kjn1.c @@ -985,6 +985,7 @@ static void s5kjn1_update_pad_format(struct s5kjn1 *s5kjn1, } static int s5kjn1_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -1065,6 +1066,7 @@ static int s5kjn1_enum_frame_size(struct v4l2_subdev *sd, } static int s5kjn1_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1102,7 +1104,7 @@ static int s5kjn1_init_state(struct v4l2_subdev *sd, }, }; - s5kjn1_set_pad_format(sd, state, &fmt); + s5kjn1_set_pad_format(sd, NULL, state, &fmt); return 0; } diff --git a/drivers/media/i2c/saa6752hs.c b/drivers/media/i2c/saa6752hs.c index 1c0031ba43b4..cb3c0b877f46 100644 --- a/drivers/media/i2c/saa6752hs.c +++ b/drivers/media/i2c/saa6752hs.c @@ -543,6 +543,7 @@ static int saa6752hs_init(struct v4l2_subdev *sd, u32 leading_null_bytes) } static int saa6752hs_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -563,6 +564,7 @@ static int saa6752hs_get_fmt(struct v4l2_subdev *sd, } static int saa6752hs_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index 48d6730d9271..1eaa28d21364 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c @@ -1159,6 +1159,7 @@ static int saa711x_s_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_f } static int saa711x_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/saa717x.c b/drivers/media/i2c/saa717x.c index 713331be947c..65f8dccb8c59 100644 --- a/drivers/media/i2c/saa717x.c +++ b/drivers/media/i2c/saa717x.c @@ -980,6 +980,7 @@ static int saa717x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi #endif static int saa717x_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index 4675181af5fb..f9eabd9632d3 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -597,6 +597,7 @@ static int mipid02_enum_mbus_code(struct v4l2_subdev *sd, } static int mipid02_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/t4ka3.c b/drivers/media/i2c/t4ka3.c index 746548868bb0..3c07319015ec 100644 --- a/drivers/media/i2c/t4ka3.c +++ b/drivers/media/i2c/t4ka3.c @@ -364,6 +364,7 @@ static void t4ka3_get_vblank_limits(struct t4ka3_data *sensor, } static int t4ka3_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -627,6 +628,7 @@ static int t4ka3_disable_stream(struct v4l2_subdev *sd, } static int t4ka3_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -652,6 +654,7 @@ static int t4ka3_get_selection(struct v4l2_subdev *sd, } static int t4ka3_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 59f509aa1939..f36632cba2f5 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1797,6 +1797,7 @@ static u32 tc358743_g_colorspace(u32 code) } static int tc358743_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1816,6 +1817,7 @@ static int tc358743_get_fmt(struct v4l2_subdev *sd, } static int tc358743_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/tc358746.c b/drivers/media/i2c/tc358746.c index 86d9ba3ea4e5..b088e8d32aff 100644 --- a/drivers/media/i2c/tc358746.c +++ b/drivers/media/i2c/tc358746.c @@ -873,6 +873,7 @@ static int tc358746_enum_mbus_code(struct v4l2_subdev *sd, } static int tc358746_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -881,7 +882,7 @@ static int tc358746_set_fmt(struct v4l2_subdev *sd, /* Source follows the sink */ if (format->pad == TC358746_SOURCE) - return v4l2_subdev_get_fmt(sd, sd_state, format); + return v4l2_subdev_get_fmt(sd, NULL, sd_state, format); sink_fmt = v4l2_subdev_state_get_format(sd_state, TC358746_SINK); diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 5c6dda5338f5..f36e63eada06 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -1776,6 +1776,7 @@ static void tda1997x_fill_format(struct tda1997x_state *state, } static int tda1997x_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1798,6 +1799,7 @@ static int tda1997x_get_format(struct v4l2_subdev *sd, } static int tda1997x_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/thp7312.c b/drivers/media/i2c/thp7312.c index 775cfba188d8..f1c7f149c06c 100644 --- a/drivers/media/i2c/thp7312.c +++ b/drivers/media/i2c/thp7312.c @@ -729,6 +729,7 @@ static int thp7312_enum_frame_interval(struct v4l2_subdev *sd, } static int thp7312_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c index 7af8f37646d6..8d660d35bda2 100644 --- a/drivers/media/i2c/tvp514x.c +++ b/drivers/media/i2c/tvp514x.c @@ -856,6 +856,7 @@ static int tvp514x_enum_mbus_code(struct v4l2_subdev *sd, } static int tvp514x_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -880,6 +881,7 @@ static int tvp514x_get_pad_format(struct v4l2_subdev *sd, } static int tvp514x_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index e3675c744d9e..0237aaabf3df 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -1045,6 +1045,7 @@ tvp5150_get_pad_crop(struct tvp5150 *decoder, } static int tvp5150_fill_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1104,6 +1105,7 @@ static void tvp5150_set_hw_selection(struct v4l2_subdev *sd, } static int tvp5150_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1156,6 +1158,7 @@ static int tvp5150_set_selection(struct v4l2_subdev *sd, } static int tvp5150_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c index c09a5bd71fd0..912ab5a1a53b 100644 --- a/drivers/media/i2c/tvp7002.c +++ b/drivers/media/i2c/tvp7002.c @@ -830,6 +830,7 @@ tvp7002_enum_mbus_code(struct v4l2_subdev *sd, */ static int tvp7002_get_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -854,10 +855,11 @@ tvp7002_get_pad_format(struct v4l2_subdev *sd, */ static int tvp7002_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { - return tvp7002_get_pad_format(sd, sd_state, fmt); + return tvp7002_get_pad_format(sd, NULL, sd_state, fmt); } /* V4L2 core operation handlers */ diff --git a/drivers/media/i2c/tw9900.c b/drivers/media/i2c/tw9900.c index 53efdeaed1db..8aa5c7aeeb75 100644 --- a/drivers/media/i2c/tw9900.c +++ b/drivers/media/i2c/tw9900.c @@ -184,6 +184,7 @@ static void tw9900_fill_fmt(const struct tw9900_mode *mode, } static int tw9900_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -198,6 +199,7 @@ static int tw9900_get_fmt(struct v4l2_subdev *sd, } static int tw9900_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/i2c/tw9910.c b/drivers/media/i2c/tw9910.c index f3e400304e04..ea30f1b88951 100644 --- a/drivers/media/i2c/tw9910.c +++ b/drivers/media/i2c/tw9910.c @@ -715,6 +715,7 @@ static int tw9910_set_frame(struct v4l2_subdev *sd, u32 *width, u32 *height) } static int tw9910_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -741,6 +742,7 @@ static int tw9910_get_selection(struct v4l2_subdev *sd, } static int tw9910_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -792,6 +794,7 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, } static int tw9910_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c index 78d18c028154..513d2262b401 100644 --- a/drivers/media/i2c/vd55g1.c +++ b/drivers/media/i2c/vd55g1.c @@ -1217,6 +1217,7 @@ static int vd55g1_patch(struct vd55g1 *sensor) } static int vd55g1_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1300,6 +1301,7 @@ static int vd55g1_new_format_change_controls(struct vd55g1 *sensor, } static int vd55g1_set_pad_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sd_fmt) { @@ -1365,7 +1367,7 @@ static int vd55g1_init_state(struct v4l2_subdev *sd, vd55g1_get_fmt_code(sensor, VD55G1_MBUS_CODE_DEF), &fmt.format); - return vd55g1_set_pad_fmt(sd, sd_state, &fmt); + return vd55g1_set_pad_fmt(sd, NULL, sd_state, &fmt); } static int vd55g1_enum_frame_size(struct v4l2_subdev *sd, diff --git a/drivers/media/i2c/vd56g3.c b/drivers/media/i2c/vd56g3.c index 157acea9e286..ca0dd1b24072 100644 --- a/drivers/media/i2c/vd56g3.c +++ b/drivers/media/i2c/vd56g3.c @@ -823,6 +823,7 @@ static void vd56g3_update_img_pad_format(struct vd56g3 *sensor, } static int vd56g3_set_pad_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sd_fmt) { @@ -858,6 +859,7 @@ static int vd56g3_set_pad_fmt(struct v4l2_subdev *sd, } static int vd56g3_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1038,7 +1040,7 @@ static int vd56g3_init_state(struct v4l2_subdev *sd, }, }; - return vd56g3_set_pad_fmt(sd, sd_state, &fmt); + return vd56g3_set_pad_fmt(sd, NULL, sd_state, &fmt); } static const struct v4l2_subdev_video_ops vd56g3_video_ops = { diff --git a/drivers/media/i2c/vgxy61.c b/drivers/media/i2c/vgxy61.c index 3fb2166c81ef..5f85bea840b3 100644 --- a/drivers/media/i2c/vgxy61.c +++ b/drivers/media/i2c/vgxy61.c @@ -652,6 +652,7 @@ static int vgxy61_try_fmt_internal(struct v4l2_subdev *sd, } static int vgxy61_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -687,6 +688,7 @@ static int vgxy61_enum_mbus_code(struct v4l2_subdev *sd, } static int vgxy61_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1197,6 +1199,7 @@ static int vgxy61_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, } static int vgxy61_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -1260,7 +1263,7 @@ static int vgxy61_init_state(struct v4l2_subdev *sd, vgxy61_fill_framefmt(sensor, sensor->current_mode, &fmt.format, VGXY61_MEDIA_BUS_FMT_DEF); - return vgxy61_set_fmt(sd, sd_state, &fmt); + return vgxy61_set_fmt(sd, NULL, sd_state, &fmt); } static int vgxy61_s_ctrl(struct v4l2_ctrl *ctrl) diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c index 9b9f69ff4016..2053849c9b4c 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.c +++ b/drivers/media/pci/cobalt/cobalt-driver.c @@ -525,8 +525,8 @@ static int cobalt_subdevs_init(struct cobalt *cobalt) &cobalt_edid); if (err) return err; - err = v4l2_subdev_call(s[i].sd, pad, set_fmt, NULL, - &sd_fmt); + err = v4l2_subdev_call(s[i].sd, pad, set_fmt, NULL, NULL, + &sd_fmt); if (err) return err; /* Reset channel video module */ @@ -609,8 +609,8 @@ static int cobalt_subdevs_hsma_init(struct cobalt *cobalt) if (err) return err; - err = v4l2_subdev_call(s->sd, pad, set_fmt, NULL, - &sd_fmt); + err = v4l2_subdev_call(s->sd, pad, set_fmt, NULL, NULL, + &sd_fmt); if (err) return err; cobalt->have_hsma_rx = true; diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c index 51fd9576c6c2..bca8cc6cd4f7 100644 --- a/drivers/media/pci/cobalt/cobalt-v4l2.c +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c @@ -172,7 +172,7 @@ static void cobalt_enable_output(struct cobalt_stream *s) sd_fmt.format.code = MEDIA_BUS_FMT_RGB888_1X24; break; } - v4l2_subdev_call(s->sd, pad, set_fmt, NULL, &sd_fmt); + v4l2_subdev_call(s->sd, pad, set_fmt, NULL, NULL, &sd_fmt); iowrite32(0, &vo->control); /* 1080p60 */ @@ -223,14 +223,14 @@ static void cobalt_enable_input(struct cobalt_stream *s) iowrite32(M00235_CONTROL_BITMAP_ENABLE_MSK | (1 << M00235_CONTROL_BITMAP_PACK_FORMAT_OFST), &packer->control); - v4l2_subdev_call(s->sd, pad, set_fmt, NULL, + v4l2_subdev_call(s->sd, pad, set_fmt, NULL, NULL, &sd_fmt_yuyv); break; case V4L2_PIX_FMT_RGB24: iowrite32(M00235_CONTROL_BITMAP_ENABLE_MSK | (2 << M00235_CONTROL_BITMAP_PACK_FORMAT_OFST), &packer->control); - v4l2_subdev_call(s->sd, pad, set_fmt, NULL, + v4l2_subdev_call(s->sd, pad, set_fmt, NULL, NULL, &sd_fmt_rgb); break; case V4L2_PIX_FMT_BGR32: @@ -238,7 +238,7 @@ static void cobalt_enable_input(struct cobalt_stream *s) M00235_CONTROL_BITMAP_ENDIAN_FORMAT_MSK | (3 << M00235_CONTROL_BITMAP_PACK_FORMAT_OFST), &packer->control); - v4l2_subdev_call(s->sd, pad, set_fmt, NULL, + v4l2_subdev_call(s->sd, pad, set_fmt, NULL, NULL, &sd_fmt_rgb); break; } @@ -716,7 +716,7 @@ static int cobalt_g_fmt_vid_cap(struct file *file, void *priv, .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; - v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt); + v4l2_subdev_call(s->sd, pad, get_fmt, NULL, NULL, &sd_fmt); v4l2_fill_pix_format(pix, &sd_fmt.format); } @@ -760,7 +760,7 @@ static int cobalt_try_fmt_vid_cap(struct file *file, void *priv, .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; - v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt); + v4l2_subdev_call(s->sd, pad, get_fmt, NULL, NULL, &sd_fmt); v4l2_fill_pix_format(pix, &sd_fmt.format); } @@ -938,7 +938,7 @@ static int cobalt_s_fmt_vid_out(struct file *file, void *priv, s->ycbcr_enc = pix->ycbcr_enc; s->quantization = pix->quantization; v4l2_fill_mbus_format(&sd_fmt.format, pix, code); - v4l2_subdev_call(s->sd, pad, set_fmt, NULL, &sd_fmt); + v4l2_subdev_call(s->sd, pad, set_fmt, NULL, NULL, &sd_fmt); return 0; } diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c index 4fb19d26ee29..f5961853eeae 100644 --- a/drivers/media/pci/cx18/cx18-av-core.c +++ b/drivers/media/pci/cx18/cx18-av-core.c @@ -930,6 +930,7 @@ static int cx18_av_s_ctrl(struct v4l2_ctrl *ctrl) } static int cx18_av_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/pci/cx18/cx18-controls.c b/drivers/media/pci/cx18/cx18-controls.c index 78eadad8b6e8..41f388ba22ab 100644 --- a/drivers/media/pci/cx18/cx18-controls.c +++ b/drivers/media/pci/cx18/cx18-controls.c @@ -85,7 +85,7 @@ static int cx18_s_video_encoding(struct cx2341x_handler *cxhdl, u32 val) fmt->width = cxhdl->width / (is_mpeg1 ? 2 : 1); fmt->height = cxhdl->height; fmt->code = MEDIA_BUS_FMT_FIXED; - v4l2_subdev_call(cx->sd_av, pad, set_fmt, NULL, &format); + v4l2_subdev_call(cx->sd_av, pad, set_fmt, NULL, NULL, &format); return 0; } diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c index 0d676a57e24e..6f8d7f700016 100644 --- a/drivers/media/pci/cx18/cx18-ioctl.c +++ b/drivers/media/pci/cx18/cx18-ioctl.c @@ -150,7 +150,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh, format.format.width = cx->cxhdl.width = w; format.format.height = cx->cxhdl.height = h; format.format.code = MEDIA_BUS_FMT_FIXED; - v4l2_subdev_call(cx->sd_av, pad, set_fmt, NULL, &format); + v4l2_subdev_call(cx->sd_av, pad, set_fmt, NULL, NULL, &format); return cx18_g_fmt_vid_cap(file, fh, fmt); } diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 14d219fd1d8a..94ce00154e1f 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -134,7 +134,7 @@ int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm) format.format.width = dev->width; format.format.height = dev->height; format.format.field = dev->field; - call_all(dev, pad, set_fmt, NULL, &format); + call_all(dev, pad, set_fmt, NULL, NULL, &format); return 0; } @@ -619,7 +619,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, dprintk(2, "%s() width=%d height=%d field=%d\n", __func__, dev->width, dev->height, dev->field); v4l2_fill_mbus_format(&format.format, &f->fmt.pix, MEDIA_BUS_FMT_FIXED); - call_all(dev, pad, set_fmt, NULL, &format); + call_all(dev, pad, set_fmt, NULL, NULL, &format); v4l2_fill_pix_format(&f->fmt.pix, &format.format); /* set_fmt overwrites f->fmt.pix.field, restore it */ f->fmt.pix.field = dev->field; diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c index 986b9afd7cb5..8b3f4d732fd7 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -1229,6 +1229,7 @@ static int cio2_subdev_init_state(struct v4l2_subdev *sd, } static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1241,7 +1242,7 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, * source always propagates from sink */ if (fmt->pad == CIO2_PAD_SOURCE) - return v4l2_subdev_get_fmt(sd, sd_state, fmt); + return v4l2_subdev_get_fmt(sd, NULL, sd_state, fmt); fmt->format.code = formats[0].mbus_code; @@ -1287,7 +1288,7 @@ static int cio2_subdev_link_validate_get_format(struct media_pad *pad, memset(fmt, 0, sizeof(*fmt)); fmt->which = V4L2_SUBDEV_FORMAT_ACTIVE; fmt->pad = pad->index; - return v4l2_subdev_call(sd, pad, get_fmt, NULL, fmt); + return v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, fmt); } return -EINVAL; diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c index 7e539a0c6c92..f64d8d9a6281 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c @@ -403,6 +403,7 @@ static int ipu6_isys_csi2_disable_streams(struct v4l2_subdev *sd, } static int ipu6_isys_csi2_set_sel(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -454,6 +455,7 @@ static int ipu6_isys_csi2_set_sel(struct v4l2_subdev *sd, } static int ipu6_isys_csi2_get_sel(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-subdev.c b/drivers/media/pci/intel/ipu6/ipu6-isys-subdev.c index dbd6f76a066d..5dacc0a2aa9f 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys-subdev.c +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-subdev.c @@ -160,6 +160,7 @@ u32 ipu6_isys_convert_bayer_order(u32 code, int x, int y) } int ipu6_isys_subdev_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -174,7 +175,7 @@ int ipu6_isys_subdev_set_fmt(struct v4l2_subdev *sd, /* No transcoding, source and sink formats must match. */ if ((sd->entity.pads[format->pad].flags & MEDIA_PAD_FL_SOURCE) && sd->entity.num_pads > 1) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); format->format.width = clamp(format->format.width, IPU6_ISYS_MIN_WIDTH, IPU6_ISYS_MAX_WIDTH); diff --git a/drivers/media/pci/intel/ivsc/mei_csi.c b/drivers/media/pci/intel/ivsc/mei_csi.c index c2917e156345..f1dcf498cae7 100644 --- a/drivers/media/pci/intel/ivsc/mei_csi.c +++ b/drivers/media/pci/intel/ivsc/mei_csi.c @@ -338,6 +338,7 @@ static int mei_csi_init_state(struct v4l2_subdev *sd, } static int mei_csi_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/pci/ivtv/ivtv-controls.c b/drivers/media/pci/ivtv/ivtv-controls.c index f087a12c4ebd..816e634de1eb 100644 --- a/drivers/media/pci/ivtv/ivtv-controls.c +++ b/drivers/media/pci/ivtv/ivtv-controls.c @@ -60,7 +60,7 @@ static int ivtv_s_video_encoding(struct cx2341x_handler *cxhdl, u32 val) format.format.width = cxhdl->width / (is_mpeg1 ? 2 : 1); format.format.height = cxhdl->height; format.format.code = MEDIA_BUS_FMT_FIXED; - v4l2_subdev_call(itv->sd_video, pad, set_fmt, NULL, &format); + v4l2_subdev_call(itv->sd_video, pad, set_fmt, NULL, NULL, &format); return 0; } diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 8d5ea3aec06f..9eaaa4087b2a 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -591,7 +591,7 @@ static int ivtv_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f format.format.width = fmt->fmt.pix.width; format.format.height = h; format.format.code = MEDIA_BUS_FMT_FIXED; - v4l2_subdev_call(itv->sd_video, pad, set_fmt, NULL, &format); + v4l2_subdev_call(itv->sd_video, pad, set_fmt, NULL, NULL, &format); return ivtv_g_fmt_vid_cap(file, fh, fmt); } diff --git a/drivers/media/pci/saa7134/saa7134-empress.c b/drivers/media/pci/saa7134/saa7134-empress.c index 8c4f70e4177d..e851dd06416d 100644 --- a/drivers/media/pci/saa7134/saa7134-empress.c +++ b/drivers/media/pci/saa7134/saa7134-empress.c @@ -103,7 +103,7 @@ static int empress_g_fmt_vid_cap(struct file *file, void *priv, }; struct v4l2_mbus_framefmt *mbus_fmt = &fmt.format; - saa_call_all(dev, pad, get_fmt, NULL, &fmt); + saa_call_all(dev, pad, get_fmt, NULL, NULL, &fmt); v4l2_fill_pix_format(&f->fmt.pix, mbus_fmt); f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; @@ -122,7 +122,7 @@ static int empress_s_fmt_vid_cap(struct file *file, void *priv, }; v4l2_fill_mbus_format(&format.format, &f->fmt.pix, MEDIA_BUS_FMT_FIXED); - saa_call_all(dev, pad, set_fmt, NULL, &format); + saa_call_all(dev, pad, set_fmt, NULL, NULL, &format); v4l2_fill_pix_format(&f->fmt.pix, &format.format); f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; @@ -145,7 +145,7 @@ static int empress_try_fmt_vid_cap(struct file *file, void *priv, }; v4l2_fill_mbus_format(&format.format, &f->fmt.pix, MEDIA_BUS_FMT_FIXED); - saa_call_all(dev, pad, set_fmt, &pad_state, &format); + saa_call_all(dev, pad, set_fmt, NULL, &pad_state, &format); v4l2_fill_pix_format(&f->fmt.pix, &format.format); f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; diff --git a/drivers/media/platform/amlogic/c3/isp/c3-isp-capture.c b/drivers/media/platform/amlogic/c3/isp/c3-isp-capture.c index 11d85f5342f0..41ae490d628c 100644 --- a/drivers/media/platform/amlogic/c3/isp/c3-isp-capture.c +++ b/drivers/media/platform/amlogic/c3/isp/c3-isp-capture.c @@ -517,7 +517,7 @@ static int c3_isp_cap_link_validate(struct media_link *link) }; int ret; - ret = v4l2_subdev_call_state_active(sd, pad, get_fmt, &src_fmt); + ret = v4l2_subdev_call_ci_state_active(sd, pad, get_fmt, &src_fmt); if (ret) return ret; diff --git a/drivers/media/platform/amlogic/c3/isp/c3-isp-core.c b/drivers/media/platform/amlogic/c3/isp/c3-isp-core.c index ff6413fff889..553c808f8f3b 100644 --- a/drivers/media/platform/amlogic/c3/isp/c3-isp-core.c +++ b/drivers/media/platform/amlogic/c3/isp/c3-isp-core.c @@ -461,6 +461,7 @@ static void c3_isp_core_set_source_fmt(struct v4l2_subdev_state *state, } static int c3_isp_core_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/platform/amlogic/c3/isp/c3-isp-resizer.c b/drivers/media/platform/amlogic/c3/isp/c3-isp-resizer.c index 453a889e0b27..1f9c16eb0842 100644 --- a/drivers/media/platform/amlogic/c3/isp/c3-isp-resizer.c +++ b/drivers/media/platform/amlogic/c3/isp/c3-isp-resizer.c @@ -621,6 +621,7 @@ static void c3_isp_rsz_set_source_fmt(struct v4l2_subdev_state *state, } static int c3_isp_rsz_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -633,6 +634,7 @@ static int c3_isp_rsz_set_fmt(struct v4l2_subdev *sd, } static int c3_isp_rsz_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -674,6 +676,7 @@ static int c3_isp_rsz_get_selection(struct v4l2_subdev *sd, } static int c3_isp_rsz_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/amlogic/c3/mipi-adapter/c3-mipi-adap.c b/drivers/media/platform/amlogic/c3/mipi-adapter/c3-mipi-adap.c index 4bd98fb9c7e9..4c6ea03c9c38 100644 --- a/drivers/media/platform/amlogic/c3/mipi-adapter/c3-mipi-adap.c +++ b/drivers/media/platform/amlogic/c3/mipi-adapter/c3-mipi-adap.c @@ -521,6 +521,7 @@ static int c3_mipi_adap_enum_mbus_code(struct v4l2_subdev *sd, } static int c3_mipi_adap_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -528,7 +529,7 @@ static int c3_mipi_adap_set_fmt(struct v4l2_subdev *sd, const struct c3_adap_pix_format *pix_format; if (format->pad != C3_MIPI_ADAP_PAD_SINK) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); pix_format = c3_mipi_adap_find_format(format->format.code); if (!pix_format) diff --git a/drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c b/drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c index b9e4ef3fc308..923f65648629 100644 --- a/drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c +++ b/drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c @@ -491,6 +491,7 @@ static int c3_mipi_csi_enum_mbus_code(struct v4l2_subdev *sd, } static int c3_mipi_csi_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -498,7 +499,7 @@ static int c3_mipi_csi_set_fmt(struct v4l2_subdev *sd, unsigned int i; if (format->pad != C3_MIPI_CSI2_PAD_SINK) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); fmt = v4l2_subdev_state_get_format(state, format->pad); diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-capture.c b/drivers/media/platform/arm/mali-c55/mali-c55-capture.c index 7aaa5c3f7354..efdc69cedcb1 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-capture.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-capture.c @@ -291,7 +291,7 @@ static int mali_c55_link_validate(struct media_link *link) }; int ret; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &sd_fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &sd_fmt); if (ret) return ret; diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-isp.c b/drivers/media/platform/arm/mali-c55/mali-c55-isp.c index 4c0fd1ec741c..ea7a5248c954 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-isp.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-isp.c @@ -203,6 +203,7 @@ static int mali_c55_isp_enum_frame_size(struct v4l2_subdev *sd, } static int mali_c55_isp_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -217,7 +218,7 @@ static int mali_c55_isp_set_fmt(struct v4l2_subdev *sd, * format. */ if (format->pad != MALI_C55_ISP_PAD_SINK_VIDEO) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); sink_fmt = v4l2_subdev_state_get_format(state, MALI_C55_ISP_PAD_SINK_VIDEO); @@ -265,6 +266,7 @@ static int mali_c55_isp_set_fmt(struct v4l2_subdev *sd, } static int mali_c55_isp_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -278,6 +280,7 @@ static int mali_c55_isp_get_selection(struct v4l2_subdev *sd, } static int mali_c55_isp_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-resizer.c b/drivers/media/platform/arm/mali-c55/mali-c55-resizer.c index a8d739af74b6..3ac117b59483 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-resizer.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-resizer.c @@ -715,6 +715,7 @@ static int mali_c55_rsz_enum_frame_size(struct v4l2_subdev *sd, } static int mali_c55_rsz_set_sink_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -773,6 +774,7 @@ static int mali_c55_rsz_set_sink_fmt(struct v4l2_subdev *sd, } static int mali_c55_rsz_set_source_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -812,6 +814,7 @@ static int mali_c55_rsz_set_source_fmt(struct v4l2_subdev *sd, } static int mali_c55_rsz_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -826,12 +829,13 @@ static int mali_c55_rsz_set_fmt(struct v4l2_subdev *sd, if (format->pad == MALI_C55_RSZ_SINK_PAD || format->pad == MALI_C55_RSZ_SINK_BYPASS_PAD) - return mali_c55_rsz_set_sink_fmt(sd, state, format); + return mali_c55_rsz_set_sink_fmt(sd, NULL, state, format); - return mali_c55_rsz_set_source_fmt(sd, state, format); + return mali_c55_rsz_set_source_fmt(sd, NULL, state, format); } static int mali_c55_rsz_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -850,6 +854,7 @@ static int mali_c55_rsz_get_selection(struct v4l2_subdev *sd, } static int mali_c55_rsz_set_crop(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -908,6 +913,7 @@ static int mali_c55_rsz_set_crop(struct v4l2_subdev *sd, } static int mali_c55_rsz_set_compose(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -956,6 +962,7 @@ static int mali_c55_rsz_set_compose(struct v4l2_subdev *sd, } static int mali_c55_rsz_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -963,10 +970,10 @@ static int mali_c55_rsz_set_selection(struct v4l2_subdev *sd, return -EINVAL; if (sel->target == V4L2_SEL_TGT_CROP) - return mali_c55_rsz_set_crop(sd, state, sel); + return mali_c55_rsz_set_crop(sd, NULL, state, sel); if (sel->target == V4L2_SEL_TGT_COMPOSE) - return mali_c55_rsz_set_compose(sd, state, sel); + return mali_c55_rsz_set_compose(sd, NULL, state, sel); return -EINVAL; } diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-tpg.c b/drivers/media/platform/arm/mali-c55/mali-c55-tpg.c index 1af5d2759a83..22d58d8dfdbb 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-tpg.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-tpg.c @@ -180,6 +180,7 @@ static int mali_c55_tpg_enum_frame_size(struct v4l2_subdev *sd, } static int mali_c55_tpg_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index a05a744cbb75..f5e85271a275 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -609,7 +609,7 @@ static int isi_try_fmt(struct atmel_isi *isi, struct v4l2_format *f, isi_try_fse(isi, isi_fmt, &pad_state); - ret = v4l2_subdev_call(isi->entity.subdev, pad, set_fmt, + ret = v4l2_subdev_call(isi->entity.subdev, pad, set_fmt, NULL, &pad_state, &format); if (ret < 0) return ret; @@ -641,7 +641,7 @@ static int isi_set_fmt(struct atmel_isi *isi, struct v4l2_format *f) v4l2_fill_mbus_format(&format.format, &f->fmt.pix, current_fmt->mbus_code); ret = v4l2_subdev_call(isi->entity.subdev, pad, - set_fmt, NULL, &format); + set_fmt, NULL, NULL, &format); if (ret < 0) return ret; diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c index 8d28ba0b59a3..38afdf5a32ba 100644 --- a/drivers/media/platform/broadcom/bcm2835-unicam.c +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c @@ -1327,6 +1327,7 @@ static int unicam_subdev_enum_frame_size(struct v4l2_subdev *sd, } static int unicam_subdev_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -1342,7 +1343,7 @@ static int unicam_subdev_set_format(struct v4l2_subdev *sd, /* No transcoding, source and sink formats must match. */ if (unicam_sd_pad_is_source(format->pad)) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); /* * Allowed formats for the stream on the sink pad depend on what source diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index cde690c6fdee..6b894d5df29e 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -276,7 +276,7 @@ static int csi2rx_configure_ext_dphy(struct csi2rx_priv *csi2rx) s64 link_freq; int ret; - ret = v4l2_subdev_call_state_active(&csi2rx->subdev, pad, get_fmt, + ret = v4l2_subdev_call_ci_state_active(&csi2rx->subdev, pad, get_fmt, &sd_fmt); if (ret < 0) return ret; @@ -532,6 +532,7 @@ static int csi2rx_enum_mbus_code(struct v4l2_subdev *subdev, } static int csi2rx_set_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -540,7 +541,7 @@ static int csi2rx_set_fmt(struct v4l2_subdev *subdev, /* No transcoding, source and sink formats must match. */ if (format->pad != CSI2RX_PAD_SINK) - return v4l2_subdev_get_fmt(subdev, state, format); + return v4l2_subdev_get_fmt(subdev, NULL, state, format); if (!csi2rx_get_fmt_by_code(format->format.code)) format->format.code = formats[0].code; @@ -577,7 +578,7 @@ static int csi2rx_init_state(struct v4l2_subdev *subdev, }, }; - return csi2rx_set_fmt(subdev, state, &format); + return csi2rx_set_fmt(subdev, NULL, state, &format); } int cdns_csi2rx_negotiate_ppc(struct v4l2_subdev *subdev, unsigned int pad, diff --git a/drivers/media/platform/cadence/cdns-csi2tx.c b/drivers/media/platform/cadence/cdns-csi2tx.c index 629b0fa838a2..357deed9ff07 100644 --- a/drivers/media/platform/cadence/cdns-csi2tx.c +++ b/drivers/media/platform/cadence/cdns-csi2tx.c @@ -170,6 +170,7 @@ static int csi2tx_enum_mbus_code(struct v4l2_subdev *subdev, static struct v4l2_mbus_framefmt * __csi2tx_get_pad_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -182,6 +183,7 @@ __csi2tx_get_pad_format(struct v4l2_subdev *subdev, } static int csi2tx_get_pad_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -191,7 +193,7 @@ static int csi2tx_get_pad_format(struct v4l2_subdev *subdev, if (fmt->pad == CSI2TX_PAD_SOURCE) return -EINVAL; - format = __csi2tx_get_pad_format(subdev, sd_state, fmt); + format = __csi2tx_get_pad_format(subdev, NULL, sd_state, fmt); if (!format) return -EINVAL; @@ -201,6 +203,7 @@ static int csi2tx_get_pad_format(struct v4l2_subdev *subdev, } static int csi2tx_set_pad_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -214,7 +217,7 @@ static int csi2tx_set_pad_format(struct v4l2_subdev *subdev, if (!csi2tx_get_fmt_from_mbus(fmt->format.code)) src_format = &fmt_default; - dst_format = __csi2tx_get_pad_format(subdev, sd_state, fmt); + dst_format = __csi2tx_get_pad_format(subdev, NULL, sd_state, fmt); if (!dst_format) return -EINVAL; diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c index 2269d852ab0e..9e1fdd963b55 100644 --- a/drivers/media/platform/intel/pxa_camera.c +++ b/drivers/media/platform/intel/pxa_camera.c @@ -1819,7 +1819,7 @@ static int pxac_vidioc_try_fmt_vid_cap(struct file *filp, void *priv, pixfmt == V4L2_PIX_FMT_YUV422P ? 4 : 0); v4l2_fill_mbus_format(mf, pix, xlate->code); - ret = sensor_call(pcdev, pad, set_fmt, &pad_state, &format); + ret = sensor_call(pcdev, pad, set_fmt, NULL, &pad_state, &format); if (ret < 0) return ret; @@ -1882,7 +1882,7 @@ static int pxac_vidioc_s_fmt_vid_cap(struct file *filp, void *priv, xlate = pxa_mbus_xlate_by_fourcc(pcdev->user_formats, pix->pixelformat); v4l2_fill_mbus_format(&format.format, pix, xlate->code); - ret = sensor_call(pcdev, pad, set_fmt, NULL, &format); + ret = sensor_call(pcdev, pad, set_fmt, NULL, NULL, &format); if (ret < 0) { dev_warn(pcdev_to_dev(pcdev), "Failed to configure for format %x\n", @@ -2091,7 +2091,7 @@ static int pxa_camera_sensor_bound(struct v4l2_async_notifier *notifier, if (err) goto out; - err = sensor_call(pcdev, pad, set_fmt, NULL, &format); + err = sensor_call(pcdev, pad, set_fmt, NULL, NULL, &format); if (err) goto out_sensor_poweroff; diff --git a/drivers/media/platform/marvell/mcam-core.c b/drivers/media/platform/marvell/mcam-core.c index b8360d37000a..227fbecd8488 100644 --- a/drivers/media/platform/marvell/mcam-core.c +++ b/drivers/media/platform/marvell/mcam-core.c @@ -1022,7 +1022,7 @@ static int mcam_cam_configure(struct mcam_camera *cam) v4l2_fill_mbus_format(&format.format, &cam->pix_format, cam->mbus_code); ret = sensor_call(cam, core, init, 0); if (ret == 0) - ret = sensor_call(cam, pad, set_fmt, NULL, &format); + ret = sensor_call(cam, pad, set_fmt, NULL, NULL, &format); /* * OV7670 does weird things if flip is set *before* format... */ @@ -1362,7 +1362,7 @@ static int mcam_vidioc_try_fmt_vid_cap(struct file *filp, void *priv, f = mcam_find_format(pix->pixelformat); pix->pixelformat = f->pixelformat; v4l2_fill_mbus_format(&format.format, pix, f->mbus_code); - ret = sensor_call(cam, pad, set_fmt, &pad_state, &format); + ret = sensor_call(cam, pad, set_fmt, NULL, &pad_state, &format); v4l2_fill_pix_format(pix, &format.format); pix->bytesperline = pix->width * f->bpp; switch (f->pixelformat) { diff --git a/drivers/media/platform/microchip/microchip-csi2dc.c b/drivers/media/platform/microchip/microchip-csi2dc.c index 70303a0b6919..4d826612d04e 100644 --- a/drivers/media/platform/microchip/microchip-csi2dc.c +++ b/drivers/media/platform/microchip/microchip-csi2dc.c @@ -225,6 +225,7 @@ static int csi2dc_enum_mbus_code(struct v4l2_subdev *csi2dc_sd, } static int csi2dc_get_fmt(struct v4l2_subdev *csi2dc_sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -245,6 +246,7 @@ static int csi2dc_get_fmt(struct v4l2_subdev *csi2dc_sd, } static int csi2dc_set_fmt(struct v4l2_subdev *csi2dc_sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *req_fmt) { diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c index a7cdc743fda7..f4570799a139 100644 --- a/drivers/media/platform/microchip/microchip-isc-base.c +++ b/drivers/media/platform/microchip/microchip-isc-base.c @@ -916,6 +916,7 @@ static int isc_link_validate(struct media_link *link) /* Get current format from subdev */ ret = v4l2_subdev_call(isc->current_subdev->sd, pad, get_fmt, NULL, + NULL, &format); if (ret) return ret; diff --git a/drivers/media/platform/microchip/microchip-isc-scaler.c b/drivers/media/platform/microchip/microchip-isc-scaler.c index e83463543e21..6f8f2e63e971 100644 --- a/drivers/media/platform/microchip/microchip-isc-scaler.c +++ b/drivers/media/platform/microchip/microchip-isc-scaler.c @@ -26,6 +26,7 @@ static void isc_scaler_prepare_fmt(struct v4l2_mbus_framefmt *framefmt) }; static int isc_scaler_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -46,6 +47,7 @@ static int isc_scaler_get_fmt(struct v4l2_subdev *sd, } static int isc_scaler_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *req_fmt) { @@ -124,6 +126,7 @@ static int isc_scaler_enum_mbus_code(struct v4l2_subdev *sd, } static int isc_scaler_g_sel(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c index 5f9691d76434..1868b74f3fec 100644 --- a/drivers/media/platform/nxp/imx-mipi-csis.c +++ b/drivers/media/platform/nxp/imx-mipi-csis.c @@ -1104,6 +1104,7 @@ static int mipi_csis_enum_mbus_code(struct v4l2_subdev *sd, } static int mipi_csis_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *sdformat) { @@ -1116,7 +1117,7 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd, * modified. */ if (sdformat->pad == CSIS_PAD_SOURCE) - return v4l2_subdev_get_fmt(sd, state, sdformat); + return v4l2_subdev_get_fmt(sd, NULL, state, sdformat); if (sdformat->pad != CSIS_PAD_SINK) return -EINVAL; @@ -1225,7 +1226,7 @@ static int mipi_csis_init_state(struct v4l2_subdev *sd, V4L2_MAP_QUANTIZATION_DEFAULT(false, fmt.format.colorspace, fmt.format.ycbcr_enc); - return mipi_csis_set_fmt(sd, state, &fmt); + return mipi_csis_set_fmt(sd, NULL, state, &fmt); } static int mipi_csis_log_status(struct v4l2_subdev *sd) diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c index 7ddc7ba06e3d..f477fdcb39f1 100644 --- a/drivers/media/platform/nxp/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -1412,7 +1412,7 @@ static int imx7_csi_video_validate_fmt(struct imx7_csi *csi) int ret; /* Retrieve the media bus format on the source subdev. */ - ret = v4l2_subdev_call_state_active(&csi->sd, pad, get_fmt, &fmt_src); + ret = v4l2_subdev_call_ci_state_active(&csi->sd, pad, get_fmt, &fmt_src); if (ret) return ret; @@ -1890,6 +1890,7 @@ static void imx7_csi_try_fmt(struct v4l2_subdev *sd, } static int imx7_csi_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c index 605a45124103..a3f6a75e1677 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c @@ -248,6 +248,7 @@ static int mxc_isi_crossbar_enum_mbus_code(struct v4l2_subdev *sd, } static int mxc_isi_crossbar_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -264,7 +265,7 @@ static int mxc_isi_crossbar_set_fmt(struct v4l2_subdev *sd, * can't be modified. */ if (fmt->pad >= xbar->num_sinks) - return v4l2_subdev_get_fmt(sd, state, fmt); + return v4l2_subdev_get_fmt(sd, NULL, state, fmt); /* Validate the requested format. */ if (!mxc_isi_bus_format_by_code(fmt->format.code, MXC_ISI_PIPE_PAD_SINK)) diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c index a41c51dd9ce0..423077d7eeea 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c @@ -448,6 +448,7 @@ static int mxc_isi_pipe_enum_mbus_code(struct v4l2_subdev *sd, } static int mxc_isi_pipe_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -543,6 +544,7 @@ static int mxc_isi_pipe_set_fmt(struct v4l2_subdev *sd, } static int mxc_isi_pipe_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -602,6 +604,7 @@ static int mxc_isi_pipe_get_selection(struct v4l2_subdev *sd, } static int mxc_isi_pipe_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c index 04ebed8a0493..6da5b4a1af13 100644 --- a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c +++ b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c @@ -597,6 +597,7 @@ static int imx8mq_mipi_csi_enum_mbus_code(struct v4l2_subdev *sd, } static int imx8mq_mipi_csi_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -608,7 +609,7 @@ static int imx8mq_mipi_csi_set_fmt(struct v4l2_subdev *sd, * modified. */ if (sdformat->pad == MIPI_CSI2_PAD_SOURCE) - return v4l2_subdev_get_fmt(sd, sd_state, sdformat); + return v4l2_subdev_get_fmt(sd, NULL, sd_state, sdformat); if (sdformat->pad != MIPI_CSI2_PAD_SINK) return -EINVAL; diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c index ed1820488c98..d13019a9491b 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.c +++ b/drivers/media/platform/qcom/camss/camss-csid.c @@ -961,6 +961,7 @@ static int csid_enum_frame_size(struct v4l2_subdev *sd, * Return -EINVAL or zero on success */ static int csid_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -985,6 +986,7 @@ static int csid_get_format(struct v4l2_subdev *sd, * Return -EINVAL or zero on success */ static int csid_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1034,7 +1036,7 @@ static int csid_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) } }; - return csid_set_format(sd, fh ? fh->state : NULL, &format); + return csid_set_format(sd, NULL, fh ? fh->state : NULL, &format); } /* diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c index 62623393f414..cd2e94e9bcdc 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -479,6 +479,7 @@ static int csiphy_enum_frame_size(struct v4l2_subdev *sd, * Return -EINVAL or zero on success */ static int csiphy_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -503,6 +504,7 @@ static int csiphy_get_format(struct v4l2_subdev *sd, * Return -EINVAL or zero on success */ static int csiphy_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -555,7 +557,7 @@ static int csiphy_init_formats(struct v4l2_subdev *sd, } }; - return csiphy_set_format(sd, fh ? fh->state : NULL, &format); + return csiphy_set_format(sd, NULL, fh ? fh->state : NULL, &format); } static bool csiphy_match_clock_name(const char *clock_name, const char *format, diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c index aaf3caa42d33..9e655b58f7b3 100644 --- a/drivers/media/platform/qcom/camss/camss-ispif.c +++ b/drivers/media/platform/qcom/camss/camss-ispif.c @@ -1013,6 +1013,7 @@ static int ispif_enum_frame_size(struct v4l2_subdev *sd, * Return -EINVAL or zero on success */ static int ispif_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1037,6 +1038,7 @@ static int ispif_get_format(struct v4l2_subdev *sd, * Return -EINVAL or zero on success */ static int ispif_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1085,7 +1087,7 @@ static int ispif_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) } }; - return ispif_set_format(sd, fh ? fh->state : NULL, &format); + return ispif_set_format(sd, NULL, fh ? fh->state : NULL, &format); } /* diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c index 5baf0e3d4bc4..89ebecb3c191 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -1545,6 +1545,7 @@ static int vfe_enum_frame_size(struct v4l2_subdev *sd, * Return -EINVAL or zero on success */ static int vfe_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1561,6 +1562,7 @@ static int vfe_get_format(struct v4l2_subdev *sd, } static int vfe_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel); @@ -1573,6 +1575,7 @@ static int vfe_set_selection(struct v4l2_subdev *sd, * Return -EINVAL or zero on success */ static int vfe_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1607,7 +1610,7 @@ static int vfe_set_format(struct v4l2_subdev *sd, sel.target = V4L2_SEL_TGT_COMPOSE; sel.r.width = fmt->format.width; sel.r.height = fmt->format.height; - ret = vfe_set_selection(sd, sd_state, &sel); + ret = vfe_set_selection(sd, NULL, sd_state, &sel); if (ret < 0) return ret; } @@ -1624,6 +1627,7 @@ static int vfe_set_format(struct v4l2_subdev *sd, * Return -EINVAL or zero on success */ static int vfe_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1640,7 +1644,7 @@ static int vfe_get_selection(struct v4l2_subdev *sd, case V4L2_SEL_TGT_COMPOSE_BOUNDS: fmt.pad = sel->pad; fmt.which = sel->which; - ret = vfe_get_format(sd, sd_state, &fmt); + ret = vfe_get_format(sd, NULL, sd_state, &fmt); if (ret < 0) return ret; @@ -1694,6 +1698,7 @@ static int vfe_get_selection(struct v4l2_subdev *sd, * Return -EINVAL or zero on success */ static int vfe_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1720,7 +1725,7 @@ static int vfe_set_selection(struct v4l2_subdev *sd, crop.pad = MSM_VFE_PAD_SRC; crop.target = V4L2_SEL_TGT_CROP; crop.r = *rect; - ret = vfe_set_selection(sd, sd_state, &crop); + ret = vfe_set_selection(sd, NULL, sd_state, &crop); } else if (sel->target == V4L2_SEL_TGT_CROP && sel->pad == MSM_VFE_PAD_SRC) { struct v4l2_subdev_format fmt = { 0 }; @@ -1735,13 +1740,13 @@ static int vfe_set_selection(struct v4l2_subdev *sd, /* Reset source pad format width and height */ fmt.which = sel->which; fmt.pad = MSM_VFE_PAD_SRC; - ret = vfe_get_format(sd, sd_state, &fmt); + ret = vfe_get_format(sd, NULL, sd_state, &fmt); if (ret < 0) return ret; fmt.format.width = rect->width; fmt.format.height = rect->height; - ret = vfe_set_format(sd, sd_state, &fmt); + ret = vfe_set_format(sd, NULL, sd_state, &fmt); } else { ret = -EINVAL; } @@ -1771,7 +1776,7 @@ static int vfe_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) } }; - return vfe_set_format(sd, fh ? fh->state : NULL, &format); + return vfe_set_format(sd, NULL, fh ? fh->state : NULL, &format); } /* diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c index 831486e14754..931a5f4cfc45 100644 --- a/drivers/media/platform/qcom/camss/camss-video.c +++ b/drivers/media/platform/qcom/camss/camss-video.c @@ -96,7 +96,7 @@ static int video_get_subdev_format(struct camss_video *video, fmt.pad = pad; - ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); + ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, NULL, &fmt); if (ret) return ret; diff --git a/drivers/media/platform/raspberrypi/rp1-cfe/csi2.c b/drivers/media/platform/raspberrypi/rp1-cfe/csi2.c index 104908afbf41..66d0dde6d840 100644 --- a/drivers/media/platform/raspberrypi/rp1-cfe/csi2.c +++ b/drivers/media/platform/raspberrypi/rp1-cfe/csi2.c @@ -404,6 +404,7 @@ static int csi2_init_state(struct v4l2_subdev *sd, } static int csi2_pad_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/platform/raspberrypi/rp1-cfe/pisp-fe.c b/drivers/media/platform/raspberrypi/rp1-cfe/pisp-fe.c index 05762b1be2bc..1de48432fcc2 100644 --- a/drivers/media/platform/raspberrypi/rp1-cfe/pisp-fe.c +++ b/drivers/media/platform/raspberrypi/rp1-cfe/pisp-fe.c @@ -429,6 +429,7 @@ static int pisp_fe_init_state(struct v4l2_subdev *sd, } static int pisp_fe_pad_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -501,7 +502,7 @@ static int pisp_fe_pad_set_fmt(struct v4l2_subdev *sd, case FE_CONFIG_PAD: case FE_STATS_PAD: default: - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); } } diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c index 7305cc4a04cb..7739cc376096 100644 --- a/drivers/media/platform/renesas/rcar-csi2.c +++ b/drivers/media/platform/renesas/rcar-csi2.c @@ -1884,6 +1884,7 @@ static int rcsi2_disable_streams(struct v4l2_subdev *sd, } static int rcsi2_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -1891,7 +1892,7 @@ static int rcsi2_set_pad_format(struct v4l2_subdev *sd, unsigned int num_pads = rcsi2_num_pads(priv); if (format->pad > RCAR_CSI2_SINK) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); if (!rcsi2_code_to_fmt(format->format.code)) format->format.code = rcar_csi2_formats[0].code; diff --git a/drivers/media/platform/renesas/rcar-isp/csisp.c b/drivers/media/platform/renesas/rcar-isp/csisp.c index 8fb2cc3b5650..6b4720e80797 100644 --- a/drivers/media/platform/renesas/rcar-isp/csisp.c +++ b/drivers/media/platform/renesas/rcar-isp/csisp.c @@ -331,13 +331,14 @@ static int risp_disable_streams(struct v4l2_subdev *sd, } static int risp_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { struct v4l2_mbus_framefmt *framefmt; if (format->pad > RCAR_ISP_SINK) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); if (!risp_code_to_fmt(format->format.code)) format->format.code = rcar_isp_formats[0].code; diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c index 9d45e11898c1..d73ff64e97c6 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c @@ -360,7 +360,7 @@ static int rvin_remote_rectangle(struct rvin_dev *vin, struct v4l2_rect *rect) index = pad->index; fmt.pad = index; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &fmt); if (ret) return ret; diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c index 65f7659a9e02..47b9e4753301 100644 --- a/drivers/media/platform/renesas/renesas-ceu.c +++ b/drivers/media/platform/renesas/renesas-ceu.c @@ -841,12 +841,13 @@ static int __ceu_try_fmt(struct ceu_device *ceudev, struct v4l2_format *v4l2_fmt * time. */ sd_format.format.code = mbus_code; - ret = v4l2_subdev_call(v4l2_sd, pad, set_fmt, &pad_state, &sd_format); + ret = v4l2_subdev_call(v4l2_sd, pad, set_fmt, NULL, &pad_state, + &sd_format); if (ret) { if (ret == -EINVAL) { /* fallback */ sd_format.format.code = mbus_code_old; - ret = v4l2_subdev_call(v4l2_sd, pad, set_fmt, + ret = v4l2_subdev_call(v4l2_sd, pad, set_fmt, NULL, &pad_state, &sd_format); } @@ -900,7 +901,7 @@ static int ceu_set_fmt(struct ceu_device *ceudev, struct v4l2_format *v4l2_fmt) format.format.code = mbus_code; v4l2_fill_mbus_format_mplane(&format.format, &v4l2_fmt->fmt.pix_mp); - ret = v4l2_subdev_call(v4l2_sd, pad, set_fmt, NULL, &format); + ret = v4l2_subdev_call(v4l2_sd, pad, set_fmt, NULL, NULL, &format); if (ret) return ret; diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c index 6dc4b53607b4..c17283cba3a6 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c @@ -633,6 +633,7 @@ static int rzg2l_csi2_post_streamoff(struct v4l2_subdev *sd) } static int rzg2l_csi2_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -687,7 +688,7 @@ static int rzg2l_csi2_init_state(struct v4l2_subdev *sd, fmt.format.quantization = V4L2_QUANTIZATION_DEFAULT; fmt.format.xfer_func = V4L2_XFER_FUNC_DEFAULT; - return rzg2l_csi2_set_format(sd, sd_state, &fmt); + return rzg2l_csi2_set_format(sd, NULL, sd_state, &fmt); } static int rzg2l_csi2_enum_mbus_code(struct v4l2_subdev *sd, diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c index 5f2c87858bfe..21dd0162fd6e 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c @@ -200,6 +200,7 @@ static int rzg2l_cru_ip_s_stream(struct v4l2_subdev *sd, int enable) } static int rzg2l_cru_ip_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) { @@ -300,7 +301,7 @@ static int rzg2l_cru_ip_init_state(struct v4l2_subdev *sd, fmt.format.quantization = V4L2_QUANTIZATION_DEFAULT; fmt.format.xfer_func = V4L2_XFER_FUNC_DEFAULT; - return rzg2l_cru_ip_set_format(sd, sd_state, &fmt); + return rzg2l_cru_ip_set_format(sd, NULL, sd_state, &fmt); } static const struct v4l2_subdev_video_ops rzg2l_cru_ip_video_ops = { diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c index 162e2ace6931..eb629368c30d 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c @@ -1121,7 +1121,7 @@ static int rzg2l_cru_video_link_validate(struct media_link *link) subdev = media_entity_to_v4l2_subdev(link->source->entity); fmt.pad = link->source->index; - ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); + ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, NULL, &fmt); if (ret < 0) return ret == -ENOIOCTLCMD ? -EINVAL : ret; diff --git a/drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-subdev.c b/drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-subdev.c index b1659544eaa0..7a4ffd7fb2e4 100644 --- a/drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-subdev.c +++ b/drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-subdev.c @@ -157,6 +157,7 @@ static int rzv2h_ivc_enum_frame_size(struct v4l2_subdev *sd, } static int rzv2h_ivc_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -164,7 +165,7 @@ static int rzv2h_ivc_set_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *src_fmt, *sink_fmt; if (format->pad == RZV2H_IVC_SUBDEV_SOURCE_PAD) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); sink_fmt = v4l2_subdev_state_get_format(state, RZV2H_IVC_SUBDEV_SINK_PAD); diff --git a/drivers/media/platform/renesas/vsp1/vsp1_brx.c b/drivers/media/platform/renesas/vsp1/vsp1_brx.c index b1a2c68e9944..a1041affb5d7 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_brx.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_brx.c @@ -124,6 +124,7 @@ static void brx_try_format(struct vsp1_brx *brx, } static int brx_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -178,6 +179,7 @@ static int brx_set_format(struct v4l2_subdev *subdev, } static int brx_get_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -212,6 +214,7 @@ static int brx_get_selection(struct v4l2_subdev *subdev, } static int brx_set_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drm.c b/drivers/media/platform/renesas/vsp1/vsp1_drm.c index 15d266439564..f91e1095b6e6 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_drm.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_drm.c @@ -87,13 +87,15 @@ static int vsp1_du_insert_uif(struct vsp1_device *vsp1, format.pad = prev_pad; - ret = v4l2_subdev_call(&prev->subdev, pad, get_fmt, NULL, &format); + ret = v4l2_subdev_call(&prev->subdev, pad, get_fmt, NULL, NULL, + &format); if (ret < 0) return ret; format.pad = UIF_PAD_SINK; - ret = v4l2_subdev_call(&uif->subdev, pad, set_fmt, NULL, &format); + ret = v4l2_subdev_call(&uif->subdev, pad, set_fmt, NULL, NULL, + &format); if (ret < 0) return ret; @@ -140,7 +142,7 @@ static int vsp1_du_pipeline_setup_rpf(struct vsp1_device *vsp1, format.format.ycbcr_enc = input->ycbcr_enc; format.format.quantization = input->quantization; - ret = v4l2_subdev_call(&rpf->entity.subdev, pad, set_fmt, NULL, + ret = v4l2_subdev_call(&rpf->entity.subdev, pad, set_fmt, NULL, NULL, &format); if (ret < 0) return ret; @@ -155,6 +157,7 @@ static int vsp1_du_pipeline_setup_rpf(struct vsp1_device *vsp1, sel.r = input->crop; ret = v4l2_subdev_call(&rpf->entity.subdev, pad, set_selection, NULL, + NULL, &sel); if (ret < 0) return ret; @@ -170,7 +173,7 @@ static int vsp1_du_pipeline_setup_rpf(struct vsp1_device *vsp1, */ format.pad = RWPF_PAD_SOURCE; - ret = v4l2_subdev_call(&rpf->entity.subdev, pad, get_fmt, NULL, + ret = v4l2_subdev_call(&rpf->entity.subdev, pad, get_fmt, NULL, NULL, &format); if (ret < 0) return ret; @@ -182,7 +185,7 @@ static int vsp1_du_pipeline_setup_rpf(struct vsp1_device *vsp1, format.format.code = MEDIA_BUS_FMT_ARGB8888_1X32; - ret = v4l2_subdev_call(&rpf->entity.subdev, pad, set_fmt, NULL, + ret = v4l2_subdev_call(&rpf->entity.subdev, pad, set_fmt, NULL, NULL, &format); if (ret < 0) return ret; @@ -196,7 +199,7 @@ static int vsp1_du_pipeline_setup_rpf(struct vsp1_device *vsp1, /* BRx sink, propagate the format from the RPF source. */ format.pad = brx_input; - ret = v4l2_subdev_call(&pipe->brx->subdev, pad, set_fmt, NULL, + ret = v4l2_subdev_call(&pipe->brx->subdev, pad, set_fmt, NULL, NULL, &format); if (ret < 0) return ret; @@ -210,6 +213,7 @@ static int vsp1_du_pipeline_setup_rpf(struct vsp1_device *vsp1, sel.r = vsp1->drm->inputs[rpf->entity.index].compose; ret = v4l2_subdev_call(&pipe->brx->subdev, pad, set_selection, NULL, + NULL, &sel); if (ret < 0) return ret; @@ -345,7 +349,7 @@ static int vsp1_du_pipeline_setup_brx(struct vsp1_device *vsp1, format.format.height = drm_pipe->height; format.format.field = V4L2_FIELD_NONE; - ret = v4l2_subdev_call(&brx->subdev, pad, set_fmt, NULL, + ret = v4l2_subdev_call(&brx->subdev, pad, set_fmt, NULL, NULL, &format); if (ret < 0) return ret; @@ -497,7 +501,8 @@ static int vsp1_du_pipeline_setup_output(struct vsp1_device *vsp1, format.format.code = MEDIA_BUS_FMT_ARGB8888_1X32; format.format.field = V4L2_FIELD_NONE; - ret = v4l2_subdev_call(&pipe->output->entity.subdev, pad, set_fmt, NULL, + ret = v4l2_subdev_call(&pipe->output->entity.subdev, pad, set_fmt, + NULL, NULL, &format); if (ret < 0) return ret; @@ -507,7 +512,8 @@ static int vsp1_du_pipeline_setup_output(struct vsp1_device *vsp1, format.format.code, pipe->output->entity.index); format.pad = RWPF_PAD_SOURCE; - ret = v4l2_subdev_call(&pipe->output->entity.subdev, pad, get_fmt, NULL, + ret = v4l2_subdev_call(&pipe->output->entity.subdev, pad, get_fmt, + NULL, NULL, &format); if (ret < 0) return ret; @@ -517,7 +523,7 @@ static int vsp1_du_pipeline_setup_output(struct vsp1_device *vsp1, format.format.code, pipe->output->entity.index); format.pad = LIF_PAD_SINK; - ret = v4l2_subdev_call(&pipe->lif->subdev, pad, set_fmt, NULL, + ret = v4l2_subdev_call(&pipe->lif->subdev, pad, set_fmt, NULL, NULL, &format); if (ret < 0) return ret; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_entity.c b/drivers/media/platform/renesas/vsp1/vsp1_entity.c index 1dad9589768c..cb33e364f2a4 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_entity.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_entity.c @@ -162,6 +162,7 @@ vsp1_entity_get_state(struct vsp1_entity *entity, * a direct drop-in for the operation handler. */ int vsp1_subdev_get_pad_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -387,7 +388,8 @@ static int vsp1_entity_init_state(struct v4l2_subdev *subdev, : V4L2_SUBDEV_FORMAT_ACTIVE, }; - v4l2_subdev_call(subdev, pad, set_fmt, sd_state, &format); + v4l2_subdev_call(subdev, pad, set_fmt, NULL, sd_state, + &format); } return 0; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_histo.c b/drivers/media/platform/renesas/vsp1/vsp1_histo.c index 3f87a2c9df0e..5f8153430fd3 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_histo.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_histo.c @@ -189,6 +189,7 @@ static int histo_enum_frame_size(struct v4l2_subdev *subdev, } static int histo_get_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -247,6 +248,7 @@ static int histo_get_selection(struct v4l2_subdev *subdev, } static int histo_set_crop(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -269,6 +271,7 @@ static int histo_set_crop(struct v4l2_subdev *subdev, } static int histo_set_compose(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -316,6 +319,7 @@ static int histo_set_compose(struct v4l2_subdev *subdev, } static int histo_set_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -335,9 +339,9 @@ static int histo_set_selection(struct v4l2_subdev *subdev, } if (sel->target == V4L2_SEL_TGT_CROP) - ret = histo_set_crop(subdev, state, sel); + ret = histo_set_crop(subdev, NULL, state, sel); else if (sel->target == V4L2_SEL_TGT_COMPOSE) - ret = histo_set_compose(subdev, state, sel); + ret = histo_set_compose(subdev, NULL, state, sel); else ret = -EINVAL; @@ -347,6 +351,7 @@ static int histo_set_selection(struct v4l2_subdev *subdev, } static int histo_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/platform/renesas/vsp1/vsp1_hsit.c b/drivers/media/platform/renesas/vsp1/vsp1_hsit.c index 830e124beb7b..fcf656b3ddf9 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_hsit.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_hsit.c @@ -109,6 +109,7 @@ static int hsit_enum_frame_size(struct v4l2_subdev *subdev, } static int hsit_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c b/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c index c72518b29f84..4546c6ec5a01 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c @@ -110,6 +110,7 @@ static int vsp1_rwpf_enum_frame_size(struct v4l2_subdev *subdev, } static int vsp1_rwpf_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -219,6 +220,7 @@ static int vsp1_rwpf_set_format(struct v4l2_subdev *subdev, } static int vsp1_rwpf_get_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -266,6 +268,7 @@ static int vsp1_rwpf_get_selection(struct v4l2_subdev *subdev, } static int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/renesas/vsp1/vsp1_sru.c b/drivers/media/platform/renesas/vsp1/vsp1_sru.c index 94149da0c900..7dd70e7cbc50 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_sru.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_sru.c @@ -210,6 +210,7 @@ static void sru_try_format(struct vsp1_sru *sru, } static int sru_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/platform/renesas/vsp1/vsp1_uds.c b/drivers/media/platform/renesas/vsp1/vsp1_uds.c index dd4722315c56..66e4ca037c0f 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_uds.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_uds.c @@ -193,6 +193,7 @@ static void uds_try_format(struct vsp1_uds *uds, } static int uds_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/platform/renesas/vsp1/vsp1_video.c b/drivers/media/platform/renesas/vsp1/vsp1_video.c index fe1dac11d4ae..64a8fda61395 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_video.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_video.c @@ -72,7 +72,7 @@ static int vsp1_video_verify_format(struct vsp1_video *video) if (subdev == NULL) return -EINVAL; - ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); + ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, NULL, &fmt); if (ret < 0) return ret == -ENOIOCTLCMD ? -EINVAL : ret; diff --git a/drivers/media/platform/renesas/vsp1/vsp1_vspx.c b/drivers/media/platform/renesas/vsp1/vsp1_vspx.c index 1673479be0ff..5c39bacfb13f 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_vspx.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_vspx.c @@ -120,7 +120,8 @@ static int vsp1_vspx_rwpf_set_subdev_fmt(struct vsp1_device *vsp1, format.format.field = V4L2_FIELD_NONE; format.format.code = rwpf->fmtinfo->mbus; - return v4l2_subdev_call(&ent->subdev, pad, set_fmt, NULL, &format); + return v4l2_subdev_call(&ent->subdev, pad, set_fmt, NULL, NULL, + &format); } /* Configure the RPF->IIF->WPF pipeline for ConfigDMA or RAW image transfer. */ diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-interface.c b/drivers/media/platform/rockchip/rkcif/rkcif-interface.c index 414a9980cf2e..d555ca56fc50 100644 --- a/drivers/media/platform/rockchip/rkcif/rkcif-interface.c +++ b/drivers/media/platform/rockchip/rkcif/rkcif-interface.c @@ -25,6 +25,7 @@ static const struct media_entity_operations rkcif_interface_media_ops = { }; static int rkcif_interface_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -37,7 +38,7 @@ static int rkcif_interface_set_fmt(struct v4l2_subdev *sd, /* the format on the source pad always matches the sink pad */ if (format->pad == RKCIF_IF_PAD_SRC) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); input = rkcif_interface_find_input_fmt(interface, true, format->format.code); @@ -77,6 +78,7 @@ static int rkcif_interface_set_fmt(struct v4l2_subdev *sd, } static int rkcif_interface_get_sel(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -115,6 +117,7 @@ static int rkcif_interface_get_sel(struct v4l2_subdev *sd, } static int rkcif_interface_set_sel(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c index 20d88865081c..fed9e7e761b0 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c @@ -1469,7 +1469,7 @@ static int rkisp1_capture_link_validate(struct media_link *link) }; int ret; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &sd_fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &sd_fmt); if (ret) return ret; diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c index ddc6182f3e4b..e59d552d6746 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c @@ -304,6 +304,7 @@ static int rkisp1_csi_init_state(struct v4l2_subdev *sd, } static int rkisp1_csi_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -313,7 +314,7 @@ static int rkisp1_csi_set_fmt(struct v4l2_subdev *sd, /* The format on the source pad always matches the sink pad. */ if (fmt->pad == RKISP1_CSI_PAD_SRC) - return v4l2_subdev_get_fmt(sd, sd_state, fmt); + return v4l2_subdev_get_fmt(sd, NULL, sd_state, fmt); sink_fmt = v4l2_subdev_state_get_format(sd_state, RKISP1_CSI_PAD_SINK); diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c index 2311672cedb1..4043a75ca3f0 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c @@ -817,6 +817,7 @@ static void rkisp1_isp_set_sink_fmt(struct rkisp1_isp *isp, } static int rkisp1_isp_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -834,6 +835,7 @@ static int rkisp1_isp_set_fmt(struct v4l2_subdev *sd, } static int rkisp1_isp_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -872,6 +874,7 @@ static int rkisp1_isp_get_selection(struct v4l2_subdev *sd, } static int rkisp1_isp_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c index 8e6b753d3081..5926917434af 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c @@ -543,6 +543,7 @@ static void rkisp1_rsz_set_sink_fmt(struct rkisp1_resizer *rsz, } static int rkisp1_rsz_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -558,6 +559,7 @@ static int rkisp1_rsz_set_fmt(struct v4l2_subdev *sd, } static int rkisp1_rsz_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -591,6 +593,7 @@ static int rkisp1_rsz_get_selection(struct v4l2_subdev *sd, } static int rkisp1_rsz_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c index d85811f4b8c5..81c8bf83d599 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c @@ -796,7 +796,8 @@ static int fimc_pipeline_try_format(struct fimc_ctx *ctx, sd = media_entity_to_v4l2_subdev(me); sfmt.pad = 0; - ret = v4l2_subdev_call(sd, pad, set_fmt, NULL, &sfmt); + ret = v4l2_subdev_call(sd, pad, set_fmt, NULL, NULL, + &sfmt); if (ret) return ret; @@ -804,6 +805,7 @@ static int fimc_pipeline_try_format(struct fimc_ctx *ctx, sfmt.pad = me->num_pads - 1; mf->code = tfmt->code; ret = v4l2_subdev_call(sd, pad, set_fmt, NULL, + NULL, &sfmt); if (ret) return ret; @@ -1136,7 +1138,8 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc) sink_fmt.format.code = ff->fmt ? ff->fmt->mbus_code : 0; } else { sink_fmt.pad = sink_pad->index; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &sink_fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, + &sink_fmt); if (ret < 0 && ret != -ENOIOCTLCMD) return -EPIPE; } @@ -1144,7 +1147,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc) /* Retrieve format at the source pad */ sd = media_entity_to_v4l2_subdev(src_pad->entity); src_fmt.pad = src_pad->index; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &src_fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &src_fmt); if (ret < 0 && ret != -ENOIOCTLCMD) return -EPIPE; @@ -1468,6 +1471,7 @@ static int fimc_subdev_enum_mbus_code(struct v4l2_subdev *sd, } static int fimc_subdev_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1509,6 +1513,7 @@ static int fimc_subdev_get_fmt(struct v4l2_subdev *sd, } static int fimc_subdev_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1575,6 +1580,7 @@ static int fimc_subdev_set_fmt(struct v4l2_subdev *sd, } static int fimc_subdev_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1631,6 +1637,7 @@ static int fimc_subdev_get_selection(struct v4l2_subdev *sd, } static int fimc_subdev_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c b/drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c index ad219ac1b951..cabab7f0bd8b 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c @@ -463,7 +463,8 @@ static int isp_video_pipeline_validate(struct fimc_isp *isp) if (!(pad->flags & MEDIA_PAD_FL_SINK)) break; sink_fmt.pad = pad->index; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &sink_fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, + &sink_fmt); if (ret < 0 && ret != -ENOIOCTLCMD) return -EPIPE; @@ -474,7 +475,7 @@ static int isp_video_pipeline_validate(struct fimc_isp *isp) sd = media_entity_to_v4l2_subdev(pad->entity); src_fmt.pad = pad->index; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &src_fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &src_fmt); if (ret < 0 && ret != -ENOIOCTLCMD) return -EPIPE; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-isp.c b/drivers/media/platform/samsung/exynos4-is/fimc-isp.c index 3c5d7bee2655..b3b4aa21d118 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-isp.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-isp.c @@ -119,6 +119,7 @@ static int fimc_is_subdev_enum_mbus_code(struct v4l2_subdev *sd, } static int fimc_isp_subdev_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -191,6 +192,7 @@ static void __isp_subdev_try_format(struct fimc_isp *isp, } static int fimc_isp_subdev_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c index 8be20fd32d1c..1036b9b3e0d5 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c @@ -783,7 +783,7 @@ static int fimc_pipeline_validate(struct fimc_lite *fimc) sink_fmt.format.code = fimc->inp_frame.fmt->mbus_code; } else { sink_fmt.pad = pad->index; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &sink_fmt); if (ret < 0 && ret != -ENOIOCTLCMD) return -EPIPE; @@ -795,7 +795,7 @@ static int fimc_pipeline_validate(struct fimc_lite *fimc) sd = media_entity_to_v4l2_subdev(pad->entity); src_fmt.pad = pad->index; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &src_fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &src_fmt); if (ret < 0 && ret != -ENOIOCTLCMD) return -EPIPE; @@ -1021,6 +1021,7 @@ static struct v4l2_mbus_framefmt *__fimc_lite_subdev_get_try_fmt( } static int fimc_lite_subdev_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1052,6 +1053,7 @@ static int fimc_lite_subdev_get_fmt(struct v4l2_subdev *sd, } static int fimc_lite_subdev_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1113,6 +1115,7 @@ static int fimc_lite_subdev_set_fmt(struct v4l2_subdev *sd, } static int fimc_lite_subdev_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1148,6 +1151,7 @@ static int fimc_lite_subdev_get_selection(struct v4l2_subdev *sd, } static int fimc_lite_subdev_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c index 452880b5350c..788c517d84ef 100644 --- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c @@ -575,6 +575,7 @@ static struct v4l2_mbus_framefmt *__s5pcsis_get_format( } static int s5pcsis_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -604,6 +605,7 @@ static int s5pcsis_set_fmt(struct v4l2_subdev *sd, } static int s5pcsis_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/platform/samsung/s3c-camif/camif-capture.c b/drivers/media/platform/samsung/s3c-camif/camif-capture.c index ed1a1d693293..7bde9d0af1a3 100644 --- a/drivers/media/platform/samsung/s3c-camif/camif-capture.c +++ b/drivers/media/platform/samsung/s3c-camif/camif-capture.c @@ -816,7 +816,8 @@ static int camif_pipeline_validate(struct camif_dev *camif) return -EPIPE; src_fmt.pad = pad->index; - ret = v4l2_subdev_call(camif->sensor.sd, pad, get_fmt, NULL, &src_fmt); + ret = v4l2_subdev_call(camif->sensor.sd, pad, get_fmt, NULL, NULL, + &src_fmt); if (ret < 0 && ret != -ENOIOCTLCMD) return -EPIPE; @@ -1207,6 +1208,7 @@ static int s3c_camif_subdev_enum_mbus_code(struct v4l2_subdev *sd, } static int s3c_camif_subdev_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1275,6 +1277,7 @@ static void __camif_subdev_try_format(struct camif_dev *camif, } static int s3c_camif_subdev_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1342,6 +1345,7 @@ static int s3c_camif_subdev_set_fmt(struct v4l2_subdev *sd, } static int s3c_camif_subdev_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1429,6 +1433,7 @@ static void __camif_try_crop(struct camif_dev *camif, struct v4l2_rect *r) } static int s3c_camif_subdev_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c index 221e3c447f36..3b44259ce515 100644 --- a/drivers/media/platform/samsung/s3c-camif/camif-core.c +++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c @@ -222,13 +222,13 @@ static int camif_register_sensor(struct camif_dev *camif) /* Get initial pixel format and set it at the camif sink pad */ format.pad = 0; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &format); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &format); if (ret < 0) return 0; format.pad = CAMIF_SD_PAD_SINK; - v4l2_subdev_call(&camif->subdev, pad, set_fmt, NULL, &format); + v4l2_subdev_call(&camif->subdev, pad, set_fmt, NULL, NULL, &format); v4l2_info(sd, "Initial format from sensor: %dx%d, %#x\n", format.format.width, format.format.height, diff --git a/drivers/media/platform/st/stm32/stm32-csi.c b/drivers/media/platform/st/stm32/stm32-csi.c index fd2b6dfbd44c..8a07032646ca 100644 --- a/drivers/media/platform/st/stm32/stm32-csi.c +++ b/drivers/media/platform/st/stm32/stm32-csi.c @@ -736,6 +736,7 @@ static int stm32_csi_enum_mbus_code(struct v4l2_subdev *sd, } static int stm32_csi_set_pad_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c index e5663fbe6422..2253c7450cd4 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmi.c +++ b/drivers/media/platform/st/stm32/stm32-dcmi.c @@ -738,7 +738,7 @@ static int dcmi_pipeline_s_fmt(struct stm32_dcmi *dcmi, format->format.width, format->format.height); fmt.pad = pad->index; - ret = v4l2_subdev_call(subdev, pad, set_fmt, NULL, &fmt); + ret = v4l2_subdev_call(subdev, pad, set_fmt, NULL, NULL, &fmt); if (ret < 0) { dev_err(dcmi->dev, "%s: Failed to set format 0x%x %ux%u on \"%s\":%d pad (%d)\n", __func__, format->format.code, @@ -1196,7 +1196,7 @@ static int dcmi_get_sensor_format(struct stm32_dcmi *dcmi, }; int ret; - ret = v4l2_subdev_call(dcmi->source, pad, get_fmt, NULL, &fmt); + ret = v4l2_subdev_call(dcmi->source, pad, get_fmt, NULL, NULL, &fmt); if (ret) return ret; @@ -1246,7 +1246,7 @@ static int dcmi_get_sensor_bounds(struct stm32_dcmi *dcmi, /* * Get sensor bounds first */ - ret = v4l2_subdev_call(dcmi->source, pad, get_selection, + ret = v4l2_subdev_call(dcmi->source, pad, get_selection, NULL, NULL, &bounds); if (!ret) *r = bounds.r; diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c index a42f43d19f9e..45ff8f7162d4 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c @@ -822,7 +822,8 @@ static int dcmipp_bytecap_link_validate(struct media_link *link) }; int ret, i; - ret = v4l2_subdev_call(source_sd, pad, get_fmt, NULL, &source_fmt); + ret = v4l2_subdev_call(source_sd, pad, get_fmt, NULL, NULL, + &source_fmt); if (ret < 0) return 0; diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c index 0c7aeb0888f6..5da8b70750ff 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c @@ -264,6 +264,7 @@ dcmipp_byteproc_enum_frame_size(struct v4l2_subdev *sd, } static int dcmipp_byteproc_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -298,6 +299,7 @@ static int dcmipp_byteproc_set_fmt(struct v4l2_subdev *sd, } static int dcmipp_byteproc_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *s) { @@ -351,6 +353,7 @@ static int dcmipp_byteproc_get_selection(struct v4l2_subdev *sd, } static int dcmipp_byteproc_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *s) { diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c index 7d3f5857cbfe..b8aff94162ad 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c @@ -269,6 +269,7 @@ static void dcmipp_inp_adjust_fmt(struct dcmipp_inp_device *inp, } static int dcmipp_inp_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c index 744197b0fccb..cdb8a72d945e 100644 --- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c +++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c @@ -278,6 +278,7 @@ static int sun4i_csi_subdev_init_state(struct v4l2_subdev *subdev, } static int sun4i_csi_subdev_get_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -295,6 +296,7 @@ static int sun4i_csi_subdev_get_fmt(struct v4l2_subdev *subdev, } static int sun4i_csi_subdev_set_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c index d006d9dd0170..fd3c2d871d17 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c @@ -537,6 +537,7 @@ sun6i_csi_bridge_enum_mbus_code(struct v4l2_subdev *subdev, } static int sun6i_csi_bridge_get_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -558,6 +559,7 @@ static int sun6i_csi_bridge_get_fmt(struct v4l2_subdev *subdev, } static int sun6i_csi_bridge_set_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c index b06cb73015cd..b11fd2904e1d 100644 --- a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c +++ b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c @@ -341,6 +341,7 @@ sun6i_mipi_csi2_enum_mbus_code(struct v4l2_subdev *subdev, } static int sun6i_mipi_csi2_get_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -362,6 +363,7 @@ static int sun6i_mipi_csi2_get_fmt(struct v4l2_subdev *subdev, } static int sun6i_mipi_csi2_set_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c index dbc51daa4fe3..67d83c4a64ba 100644 --- a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c +++ b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c @@ -376,6 +376,7 @@ sun8i_a83t_mipi_csi2_enum_mbus_code(struct v4l2_subdev *subdev, } static int sun8i_a83t_mipi_csi2_get_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -398,6 +399,7 @@ static int sun8i_a83t_mipi_csi2_get_fmt(struct v4l2_subdev *subdev, } static int sun8i_a83t_mipi_csi2_set_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c index ce17f986279e..031075f35b2d 100644 --- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c +++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c @@ -441,6 +441,7 @@ dw_mipi_csi2rx_enum_mbus_code(struct v4l2_subdev *sd, } static int dw_mipi_csi2rx_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -450,7 +451,7 @@ static int dw_mipi_csi2rx_set_fmt(struct v4l2_subdev *sd, /* the format on the source pad always matches the sink pad */ if (format->pad == DW_MIPI_CSI2RX_PAD_SRC) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); sink = v4l2_subdev_state_get_format(state, format->pad, format->stream); if (!sink) diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c index 1ca559df7e59..7588d73ef8c1 100644 --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c @@ -1288,7 +1288,7 @@ static int __subdev_get_format(struct vpfe_device *vpfe, struct v4l2_mbus_framefmt *mbus_fmt = &sd_fmt.format; int ret; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &sd_fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &sd_fmt); if (ret) return ret; @@ -1314,7 +1314,7 @@ static int __subdev_set_format(struct vpfe_device *vpfe, *mbus_fmt = *fmt; - ret = v4l2_subdev_call(sd, pad, set_fmt, NULL, &sd_fmt); + ret = v4l2_subdev_call(sd, pad, set_fmt, NULL, NULL, &sd_fmt); if (ret) return ret; diff --git a/drivers/media/platform/ti/cal/cal-camerarx.c b/drivers/media/platform/ti/cal/cal-camerarx.c index 00a71dac0ff4..293702e701d8 100644 --- a/drivers/media/platform/ti/cal/cal-camerarx.c +++ b/drivers/media/platform/ti/cal/cal-camerarx.c @@ -762,6 +762,7 @@ static int cal_camerarx_sd_enum_frame_size(struct v4l2_subdev *sd, } static int cal_camerarx_sd_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -771,7 +772,7 @@ static int cal_camerarx_sd_set_fmt(struct v4l2_subdev *sd, /* No transcoding, source and sink formats must match. */ if (cal_rx_pad_is_source(format->pad)) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); /* * Default to the first format if the requested media bus code isn't diff --git a/drivers/media/platform/ti/cal/cal-video.c b/drivers/media/platform/ti/cal/cal-video.c index d40e24ab1127..cb97500ca70a 100644 --- a/drivers/media/platform/ti/cal/cal-video.c +++ b/drivers/media/platform/ti/cal/cal-video.c @@ -111,7 +111,7 @@ static int __subdev_get_format(struct cal_ctx *ctx, struct v4l2_subdev *sd = ctx->phy->source; int ret; - ret = v4l2_subdev_call_state_active(sd, pad, get_fmt, &sd_fmt); + ret = v4l2_subdev_call_ci_state_active(sd, pad, get_fmt, &sd_fmt); if (ret) return ret; @@ -136,7 +136,7 @@ static int __subdev_set_format(struct cal_ctx *ctx, *mbus_fmt = *fmt; - ret = v4l2_subdev_call_state_active(sd, pad, set_fmt, &sd_fmt); + ret = v4l2_subdev_call_ci_state_active(sd, pad, set_fmt, &sd_fmt); if (ret) return ret; @@ -281,7 +281,7 @@ static int cal_legacy_s_fmt_vid_cap(struct file *file, void *priv, ctx->v_fmt.fmt.pix.field = sd_fmt.format.field; cal_calc_format_size(ctx, fmtinfo, &ctx->v_fmt); - v4l2_subdev_call_state_active(sd, pad, set_fmt, &sd_fmt); + v4l2_subdev_call_ci_state_active(sd, pad, set_fmt, &sd_fmt); ctx->fmtinfo = fmtinfo; *f = ctx->v_fmt; diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c index 15df3ea2f77e..2618a94e1bd6 100644 --- a/drivers/media/platform/ti/davinci/vpif_capture.c +++ b/drivers/media/platform/ti/davinci/vpif_capture.c @@ -997,7 +997,7 @@ static int vpif_g_fmt_vid_cap(struct file *file, void *priv, *fmt = common->fmt; /* If subdev has get_fmt, use that to override */ - ret = v4l2_subdev_call(ch->sd, pad, get_fmt, NULL, &format); + ret = v4l2_subdev_call(ch->sd, pad, get_fmt, NULL, NULL, &format); if (!ret && mbus_fmt->code) { v4l2_fill_pix_format(pix_fmt, mbus_fmt); pix_fmt->bytesperline = pix_fmt->width; diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c index b75aa363d1bf..8dbe8b5f7788 100644 --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c @@ -953,7 +953,7 @@ static int ti_csi2rx_link_validate(struct media_link *link) const struct ti_csi2rx_fmt *ti_fmt; int ret; - ret = v4l2_subdev_call_state_active(csi->source, pad, + ret = v4l2_subdev_call_ci_state_active(csi->source, pad, get_fmt, &source_fmt); if (ret) return ret; diff --git a/drivers/media/platform/ti/omap3isp/ispccdc.c b/drivers/media/platform/ti/omap3isp/ispccdc.c index 4708b6303493..8126b883ab59 100644 --- a/drivers/media/platform/ti/omap3isp/ispccdc.c +++ b/drivers/media/platform/ti/omap3isp/ispccdc.c @@ -2232,6 +2232,7 @@ static int ccdc_enum_frame_size(struct v4l2_subdev *sd, * Return 0 on success or a negative error code otherwise. */ static int ccdc_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -2276,6 +2277,7 @@ static int ccdc_get_selection(struct v4l2_subdev *sd, * Return 0 on success or a negative error code otherwise. */ static int ccdc_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -2322,6 +2324,7 @@ static int ccdc_set_selection(struct v4l2_subdev *sd, * to the format type. */ static int ccdc_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2346,6 +2349,7 @@ static int ccdc_get_format(struct v4l2_subdev *sd, * to the format type. */ static int ccdc_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2472,7 +2476,7 @@ static int ccdc_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10; format.format.width = 4096; format.format.height = 4096; - ccdc_set_format(sd, fh ? fh->state : NULL, &format); + ccdc_set_format(sd, NULL, fh ? fh->state : NULL, &format); return 0; } diff --git a/drivers/media/platform/ti/omap3isp/ispccp2.c b/drivers/media/platform/ti/omap3isp/ispccp2.c index d668111b44f4..f68e06b9b61c 100644 --- a/drivers/media/platform/ti/omap3isp/ispccp2.c +++ b/drivers/media/platform/ti/omap3isp/ispccp2.c @@ -754,6 +754,7 @@ static int ccp2_enum_frame_size(struct v4l2_subdev *sd, * return -EINVAL or zero on success */ static int ccp2_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -776,6 +777,7 @@ static int ccp2_get_format(struct v4l2_subdev *sd, * returns zero */ static int ccp2_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -820,7 +822,7 @@ static int ccp2_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10; format.format.width = 4096; format.format.height = 4096; - ccp2_set_format(sd, fh ? fh->state : NULL, &format); + ccp2_set_format(sd, NULL, fh ? fh->state : NULL, &format); return 0; } diff --git a/drivers/media/platform/ti/omap3isp/ispcsi2.c b/drivers/media/platform/ti/omap3isp/ispcsi2.c index f227042b61b6..80e57b7ee5a7 100644 --- a/drivers/media/platform/ti/omap3isp/ispcsi2.c +++ b/drivers/media/platform/ti/omap3isp/ispcsi2.c @@ -972,6 +972,7 @@ static int csi2_enum_frame_size(struct v4l2_subdev *sd, * return -EINVAL or zero on success */ static int csi2_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -994,6 +995,7 @@ static int csi2_get_format(struct v4l2_subdev *sd, * return -EINVAL or zero on success */ static int csi2_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1038,7 +1040,7 @@ static int csi2_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10; format.format.width = 4096; format.format.height = 4096; - csi2_set_format(sd, fh ? fh->state : NULL, &format); + csi2_set_format(sd, NULL, fh ? fh->state : NULL, &format); return 0; } diff --git a/drivers/media/platform/ti/omap3isp/isppreview.c b/drivers/media/platform/ti/omap3isp/isppreview.c index 3f3b5bd9cdc7..195d4fe83447 100644 --- a/drivers/media/platform/ti/omap3isp/isppreview.c +++ b/drivers/media/platform/ti/omap3isp/isppreview.c @@ -1925,6 +1925,7 @@ static int preview_enum_frame_size(struct v4l2_subdev *sd, * Return 0 on success or a negative error code otherwise. */ static int preview_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1968,6 +1969,7 @@ static int preview_get_selection(struct v4l2_subdev *sd, * Return 0 on success or a negative error code otherwise. */ static int preview_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -2013,6 +2015,7 @@ static int preview_set_selection(struct v4l2_subdev *sd, * return -EINVAL or zero on success */ static int preview_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2035,6 +2038,7 @@ static int preview_get_format(struct v4l2_subdev *sd, * return -EINVAL or zero on success */ static int preview_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -2090,7 +2094,7 @@ static int preview_init_formats(struct v4l2_subdev *sd, format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10; format.format.width = 4096; format.format.height = 4096; - preview_set_format(sd, fh ? fh->state : NULL, &format); + preview_set_format(sd, NULL, fh ? fh->state : NULL, &format); return 0; } diff --git a/drivers/media/platform/ti/omap3isp/ispresizer.c b/drivers/media/platform/ti/omap3isp/ispresizer.c index ad0127f5b5cb..67e2fd00ea4e 100644 --- a/drivers/media/platform/ti/omap3isp/ispresizer.c +++ b/drivers/media/platform/ti/omap3isp/ispresizer.c @@ -1222,6 +1222,7 @@ static void resizer_try_crop(const struct v4l2_mbus_framefmt *sink, * Return 0 on success or a negative error code otherwise. */ static int resizer_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1275,6 +1276,7 @@ static int resizer_get_selection(struct v4l2_subdev *sd, * Return 0 on success or a negative error code otherwise. */ static int resizer_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1478,6 +1480,7 @@ static int resizer_enum_frame_size(struct v4l2_subdev *sd, * return -EINVAL or zero on success */ static int resizer_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1500,6 +1503,7 @@ static int resizer_get_format(struct v4l2_subdev *sd, * return -EINVAL or zero on success */ static int resizer_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -1577,7 +1581,7 @@ static int resizer_init_formats(struct v4l2_subdev *sd, format.format.code = MEDIA_BUS_FMT_YUYV8_1X16; format.format.width = 4096; format.format.height = 4096; - resizer_set_format(sd, fh ? fh->state : NULL, &format); + resizer_set_format(sd, NULL, fh ? fh->state : NULL, &format); return 0; } diff --git a/drivers/media/platform/ti/omap3isp/ispvideo.c b/drivers/media/platform/ti/omap3isp/ispvideo.c index b946c8087c77..bdc3114a4dd4 100644 --- a/drivers/media/platform/ti/omap3isp/ispvideo.c +++ b/drivers/media/platform/ti/omap3isp/ispvideo.c @@ -286,7 +286,7 @@ __isp_video_get_format(struct isp_video *video, struct v4l2_format *format) fmt.pad = pad; mutex_lock(&video->mutex); - ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); + ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, NULL, &fmt); mutex_unlock(&video->mutex); if (ret) @@ -774,7 +774,7 @@ isp_video_try_format(struct file *file, void *fh, struct v4l2_format *format) isp_video_pix_to_mbus(&format->fmt.pix, &fmt.format); fmt.pad = pad; - ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); + ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, NULL, &fmt); if (ret) return ret == -ENOIOCTLCMD ? -ENOTTY : ret; @@ -839,14 +839,14 @@ isp_video_get_selection(struct file *file, void *fh, struct v4l2_selection *sel) * implemented. */ sdsel.pad = pad; - ret = v4l2_subdev_call(subdev, pad, get_selection, NULL, &sdsel); + ret = v4l2_subdev_call(subdev, pad, get_selection, NULL, NULL, &sdsel); if (!ret) sel->r = sdsel.r; if (ret != -ENOIOCTLCMD) return ret; format.pad = pad; - ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &format); + ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, NULL, &format); if (ret < 0) return ret == -ENOIOCTLCMD ? -ENOTTY : ret; @@ -890,7 +890,7 @@ isp_video_set_selection(struct file *file, void *fh, struct v4l2_selection *sel) sdsel.pad = pad; mutex_lock(&video->mutex); - ret = v4l2_subdev_call(subdev, pad, set_selection, NULL, &sdsel); + ret = v4l2_subdev_call(subdev, pad, set_selection, NULL, NULL, &sdsel); mutex_unlock(&video->mutex); if (!ret) sel->r = sdsel.r; @@ -1073,7 +1073,7 @@ static int isp_video_check_external_subdevs(struct isp_video *video, fmt.pad = source_pad->index; ret = v4l2_subdev_call(media_entity_to_v4l2_subdev(sink), - pad, get_fmt, NULL, &fmt); + pad, get_fmt, NULL, NULL, &fmt); if (unlikely(ret < 0)) { dev_warn(isp->dev, "get_fmt returned null!\n"); return ret; diff --git a/drivers/media/platform/ti/vpe/vip.c b/drivers/media/platform/ti/vpe/vip.c index 0e91e87bda9b..29e65db4314c 100644 --- a/drivers/media/platform/ti/vpe/vip.c +++ b/drivers/media/platform/ti/vpe/vip.c @@ -1730,7 +1730,7 @@ static int vip_s_fmt_vid_cap(struct file *file, void *priv, sfmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; sfmt.pad = 0; - ret = v4l2_subdev_call(port->subdev, pad, set_fmt, NULL, &sfmt); + ret = v4l2_subdev_call(port->subdev, pad, set_fmt, NULL, NULL, &sfmt); if (ret) { v4l2_dbg(1, debug, &dev->v4l2_dev, "set_fmt failed in subdev\n"); return ret; @@ -2581,7 +2581,8 @@ static int vip_init_port(struct vip_port *port) goto done; /* Get subdevice current frame format */ - ret = v4l2_subdev_call(port->subdev, pad, get_fmt, NULL, &sd_fmt); + ret = v4l2_subdev_call(port->subdev, pad, get_fmt, NULL, NULL, + &sd_fmt); if (ret) v4l2_dbg(1, debug, &dev->v4l2_dev, "init_port get_fmt failed in subdev: (%d)\n", ret); @@ -2597,7 +2598,7 @@ static int vip_init_port(struct vip_port *port) mbus_fmt->code = fmt->code; sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; sd_fmt.pad = 0; - ret = v4l2_subdev_call(port->subdev, pad, set_fmt, + ret = v4l2_subdev_call(port->subdev, pad, set_fmt, NULL, NULL, &sd_fmt); if (ret) v4l2_dbg(1, debug, &dev->v4l2_dev, "init_port set_fmt failed in subdev: (%d)\n", diff --git a/drivers/media/platform/via/via-camera.c b/drivers/media/platform/via/via-camera.c index 1b81acba7da0..6a6e10c6f649 100644 --- a/drivers/media/platform/via/via-camera.c +++ b/drivers/media/platform/via/via-camera.c @@ -249,7 +249,7 @@ static int viacam_configure_sensor(struct via_camera *cam) v4l2_fill_mbus_format(&format.format, &cam->sensor_format, cam->mbus_code); ret = sensor_call(cam, core, init, 0); if (ret == 0) - ret = sensor_call(cam, pad, set_fmt, NULL, &format); + ret = sensor_call(cam, pad, set_fmt, NULL, NULL, &format); /* * OV7670 does weird things if flip is set *before* format... */ @@ -842,7 +842,7 @@ static int viacam_do_try_fmt(struct via_camera *cam, upix->pixelformat = f->pixelformat; viacam_fmt_pre(upix, spix); v4l2_fill_mbus_format(&format.format, spix, f->mbus_code); - ret = sensor_call(cam, pad, set_fmt, &pad_state, &format); + ret = sensor_call(cam, pad, set_fmt, NULL, &pad_state, &format); v4l2_fill_pix_format(spix, &format.format); viacam_fmt_post(upix, spix); return ret; diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c index cba34893258a..b253b260b605 100644 --- a/drivers/media/platform/video-mux.c +++ b/drivers/media/platform/video-mux.c @@ -146,6 +146,7 @@ static const struct v4l2_subdev_video_ops video_mux_subdev_video_ops = { }; static int video_mux_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { diff --git a/drivers/media/platform/xilinx/xilinx-csi2rxss.c b/drivers/media/platform/xilinx/xilinx-csi2rxss.c index 146131b8f37e..940f56f5f035 100644 --- a/drivers/media/platform/xilinx/xilinx-csi2rxss.c +++ b/drivers/media/platform/xilinx/xilinx-csi2rxss.c @@ -679,6 +679,7 @@ static int xcsi2rxss_init_state(struct v4l2_subdev *sd, } static int xcsi2rxss_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -694,6 +695,7 @@ static int xcsi2rxss_get_format(struct v4l2_subdev *sd, } static int xcsi2rxss_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c index fcfe0883aba5..307cd202dda0 100644 --- a/drivers/media/platform/xilinx/xilinx-dma.c +++ b/drivers/media/platform/xilinx/xilinx-dma.c @@ -66,7 +66,7 @@ static int xvip_dma_verify_format(struct xvip_dma *dma) if (subdev == NULL) return -EPIPE; - ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); + ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, NULL, &fmt); if (ret < 0) return ret == -ENOIOCTLCMD ? -EINVAL : ret; diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c index 7deec6e37edc..d87fe7d885a9 100644 --- a/drivers/media/platform/xilinx/xilinx-tpg.c +++ b/drivers/media/platform/xilinx/xilinx-tpg.c @@ -266,6 +266,7 @@ __xtpg_get_pad_format(struct xtpg_device *xtpg, } static int xtpg_get_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -278,6 +279,7 @@ static int xtpg_get_format(struct v4l2_subdev *subdev, } static int xtpg_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/test-drivers/vimc/vimc-common.c b/drivers/media/test-drivers/vimc/vimc-common.c index 4f4fcb26e236..d56bc2103ff6 100644 --- a/drivers/media/test-drivers/vimc/vimc-common.c +++ b/drivers/media/test-drivers/vimc/vimc-common.c @@ -250,7 +250,7 @@ static int vimc_get_pix_format(struct media_pad *pad, const struct vimc_pix_map *pix_map; int ret; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &sd_fmt); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &sd_fmt); if (ret) return ret; diff --git a/drivers/media/test-drivers/vimc/vimc-debayer.c b/drivers/media/test-drivers/vimc/vimc-debayer.c index 0c2e715a8a16..c2cc07894857 100644 --- a/drivers/media/test-drivers/vimc/vimc-debayer.c +++ b/drivers/media/test-drivers/vimc/vimc-debayer.c @@ -240,6 +240,7 @@ static void vimc_debayer_adjust_sink_fmt(struct v4l2_mbus_framefmt *fmt) } static int vimc_debayer_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -255,7 +256,7 @@ static int vimc_debayer_set_fmt(struct v4l2_subdev *sd, * the sink. */ if (VIMC_IS_SRC(fmt->pad)) - return v4l2_subdev_get_fmt(sd, sd_state, fmt); + return v4l2_subdev_get_fmt(sd, NULL, sd_state, fmt); /* Set the new format in the sink pad. */ vimc_debayer_adjust_sink_fmt(&fmt->format); diff --git a/drivers/media/test-drivers/vimc/vimc-scaler.c b/drivers/media/test-drivers/vimc/vimc-scaler.c index e2037c67e423..d8dc65d33f62 100644 --- a/drivers/media/test-drivers/vimc/vimc-scaler.c +++ b/drivers/media/test-drivers/vimc/vimc-scaler.c @@ -140,6 +140,7 @@ static int vimc_scaler_enum_frame_size(struct v4l2_subdev *sd, } static int vimc_scaler_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -204,6 +205,7 @@ static int vimc_scaler_set_fmt(struct v4l2_subdev *sd, } static int vimc_scaler_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -239,6 +241,7 @@ static void vimc_scaler_adjust_sink_crop(struct v4l2_rect *r, } static int vimc_scaler_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/media/test-drivers/vimc/vimc-sensor.c b/drivers/media/test-drivers/vimc/vimc-sensor.c index 5deebcc78a33..c58012093142 100644 --- a/drivers/media/test-drivers/vimc/vimc-sensor.c +++ b/drivers/media/test-drivers/vimc/vimc-sensor.c @@ -152,6 +152,7 @@ static u32 vimc_calc_vblank(u32 width, u32 height, } static int vimc_sensor_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index c695a97e202b..d0955ea18195 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -1666,7 +1666,7 @@ static int cx231xx_s_video_encoding(struct cx2341x_handler *cxhdl, u32 val) format.format.width = cxhdl->width / (is_mpeg1 ? 2 : 1); format.format.height = cxhdl->height; format.format.code = MEDIA_BUS_FMT_FIXED; - v4l2_subdev_call(dev->sd_cx25840, pad, set_fmt, NULL, &format); + v4l2_subdev_call(dev->sd_cx25840, pad, set_fmt, NULL, NULL, &format); return 0; } diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 2cd4e333bc4b..ec9306a940a8 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -909,7 +909,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, dev->format = format_by_fourcc(f->fmt.pix.pixelformat); v4l2_fill_mbus_format(&format.format, &f->fmt.pix, MEDIA_BUS_FMT_FIXED); - call_all(dev, pad, set_fmt, NULL, &format); + call_all(dev, pad, set_fmt, NULL, NULL, &format); v4l2_fill_pix_format(&f->fmt.pix, &format.format); return rc; @@ -950,7 +950,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm) format.format.code = MEDIA_BUS_FMT_FIXED; format.format.width = dev->width; format.format.height = dev->height; - call_all(dev, pad, set_fmt, NULL, &format); + call_all(dev, pad, set_fmt, NULL, NULL, &format); /* do mode control overrides */ cx231xx_do_mode_ctrl_overrides(dev); diff --git a/drivers/media/usb/dvb-usb/cxusb-analog.c b/drivers/media/usb/dvb-usb/cxusb-analog.c index 3bbee1fcbc8d..8c7d0888c721 100644 --- a/drivers/media/usb/dvb-usb/cxusb-analog.c +++ b/drivers/media/usb/dvb-usb/cxusb-analog.c @@ -1031,7 +1031,8 @@ static int cxusb_medion_try_s_fmt_vid_cap(struct file *file, subfmt.format.field = field; subfmt.format.colorspace = V4L2_COLORSPACE_SMPTE170M; - ret = v4l2_subdev_call(cxdev->cx25840, pad, set_fmt, NULL, &subfmt); + ret = v4l2_subdev_call(cxdev->cx25840, pad, set_fmt, NULL, NULL, + &subfmt); if (ret != 0) return ret; @@ -1513,7 +1514,8 @@ int cxusb_medion_analog_init(struct dvb_usb_device *dvbdev) subfmt.format.field = V4L2_FIELD_SEQ_TB; subfmt.format.colorspace = V4L2_COLORSPACE_SMPTE170M; - ret = v4l2_subdev_call(cxdev->cx25840, pad, set_fmt, NULL, &subfmt); + ret = v4l2_subdev_call(cxdev->cx25840, pad, set_fmt, NULL, NULL, + &subfmt); if (ret != 0) dev_warn(&dvbdev->udev->dev, "cx25840 format set failed (%d)\n", ret); diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index b5f58dc6dd0f..bc55ad66658c 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c @@ -392,7 +392,7 @@ int em28xx_init_camera(struct em28xx *dev) format.format.code = MEDIA_BUS_FMT_YUYV8_2X8; format.format.width = 640; format.format.height = 480; - v4l2_subdev_call(subdev, pad, set_fmt, NULL, &format); + v4l2_subdev_call(subdev, pad, set_fmt, NULL, NULL, &format); /* NOTE: for UXGA=1600x1200 switch to 12MHz */ dev->board.xclk = EM28XX_XCLK_FREQUENCY_24MHZ; diff --git a/drivers/media/usb/go7007/go7007-v4l2.c b/drivers/media/usb/go7007/go7007-v4l2.c index 2087ffcb85a5..86b853e09ecb 100644 --- a/drivers/media/usb/go7007/go7007-v4l2.c +++ b/drivers/media/usb/go7007/go7007-v4l2.c @@ -252,7 +252,7 @@ static int set_capture_size(struct go7007 *go, struct v4l2_format *fmt, int try) go->encoder_h_halve = 0; go->encoder_v_halve = 0; go->encoder_subsample = 0; - call_all(&go->v4l2_dev, pad, set_fmt, NULL, &format); + call_all(&go->v4l2_dev, pad, set_fmt, NULL, NULL, &format); } else { if (width <= sensor_width / 4) { go->encoder_h_halve = 1; diff --git a/drivers/media/usb/go7007/s2250-board.c b/drivers/media/usb/go7007/s2250-board.c index 567f851d5896..31fd14f6f583 100644 --- a/drivers/media/usb/go7007/s2250-board.c +++ b/drivers/media/usb/go7007/s2250-board.c @@ -398,6 +398,7 @@ static int s2250_s_ctrl(struct v4l2_ctrl *ctrl) } static int s2250_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index 3c270ef00752..21a0dfbd455e 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -2924,7 +2924,7 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw) format.format.code = MEDIA_BUS_FMT_FIXED; pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_size(%dx%d)", format.format.width, format.format.height); - v4l2_device_call_all(&hdw->v4l2_dev, 0, pad, set_fmt, + v4l2_device_call_all(&hdw->v4l2_dev, 0, pad, set_fmt, NULL, NULL, &format); } diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c index d3414312e1de..0b84cefee7e5 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c @@ -520,6 +520,7 @@ static int gc2235_startup(struct v4l2_subdev *sd) } static int gc2235_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -568,6 +569,7 @@ static int gc2235_set_fmt(struct v4l2_subdev *sd, } static int gc2235_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c index 2c41c496daa6..0b5e880ff076 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c @@ -623,6 +623,7 @@ static int ov2722_startup(struct v4l2_subdev *sd) } static int ov2722_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { @@ -697,6 +698,7 @@ static int ov2722_set_fmt(struct v4l2_subdev *sd, } static int ov2722_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *format) { diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index fec369575d88..e0252f5bac1b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -3739,14 +3739,16 @@ static int atomisp_set_sensor_crop_and_fmt(struct atomisp_device *isp, sel.r.left = ((input->native_rect.width - sel.r.width) / 2) & ~1; sel.r.top = ((input->native_rect.height - sel.r.height) / 2) & ~1; - ret = v4l2_subdev_call(input->sensor, pad, set_selection, sd_state, &sel); + ret = v4l2_subdev_call(input->sensor, pad, set_selection, NULL, + sd_state, &sel); if (ret) dev_err(isp->dev, "Error setting crop to (%d,%d)/%ux%u: %d\n", sel.r.left, sel.r.top, sel.r.width, sel.r.height, ret); set_fmt: if (ret == 0) { - ret = v4l2_subdev_call(input->sensor, pad, set_fmt, sd_state, &format); + ret = v4l2_subdev_call(input->sensor, pad, set_fmt, NULL, + sd_state, &format); dev_dbg(isp->dev, "Set sensor format ret: %d size %dx%d\n", ret, format.format.width, format.format.height); } @@ -3759,13 +3761,16 @@ static int atomisp_set_sensor_crop_and_fmt(struct atomisp_device *isp, sd_state = v4l2_subdev_lock_and_get_active_state(input->sensor_isp); format.pad = SENSOR_ISP_PAD_SINK; - ret = v4l2_subdev_call(input->sensor_isp, pad, set_fmt, sd_state, &format); + ret = v4l2_subdev_call(input->sensor_isp, pad, set_fmt, NULL, + sd_state, &format); dev_dbg(isp->dev, "Set sensor ISP sink format ret: %d size %dx%d\n", ret, format.format.width, format.format.height); if (ret == 0) { format.pad = SENSOR_ISP_PAD_SOURCE; - ret = v4l2_subdev_call(input->sensor_isp, pad, set_fmt, sd_state, &format); + ret = v4l2_subdev_call(input->sensor_isp, pad, + set_fmt, NULL, sd_state, + &format); dev_dbg(isp->dev, "Set sensor ISP source format ret: %d size %dx%d\n", ret, format.format.width, format.format.height); } @@ -3777,7 +3782,8 @@ static int atomisp_set_sensor_crop_and_fmt(struct atomisp_device *isp, /* Propagate new fmt to CSI port */ if (ret == 0 && which == V4L2_SUBDEV_FORMAT_ACTIVE) { format.pad = CSI2_PAD_SINK; - ret = v4l2_subdev_call(input->csi_port, pad, set_fmt, NULL, &format); + ret = v4l2_subdev_call(input->csi_port, pad, set_fmt, NULL, + NULL, &format); if (ret) return ret; } diff --git a/drivers/staging/media/atomisp/pci/atomisp_csi2.c b/drivers/staging/media/atomisp/pci/atomisp_csi2.c index 95b9113d75e9..3e864ffc1f1a 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_csi2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_csi2.c @@ -57,6 +57,7 @@ static int csi2_enum_mbus_code(struct v4l2_subdev *sd, * return -EINVAL or zero on success */ static int csi2_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -123,6 +124,7 @@ int atomisp_csi2_set_ffmt(struct v4l2_subdev *sd, * return -EINVAL or zero on success */ static int csi2_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c index 3d56ca83ecb7..68073cde4dd3 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c @@ -259,6 +259,7 @@ static void isp_get_fmt_rect(struct v4l2_subdev *sd, } static int isp_subdev_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -452,6 +453,7 @@ int atomisp_subdev_set_selection(struct v4l2_subdev *sd, } static int isp_subdev_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -535,6 +537,7 @@ void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd, * to the format type. */ static int isp_subdev_get_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -555,6 +558,7 @@ static int isp_subdev_get_format(struct v4l2_subdev *sd, * to the format type. */ static int isp_subdev_set_format(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index 900a67552d6a..d7656d3d30b6 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -912,7 +912,7 @@ static void atomisp_init_sensor(struct atomisp_input_subdev *input) sel.which = V4L2_SUBDEV_FORMAT_ACTIVE; sel.target = V4L2_SEL_TGT_NATIVE_SIZE; - err = v4l2_subdev_call(input->sensor, pad, get_selection, + err = v4l2_subdev_call(input->sensor, pad, get_selection, NULL, act_sd_state, &sel); if (err) goto unlock_act_sd_state; @@ -921,7 +921,7 @@ static void atomisp_init_sensor(struct atomisp_input_subdev *input) sel.which = V4L2_SUBDEV_FORMAT_ACTIVE; sel.target = V4L2_SEL_TGT_CROP_DEFAULT; - err = v4l2_subdev_call(input->sensor, pad, get_selection, + err = v4l2_subdev_call(input->sensor, pad, get_selection, NULL, act_sd_state, &sel); if (err) goto unlock_act_sd_state; @@ -967,7 +967,7 @@ static void atomisp_init_sensor(struct atomisp_input_subdev *input) if (!input->sensor->state_lock) v4l2_subdev_lock_state(input->try_sd_state); - err = v4l2_subdev_call(input->sensor, pad, set_selection, + err = v4l2_subdev_call(input->sensor, pad, set_selection, NULL, input->try_sd_state, &sel); if (!input->sensor->state_lock) @@ -979,7 +979,7 @@ static void atomisp_init_sensor(struct atomisp_input_subdev *input) sel.which = V4L2_SUBDEV_FORMAT_ACTIVE; sel.target = V4L2_SEL_TGT_CROP; sel.r = input->native_rect; - err = v4l2_subdev_call(input->sensor, pad, set_selection, + err = v4l2_subdev_call(input->sensor, pad, set_selection, NULL, act_sd_state, &sel); if (err) goto unlock_act_sd_state; diff --git a/drivers/staging/media/deprecated/atmel/atmel-isc-base.c b/drivers/staging/media/deprecated/atmel/atmel-isc-base.c index fb9ee8547392..4859a027ecba 100644 --- a/drivers/staging/media/deprecated/atmel/atmel-isc-base.c +++ b/drivers/staging/media/deprecated/atmel/atmel-isc-base.c @@ -959,7 +959,7 @@ static int isc_try_fmt(struct isc_device *isc, struct v4l2_format *f, isc_try_fse(isc, &pad_state); v4l2_fill_mbus_format(&format.format, pixfmt, mbus_code); - ret = v4l2_subdev_call(isc->current_subdev->sd, pad, set_fmt, + ret = v4l2_subdev_call(isc->current_subdev->sd, pad, set_fmt, NULL, &pad_state, &format); if (ret < 0) goto isc_try_fmt_subdev_err; @@ -1004,7 +1004,7 @@ static int isc_set_fmt(struct isc_device *isc, struct v4l2_format *f) v4l2_fill_mbus_format(&format.format, &f->fmt.pix, mbus_code); ret = v4l2_subdev_call(isc->current_subdev->sd, pad, - set_fmt, NULL, &format); + set_fmt, NULL, NULL, &format); if (ret < 0) return ret; diff --git a/drivers/staging/media/imx/imx-ic-prp.c b/drivers/staging/media/imx/imx-ic-prp.c index 2b80d54006b3..e5616dbef9a9 100644 --- a/drivers/staging/media/imx/imx-ic-prp.c +++ b/drivers/staging/media/imx/imx-ic-prp.c @@ -126,6 +126,7 @@ static int prp_enum_mbus_code(struct v4l2_subdev *sd, } static int prp_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -151,6 +152,7 @@ static int prp_get_fmt(struct v4l2_subdev *sd, } static int prp_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index 77360bfe081a..bda6a4aff782 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -850,6 +850,7 @@ static int prp_enum_mbus_code(struct v4l2_subdev *sd, } static int prp_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -919,6 +920,7 @@ static void prp_try_fmt(struct prp_priv *priv, } static int prp_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index e9cef7af000a..3a84b9c45d4e 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -359,7 +359,8 @@ static int capture_legacy_enum_fmt_vid_cap(struct file *file, void *fh, u32 fourcc; int ret; - ret = v4l2_subdev_call(priv->src_sd, pad, get_fmt, NULL, &fmt_src); + ret = v4l2_subdev_call(priv->src_sd, pad, get_fmt, NULL, NULL, + &fmt_src); if (ret) { dev_err(priv->dev, "failed to get src_sd format\n"); return ret; @@ -432,7 +433,8 @@ static int capture_legacy_try_fmt_vid_cap(struct file *file, void *fh, }; int ret; - ret = v4l2_subdev_call(priv->src_sd, pad, get_fmt, NULL, &fmt_src); + ret = v4l2_subdev_call(priv->src_sd, pad, get_fmt, NULL, NULL, + &fmt_src); if (ret) return ret; @@ -458,7 +460,8 @@ static int capture_legacy_s_fmt_vid_cap(struct file *file, void *fh, return -EBUSY; } - ret = v4l2_subdev_call(priv->src_sd, pad, get_fmt, NULL, &fmt_src); + ret = v4l2_subdev_call(priv->src_sd, pad, get_fmt, NULL, NULL, + &fmt_src); if (ret) return ret; @@ -683,7 +686,8 @@ static int capture_validate_fmt(struct capture_priv *priv) int ret; /* Retrieve the media bus format on the source subdev. */ - ret = v4l2_subdev_call(priv->src_sd, pad, get_fmt, NULL, &fmt_src); + ret = v4l2_subdev_call(priv->src_sd, pad, get_fmt, NULL, NULL, + &fmt_src); if (ret) return ret; @@ -880,7 +884,7 @@ static int capture_init_format(struct capture_priv *priv) int ret; if (priv->legacy_api) { - ret = v4l2_subdev_call(priv->src_sd, pad, get_fmt, NULL, + ret = v4l2_subdev_call(priv->src_sd, pad, get_fmt, NULL, NULL, &fmt_src); if (ret) { dev_err(priv->dev, "failed to get source format\n"); diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index ef22a083f8eb..71b906e51445 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1366,6 +1366,7 @@ static int csi_enum_frame_interval(struct v4l2_subdev *sd, } static int csi_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -1525,6 +1526,7 @@ static void csi_try_fmt(struct csi_priv *priv, } static int csi_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -1593,6 +1595,7 @@ static int csi_set_fmt(struct v4l2_subdev *sd, } static int csi_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -1657,6 +1660,7 @@ static int csi_set_scale(u32 *compose, u32 crop, u32 flags) } static int csi_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index 1b5af8945e6b..b62a739ff935 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -441,7 +441,7 @@ int imx_media_init_state(struct v4l2_subdev *sd, .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; - ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &format); + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, NULL, &format); if (ret) continue; diff --git a/drivers/staging/media/imx/imx-media-vdic.c b/drivers/staging/media/imx/imx-media-vdic.c index 58f1112e28e5..9b0e418ccb0a 100644 --- a/drivers/staging/media/imx/imx-media-vdic.c +++ b/drivers/staging/media/imx/imx-media-vdic.c @@ -499,6 +499,7 @@ static int vdic_enum_mbus_code(struct v4l2_subdev *sd, } static int vdic_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -566,6 +567,7 @@ static void vdic_try_fmt(struct vdic_priv *priv, } static int vdic_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { diff --git a/drivers/staging/media/imx/imx6-mipi-csi2.c b/drivers/staging/media/imx/imx6-mipi-csi2.c index 211f67fb92b5..662ed780cd35 100644 --- a/drivers/staging/media/imx/imx6-mipi-csi2.c +++ b/drivers/staging/media/imx/imx6-mipi-csi2.c @@ -507,6 +507,7 @@ __csi2_get_fmt(struct csi2_dev *csi2, struct v4l2_subdev_state *sd_state, } static int csi2_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { @@ -525,6 +526,7 @@ static int csi2_get_fmt(struct v4l2_subdev *sd, } static int csi2_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *sdformat) { diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c index 2f6041d342f4..c9f3d7416080 100644 --- a/drivers/staging/media/ipu3/ipu3-v4l2.c +++ b/drivers/staging/media/ipu3/ipu3-v4l2.c @@ -121,6 +121,7 @@ static int imgu_subdev_s_stream(struct v4l2_subdev *sd, int enable) } static int imgu_subdev_get_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -145,6 +146,7 @@ static int imgu_subdev_get_fmt(struct v4l2_subdev *sd, } static int imgu_subdev_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -212,6 +214,7 @@ imgu_subdev_get_compose(struct imgu_v4l2_subdev *sd, } static int imgu_subdev_get_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { @@ -236,6 +239,7 @@ static int imgu_subdev_get_selection(struct v4l2_subdev *sd, } static int imgu_subdev_set_selection(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/staging/media/ipu7/ipu7-isys-csi2.c b/drivers/staging/media/ipu7/ipu7-isys-csi2.c index f34eabfe8a98..fcc7efcf69c3 100644 --- a/drivers/staging/media/ipu7/ipu7-isys-csi2.c +++ b/drivers/staging/media/ipu7/ipu7-isys-csi2.c @@ -190,6 +190,7 @@ static int ipu7_isys_csi2_enable_stream(struct ipu7_isys_csi2 *csi2) } static int ipu7_isys_csi2_set_sel(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { @@ -241,6 +242,7 @@ static int ipu7_isys_csi2_set_sel(struct v4l2_subdev *sd, } static int ipu7_isys_csi2_get_sel(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { diff --git a/drivers/staging/media/ipu7/ipu7-isys-subdev.c b/drivers/staging/media/ipu7/ipu7-isys-subdev.c index 67a776033d5b..ca551894833b 100644 --- a/drivers/staging/media/ipu7/ipu7-isys-subdev.c +++ b/drivers/staging/media/ipu7/ipu7-isys-subdev.c @@ -99,6 +99,7 @@ u32 ipu7_isys_convert_bayer_order(u32 code, int x, int y) } int ipu7_isys_subdev_set_fmt(struct v4l2_subdev *sd, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -113,7 +114,7 @@ int ipu7_isys_subdev_set_fmt(struct v4l2_subdev *sd, /* No transcoding, source and sink formats must match. */ if ((sd->entity.pads[format->pad].flags & MEDIA_PAD_FL_SOURCE) && sd->entity.num_pads > 1) - return v4l2_subdev_get_fmt(sd, state, format); + return v4l2_subdev_get_fmt(sd, NULL, state, format); format->format.width = clamp(format->format.width, IPU_ISYS_MIN_WIDTH, IPU_ISYS_MAX_WIDTH); diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c index 46a334b602f1..9e9a95178ba3 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c @@ -292,6 +292,7 @@ sun6i_isp_proc_enum_mbus_code(struct v4l2_subdev *subdev, } static int sun6i_isp_proc_get_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { @@ -313,6 +314,7 @@ static int sun6i_isp_proc_get_fmt(struct v4l2_subdev *subdev, } static int sun6i_isp_proc_set_fmt(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c index 41d57dac61a7..01fa749c8686 100644 --- a/drivers/staging/media/tegra-video/csi.c +++ b/drivers/staging/media/tegra-video/csi.c @@ -68,6 +68,7 @@ static int csi_enum_bus_code(struct v4l2_subdev *subdev, } static int csi_get_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { @@ -170,6 +171,7 @@ static int csi_enum_frameintervals(struct v4l2_subdev *subdev, } static int csi_set_format(struct v4l2_subdev *subdev, + const struct v4l2_subdev_client_info *ci, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index f14cdc7b5211..4957d84b9b1e 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -489,7 +489,7 @@ static int __tegra_channel_try_format(struct tegra_vi_channel *chan, try_crop->height = fse.max_height; } - ret = v4l2_subdev_call(subdev, pad, set_fmt, sd_state, &fmt); + ret = v4l2_subdev_call(subdev, pad, set_fmt, NULL, sd_state, &fmt); if (ret < 0) goto out_free; @@ -543,7 +543,7 @@ static int tegra_channel_set_format(struct file *file, void *fh, fmt.pad = 0; v4l2_fill_mbus_format(&fmt.format, pix, fmtinfo->code); subdev = tegra_channel_get_remote_source_subdev(chan); - ret = v4l2_subdev_call(subdev, pad, set_fmt, NULL, &fmt); + ret = v4l2_subdev_call(subdev, pad, set_fmt, NULL, NULL, &fmt); if (ret < 0) return ret; @@ -570,7 +570,7 @@ static int tegra_channel_set_subdev_active_fmt(struct tegra_vi_channel *chan) * is corresponding match in the Tegra supported video formats. */ subdev = tegra_channel_get_remote_source_subdev(chan); - ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); + ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, NULL, &fmt); if (ret) return ret; @@ -626,13 +626,13 @@ static int tegra_channel_g_selection(struct file *file, void *priv, * Try the get selection operation and fallback to get format if not * implemented. */ - ret = v4l2_subdev_call(subdev, pad, get_selection, NULL, &sdsel); + ret = v4l2_subdev_call(subdev, pad, get_selection, NULL, NULL, &sdsel); if (!ret) sel->r = sdsel.r; if (ret != -ENOIOCTLCMD) return ret; - ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); + ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, NULL, &fmt); if (ret < 0) return ret; @@ -667,7 +667,7 @@ static int tegra_channel_s_selection(struct file *file, void *fh, if (vb2_is_busy(&chan->queue)) return -EBUSY; - ret = v4l2_subdev_call(subdev, pad, set_selection, NULL, &sdsel); + ret = v4l2_subdev_call(subdev, pad, set_selection, NULL, NULL, &sdsel); if (!ret) { sel->r = sdsel.r; /* -- 2.47.3 ^ permalink raw reply related [flat|nested] 116+ messages in thread
end of thread, other threads:[~2026-04-23 7:02 UTC | newest] Thread overview: 116+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-04-08 15:39 [PATCH v4 00/29] Metadata series preparation Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 01/29] media: imx219: Rename "PIXEL_ARRAY" as "VISIBLE" Sakari Ailus 2026-04-16 13:14 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 02/29] media: imx219: Fix maximum frame length in lines Sakari Ailus 2026-04-16 13:56 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 03/29] media: imx219: Set horizontal blanking on mode change Sakari Ailus 2026-04-10 7:27 ` Jacopo Mondi 2026-04-16 14:22 ` Laurent Pinchart 2026-04-16 14:38 ` Dave Stevenson 2026-04-08 15:39 ` [PATCH v4 04/29] media: imx219: Scale the vblank limits according to rate_factor Sakari Ailus 2026-04-10 8:28 ` Jacopo Mondi 2026-04-10 8:41 ` Sakari Ailus 2026-04-10 9:01 ` Jacopo Mondi 2026-04-20 21:08 ` Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 05/29] media: imx219: Fix vertical blanking and exposure for analogue binning Sakari Ailus 2026-04-10 8:42 ` Jacopo Mondi 2026-04-10 8:46 ` Sakari Ailus 2026-04-10 8:56 ` Jacopo Mondi 2026-04-10 9:04 ` Sakari Ailus 2026-04-10 13:38 ` Jacopo Mondi 2026-04-15 14:38 ` Jai Luthra 2026-04-20 21:02 ` Sakari Ailus 2026-04-15 17:15 ` Jai Luthra 2026-04-20 20:54 ` Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 06/29] media: imx219: Don't update exposure limits while setting format Sakari Ailus 2026-04-10 8:44 ` Jacopo Mondi 2026-04-10 10:14 ` Sakari Ailus 2026-04-10 10:29 ` Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 07/29] media: imx219: Rename "binning" as "bin_hv" in imx219_set_pad_format Sakari Ailus 2026-04-16 14:25 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 08/29] media: imx274: Remove redundant kernel-doc comments Sakari Ailus 2026-04-10 8:48 ` Jacopo Mondi 2026-04-10 8:54 ` Sakari Ailus 2026-04-10 9:02 ` Jacopo Mondi 2026-04-16 14:26 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 09/29] media: imx334: " Sakari Ailus 2026-04-10 9:02 ` Jacopo Mondi 2026-04-16 14:27 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 10/29] media: imx335: " Sakari Ailus 2026-04-10 9:02 ` Jacopo Mondi 2026-04-16 14:27 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 11/29] media: imx412: " Sakari Ailus 2026-04-10 9:03 ` Jacopo Mondi 2026-04-16 14:28 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 12/29] media: ov9282: " Sakari Ailus 2026-04-10 9:08 ` Jacopo Mondi 2026-04-16 14:28 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 13/29] media: tvp514x: " Sakari Ailus 2026-04-10 9:08 ` Jacopo Mondi 2026-04-16 14:28 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 14/29] media: Documentation: Improve LINK_FREQ documentation Sakari Ailus 2026-04-16 15:05 ` Laurent Pinchart 2026-04-21 14:42 ` Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 15/29] media: Documentation: Improve pixel rate calculation documentation Sakari Ailus 2026-04-16 16:20 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 16/29] media: v4l2-subdev: Refactor returning routes Sakari Ailus 2026-04-16 16:24 ` Laurent Pinchart 2026-04-21 14:50 ` Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 17/29] media: v4l2-subdev: Allow accessing routes with STREAMS client capability Sakari Ailus 2026-04-16 15:06 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() Sakari Ailus 2026-04-10 9:26 ` Jacopo Mondi 2026-04-16 14:35 ` Laurent Pinchart 2026-04-21 10:24 ` Sakari Ailus 2026-04-21 11:18 ` Laurent Pinchart 2026-04-21 12:37 ` Sakari Ailus 2026-04-21 22:10 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 19/29] media: mc: Separate single link validation into a new function Sakari Ailus 2026-04-10 9:29 ` Jacopo Mondi 2026-04-16 16:35 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 20/29] media: uapi: Bump the STREAMS bit a little Sakari Ailus 2026-04-10 9:31 ` Jacopo Mondi 2026-04-16 14:31 ` Laurent Pinchart 2026-04-21 10:27 ` Sakari Ailus 2026-04-21 11:18 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 21/29] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP Sakari Ailus 2026-04-10 10:31 ` Jacopo Mondi 2026-04-10 12:56 ` Sakari Ailus 2026-04-10 13:24 ` Jacopo Mondi 2026-04-16 15:59 ` Laurent Pinchart 2026-04-21 10:44 ` Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 22/29] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE Sakari Ailus 2026-04-10 10:41 ` Jacopo Mondi 2026-04-13 7:59 ` Sakari Ailus 2026-04-13 9:30 ` Jacopo Mondi 2026-04-16 16:29 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 23/29] media: Improve enable_streams and disable_streams documentation Sakari Ailus 2026-04-16 15:49 ` Laurent Pinchart 2026-04-21 15:35 ` Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 24/29] media: v4l2-subdev: Introduce v4l2_subdev_get_frame_desc() Sakari Ailus 2026-04-10 10:53 ` Jacopo Mondi 2026-04-13 8:07 ` Sakari Ailus 2026-04-16 16:16 ` Laurent Pinchart 2026-04-21 12:18 ` Sakari Ailus 2026-04-21 22:18 ` Laurent Pinchart 2026-04-22 8:26 ` Sakari Ailus 2026-04-22 9:02 ` Laurent Pinchart 2026-04-22 10:02 ` Sakari Ailus 2026-04-22 10:47 ` Laurent Pinchart 2026-04-22 10:48 ` Sakari Ailus 2026-04-22 10:54 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 25/29] media: v4l2-subdev: Move subdev client capabilities into a new struct Sakari Ailus 2026-04-10 13:31 ` Jacopo Mondi 2026-04-13 8:11 ` Sakari Ailus 2026-04-13 12:42 ` Jacopo Mondi 2026-04-16 17:30 ` Laurent Pinchart 2026-04-23 7:02 ` Jacopo Mondi 2026-04-08 15:39 ` [PATCH v4 26/29] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops Sakari Ailus 2026-04-16 17:32 ` Laurent Pinchart 2026-04-08 15:39 ` [PATCH v4 27/29] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state Sakari Ailus 2026-04-16 17:38 ` Laurent Pinchart 2026-04-21 16:04 ` Sakari Ailus 2026-04-21 16:12 ` Laurent Pinchart 2026-04-21 16:34 ` Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 28/29] media: v4l2-subdev: Perform client info changes to i2c drivers Sakari Ailus 2026-04-08 15:39 ` [PATCH v4 29/29] media: v4l2-subdev: Add struct v4l2_subdev_client_info argument to pad ops Sakari Ailus
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox