Metadata series preparation
Subsystems (169)
Sakari Ailus
maintainerv7 cover Metadata series preparation
Hi folks,
This smallish set contains patches that prepare for merging the metadata series.
These patches have been out for review for quite a long time so I intend to merge these early, once we have the next rc1 merged in the Media tree. Before doing so however, I'd like to have reviews for the v4l2-subdev changes that haven't been acked yet.
There are simple cleanups but also a noteworthy change: the addition of the new struct v4l2_subdev_client_info struct to the 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 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 the imx219 driver in particular worked before the common raw sensor model.
There still needs to be a single driver internal state, the different UAPIs simply offer a different view to that state. The get_fmt() pad op does not have the client_info argument as the get_fmt() is called by other drivers inside the kernel so there's no concept of "client info" there nor the format returned by the callback should have depended on it.
The Coccinelle spatch used to generate most of the driver changes in the last 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 =~ ".*_set.*";
@@
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 v6:
- imx219: Drop the change of using fll_def of 1762 for a non-binned mode. Having an even value is only relevant for configurations binned by 2 vertically (very special binning).
- Add v4l2_subdev_client_info *ci argument get_selection and set_fmt callbacks in imx355 and relevant changes for two newly added drivers (imx471 and imx678).
- Introduce check_which_pad_state() helper for checking arguments instead of using funky here-functions for the do_subdev_call() macro in v4l2-subdev.c.
- Call the client_caps field in struct v4l2_subdev_client_info caps; the client is already given in the name of the struct.
- Prepend the name of the v4l2_subdev_call_drop_fourth() macro with two underscores and so suggest it's for internal, or at least for unusual, use.
- Introduce a new patch "media: v4l2-subdev: Don't assign set_fmt where it's equivalent to get_fmt" to drop set_fmt pad op assignments where trivial.
- Rewrap the description of "media: v4l2-subdev: Move subdev client capabilities into a new struct".
since v5:
- Drop imx219 patches changing the vertical blanking margin and the removal of the rate factor.
- Introduce new patches for imx219 to fix exposure margin and set blanking control (both HBLANK and VBLANK) step.
- Add a wrapper to always call get_fmt() pad op if set_fmt() pad op isn't defined. To enable this, nove the ops NULL-ness check from sub-device call wrapper callers to the call wrappers themselves. Also drop the patch "media: v4l2-subdev: Add v4l2_subdev_get_fmt_ci()" as it is now redundant.
- Use client_info pointer whenever available (was often NULL in v5) even when not required, in mali-c55, bcm2835-unicam, ccs, mt9m001, camss-vfe, rzg2l and ti cal drivers.
- Separate the frame descriptor patches from the metadata patches -- they'll need more time and likely will be merged later on.
since v4:
- Merge mergeable patches that have received acks in time.
- Drop the VALIDATE_LATE MC link flag from this set.
- Move the frame descriptor patches out of the set.
- Do not add the client_info argument to the get_fmt() pad op.
- Introduce v4l2_subdev_get_fmt_ci() which returns the pad format but uses the same arguments (i.e. also the client info argument) as the set_fmt() pad op.
- Call the VISIBLE area in v4 as ACTIVE_AREA (imx219 driver; patch merged).
- Set the pixel_rate control's ops to NULL (the control is read-only and not applied on device).
- Fix imx219 driver's limits for VBLANK, HBLANK and EXPOSURE controls.
- Postpone the patch bumping the STREAMS capability bit.
- Fix stopping streams documentation in patch "media: Improve enable_streams and disable_streams documentation".
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 (14):
media: Documentation: Improve pixel rate calculation documentation
media: imx219: Account rate_factor in setting upper exposure limit
media: imx219: Account for rate_factor in control steps
media: imx219: The horizontal blanking step is 8
media: imx219: Rename "binning" as "bin_hv" in imx219_set_pad_format
media: Improve enable_streams and disable_streams documentation
media: v4l2-subdev: Move subdev client capabilities into a new struct
media: v4l2-subdev: Move op check to sub-device op wrappers
media: v4l2-subdev: Always call get_fmt() if set_fmt() is unavailable
media: v4l2-subdev: Don't assign set_fmt where it's equivalent to
get_fmt
media: v4l2-subdev: Add v4l2_subdev_call_ci_state_{active,try}
media: mt9m001: Pass sub-device state to set_selection() callback
media: cvs: Drop comments on sub-device operations
media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad
ops
Documentation/driver-api/media/tx-rx.rst | 6 +- drivers/media/i2c/adv7170.c | 1 + drivers/media/i2c/adv7175.c | 1 + drivers/media/i2c/adv7180.c | 3 +- drivers/media/i2c/adv7183.c | 3 +- drivers/media/i2c/adv748x/adv748x-afe.c | 1 + drivers/media/i2c/adv748x/adv748x-csi2.c | 1 + drivers/media/i2c/adv748x/adv748x-hdmi.c | 1 + drivers/media/i2c/adv7511-v4l2.c | 1 + drivers/media/i2c/adv7604.c | 2 + drivers/media/i2c/adv7842.c | 1 + drivers/media/i2c/ak881x.c | 2 +- drivers/media/i2c/alvium-csi2.c | 3 + drivers/media/i2c/ar0521.c | 1 + drivers/media/i2c/ccs/ccs-core.c | 12 +- drivers/media/i2c/cvs/v4l2.c | 83 +-------- drivers/media/i2c/cx25840/cx25840-core.c | 1 + drivers/media/i2c/ds90ub913.c | 1 + drivers/media/i2c/ds90ub953.c | 1 + drivers/media/i2c/ds90ub960.c | 1 + drivers/media/i2c/et8ek8/et8ek8_driver.c | 1 + drivers/media/i2c/gc0308.c | 1 + drivers/media/i2c/gc0310.c | 2 +- drivers/media/i2c/gc05a2.c | 4 +- drivers/media/i2c/gc08a3.c | 4 +- drivers/media/i2c/gc2145.c | 2 + drivers/media/i2c/hi556.c | 2 + drivers/media/i2c/hi846.c | 2 + drivers/media/i2c/hi847.c | 1 + drivers/media/i2c/imx111.c | 1 + drivers/media/i2c/imx208.c | 1 + drivers/media/i2c/imx214.c | 4 +- drivers/media/i2c/imx219.c | 42 +++-- drivers/media/i2c/imx258.c | 2 + drivers/media/i2c/imx274.c | 3 + drivers/media/i2c/imx283.c | 2 + drivers/media/i2c/imx290.c | 4 +- drivers/media/i2c/imx296.c | 7 +- drivers/media/i2c/imx319.c | 1 + drivers/media/i2c/imx334.c | 3 +- drivers/media/i2c/imx335.c | 4 +- drivers/media/i2c/imx355.c | 4 +- drivers/media/i2c/imx412.c | 3 +- drivers/media/i2c/imx415.c | 4 +- drivers/media/i2c/imx471.c | 4 +- drivers/media/i2c/imx678.c | 2 +- drivers/media/i2c/isl7998x.c | 1 + drivers/media/i2c/lt6911uxe.c | 5 +- drivers/media/i2c/max9286.c | 1 + drivers/media/i2c/max96714.c | 1 + drivers/media/i2c/max96717.c | 1 + drivers/media/i2c/ml86v7667.c | 1 - drivers/media/i2c/mt9m001.c | 9 +- drivers/media/i2c/mt9m111.c | 3 + drivers/media/i2c/mt9m114.c | 6 + drivers/media/i2c/mt9p031.c | 3 + drivers/media/i2c/mt9t112.c | 3 + drivers/media/i2c/mt9v011.c | 1 + drivers/media/i2c/mt9v032.c | 3 + drivers/media/i2c/mt9v111.c | 1 + 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 | 3 +- drivers/media/i2c/ov02c10.c | 1 + drivers/media/i2c/ov02e10.c | 1 + drivers/media/i2c/ov08d10.c | 1 + drivers/media/i2c/ov08x40.c | 1 + drivers/media/i2c/ov13858.c | 1 + drivers/media/i2c/ov13b10.c | 1 + drivers/media/i2c/ov2640.c | 2 + drivers/media/i2c/ov2659.c | 1 + drivers/media/i2c/ov2680.c | 3 + drivers/media/i2c/ov2685.c | 2 + 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 | 2 + drivers/media/i2c/ov5645.c | 4 +- drivers/media/i2c/ov5647.c | 2 + drivers/media/i2c/ov5648.c | 1 + drivers/media/i2c/ov5670.c | 2 + drivers/media/i2c/ov5675.c | 2 + drivers/media/i2c/ov5693.c | 3 + drivers/media/i2c/ov5695.c | 1 + drivers/media/i2c/ov6211.c | 3 +- drivers/media/i2c/ov64a40.c | 2 + drivers/media/i2c/ov7251.c | 4 +- drivers/media/i2c/ov7670.c | 1 + drivers/media/i2c/ov772x.c | 2 + drivers/media/i2c/ov7740.c | 1 + drivers/media/i2c/ov8856.c | 1 + drivers/media/i2c/ov8858.c | 3 +- drivers/media/i2c/ov8865.c | 2 + drivers/media/i2c/ov9282.c | 4 +- drivers/media/i2c/ov9640.c | 2 + drivers/media/i2c/ov9650.c | 1 + drivers/media/i2c/ov9734.c | 1 + drivers/media/i2c/rdacm20.c | 1 - drivers/media/i2c/rdacm21.c | 1 - drivers/media/i2c/rj54n1cb0c.c | 3 + drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 + drivers/media/i2c/s5k3m5.c | 4 +- drivers/media/i2c/s5k5baf.c | 3 + drivers/media/i2c/s5k6a3.c | 1 + drivers/media/i2c/s5kjn1.c | 4 +- drivers/media/i2c/saa6752hs.c | 1 + 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 | 1 + drivers/media/i2c/tc358746.c | 1 + drivers/media/i2c/tda1997x.c | 1 + drivers/media/i2c/thp7312.c | 1 + drivers/media/i2c/tvp514x.c | 1 + drivers/media/i2c/tvp5150.c | 3 +- drivers/media/i2c/tvp7002.c | 1 + drivers/media/i2c/tw9900.c | 1 + drivers/media/i2c/tw9910.c | 2 + drivers/media/i2c/vd55g1.c | 4 +- drivers/media/i2c/vd56g3.c | 4 +- drivers/media/i2c/vgxy61.c | 4 +- drivers/media/pci/cobalt/cobalt-driver.c | 8 +- drivers/media/pci/cobalt/cobalt-v4l2.c | 10 +- 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 | 1 + drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 2 + .../media/pci/intel/ipu6/ipu6-isys-subdev.c | 1 + .../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 | 4 +- drivers/media/platform/amd/isp4/isp4_subdev.c | 1 + drivers/media/platform/amd/isp4/isp4_video.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 | 1 + .../amlogic/c3/mipi-csi2/c3-mipi-csi2.c | 1 + .../platform/arm/mali-c55/mali-c55-isp.c | 3 + .../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 | 1 + drivers/media/platform/cadence/cdns-csi2rx.c | 1 + drivers/media/platform/cadence/cdns-csi2tx.c | 1 + drivers/media/platform/intel/pxa_camera.c | 6 +- drivers/media/platform/marvell/mcam-core.c | 4 +- .../platform/microchip/microchip-csi2dc.c | 1 + .../platform/microchip/microchip-isc-scaler.c | 2 + drivers/media/platform/nxp/imx-mipi-csis.c | 3 +- drivers/media/platform/nxp/imx7-media-csi.c | 1 + .../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 1 + .../platform/nxp/imx8-isi/imx8-isi-pipe.c | 3 + drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 1 + .../media/platform/qcom/camss/camss-csid.c | 3 +- .../media/platform/qcom/camss/camss-csiphy.c | 3 +- .../media/platform/qcom/camss/camss-ispif.c | 3 +- drivers/media/platform/qcom/camss/camss-tpg.c | 3 +- drivers/media/platform/qcom/camss/camss-vfe.c | 12 +- .../media/platform/raspberrypi/rp1-cfe/csi2.c | 1 + .../platform/raspberrypi/rp1-cfe/pisp-fe.c | 1 + drivers/media/platform/renesas/rcar-csi2.c | 1 + .../media/platform/renesas/rcar-isp/csisp.c | 1 + drivers/media/platform/renesas/renesas-ceu.c | 7 +- .../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 3 +- .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 3 +- .../renesas/rzv2h-ivc/rzv2h-ivc-subdev.c | 1 + drivers/media/platform/renesas/sh_vou.c | 6 +- .../media/platform/renesas/vsp1/vsp1_brx.c | 3 + .../media/platform/renesas/vsp1/vsp1_drm.c | 18 +- .../media/platform/renesas/vsp1/vsp1_entity.c | 4 +- .../media/platform/renesas/vsp1/vsp1_entity.h | 1 + .../media/platform/renesas/vsp1/vsp1_histo.c | 3 + .../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_uif.c | 2 + .../media/platform/renesas/vsp1/vsp1_vspx.c | 3 +- .../platform/rockchip/rkcif/rkcif-interface.c | 3 + .../platform/rockchip/rkisp1/rkisp1-csi.c | 1 + .../platform/rockchip/rkisp1/rkisp1-isp.c | 3 + .../platform/rockchip/rkisp1/rkisp1-resizer.c | 3 + .../samsung/exynos4-is/fimc-capture.c | 8 +- .../platform/samsung/exynos4-is/fimc-isp.c | 1 + .../platform/samsung/exynos4-is/fimc-lite.c | 3 + .../platform/samsung/exynos4-is/mipi-csis.c | 1 + .../samsung/s3c-camif/camif-capture.c | 3 + .../platform/samsung/s3c-camif/camif-core.c | 2 +- drivers/media/platform/st/stm32/stm32-csi.c | 1 + drivers/media/platform/st/stm32/stm32-dcmi.c | 10 +- .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 3 + .../st/stm32/stm32-dcmipp/dcmipp-input.c | 1 + .../platform/sunxi/sun4i-csi/sun4i_v4l2.c | 1 + .../sunxi/sun6i-csi/sun6i_csi_bridge.c | 1 + .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 1 + .../sun8i_a83t_mipi_csi2.c | 1 + .../media/platform/synopsys/dw-mipi-csi2rx.c | 1 + .../media/platform/ti/am437x/am437x-vpfe.c | 2 +- drivers/media/platform/ti/cal/cal-camerarx.c | 1 + drivers/media/platform/ti/cal/cal-video.c | 4 +- .../platform/ti/j721e-csi2rx/j721e-csi2rx.c | 1 + drivers/media/platform/ti/omap3isp/ispccdc.c | 5 +- drivers/media/platform/ti/omap3isp/ispccp2.c | 3 +- drivers/media/platform/ti/omap3isp/ispcsi2.c | 3 +- .../media/platform/ti/omap3isp/isppreview.c | 5 +- .../media/platform/ti/omap3isp/ispresizer.c | 5 +- drivers/media/platform/ti/omap3isp/ispvideo.c | 4 +- drivers/media/platform/ti/vpe/vip.c | 4 +- drivers/media/platform/via/via-camera.c | 4 +- drivers/media/platform/video-mux.c | 1 + .../media/platform/xilinx/xilinx-csi2rxss.c | 1 + drivers/media/platform/xilinx/xilinx-tpg.c | 1 + .../media/test-drivers/vimc/vimc-debayer.c | 1 + 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 | 163 ++++++++++++------ .../media/atomisp/i2c/atomisp-gc2235.c | 1 + .../media/atomisp/i2c/atomisp-ov2722.c | 1 + .../staging/media/atomisp/pci/atomisp_cmd.c | 16 +- .../staging/media/atomisp/pci/atomisp_csi2.c | 1 + .../media/atomisp/pci/atomisp_subdev.c | 3 + .../staging/media/atomisp/pci/atomisp_v4l2.c | 8 +- drivers/staging/media/imx/imx-ic-prp.c | 1 + drivers/staging/media/imx/imx-ic-prpencvf.c | 1 + drivers/staging/media/imx/imx-media-csi.c | 3 + drivers/staging/media/imx/imx-media-vdic.c | 1 + drivers/staging/media/imx/imx6-mipi-csi2.c | 1 + drivers/staging/media/ipu3/ipu3-v4l2.c | 3 + drivers/staging/media/ipu7/ipu7-isys-csi2.c | 2 + drivers/staging/media/ipu7/ipu7-isys-subdev.c | 1 + drivers/staging/media/ipu7/ipu7-isys-subdev.h | 1 + drivers/staging/media/max96712/max96712.c | 1 - .../media/sunxi/sun6i-isp/sun6i_isp_proc.c | 1 + drivers/staging/media/tegra-video/csi.c | 1 + drivers/staging/media/tegra-video/vi.c | 10 +- include/media/v4l2-subdev.h | 129 +++++++++++--- 251 files changed, 737 insertions(+), 322 deletions(-)
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v7 1/14 media: Documentation: Improve pixel rate calculation documentation
Improve documentation on calculating the pixel rate, by adding references to relevant functions and mentioning V4L2 fwnode endpoint instead of OF endpoint.
--- Documentation/driver-api/media/tx-rx.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/driver-api/media/tx-rx.rst +5 -1
@@ -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::
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v7 2/14 media: imx219: Account rate_factor in setting upper exposure limit
In reply to Sakari AilusThe rate_factor multiplier is used to multiply a few values in the sensor's timing configuration and the exposure time is one of them. This also needs to be taken into account in exposure time margin: multiply it by rate_factor so that sensor's exposure time margin is respected.
--- drivers/media/i2c/imx219.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/media/i2c/imx219.c +5 -2
@@ -466,7 +466,8 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl)int exposure_max, exposure_def;/* Update max exposure while meeting expected vblanking */ - exposure_max = format->height + ctrl->val -IMX219_EXPOSURE_OFFSET ; + exposure_max = format->height + ctrl->val - +IMX219_EXPOSURE_OFFSET * rate_factor; exposure_def = (exposure_max <IMX219_EXPOSURE_DEFAULT ) ? exposure_max :IMX219_EXPOSURE_DEFAULT ; ret = __v4l2_ctrl_modify_range(imx219->exposure,
@@ -893,6 +894,7 @@ 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 rate_factor =imx219_get_rate_factor (state);int exposure_max;int exposure_def;int llp_min;
@@ -911,7 +913,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,return ret;/* Update max exposure while meeting expected vblanking */ - exposure_max = mode->fll_def -IMX219_EXPOSURE_OFFSET ; + exposure_max = mode->fll_def - +IMX219_EXPOSURE_OFFSET * rate_factor; exposure_def = (exposure_max <IMX219_EXPOSURE_DEFAULT ) ? exposure_max :IMX219_EXPOSURE_DEFAULT ; ret = __v4l2_ctrl_modify_range(imx219->exposure,
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v7 3/14 media: imx219: Account for rate_factor in control steps
In reply to Sakari AilusThe controls that are divided by the rate_factor before writing them to the registers have the step of the value of the rate_factor. Take this into account when the control's range is modified. The controls are created in a configuration where rate_factor is always 1, hence there's no need to change the code adding new controls.
--- drivers/media/i2c/imx219.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/media/i2c/imx219.c +7 -9
@@ -340,13 +340,13 @@ static const struct imx219_mode supported_modes[] = {/* 2x2 binned 60fps mode */ .width = 1640, .height = 1232, - .fll_def = 1707, + .fll_def = 1706, }, {/* 640x480 60fps mode */ .width = 640, .height = 480, - .fll_def = 1707, + .fll_def = 1706, }, };
@@ -473,8 +473,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) ret =__v4l2_ctrl_modify_range (imx219->exposure, imx219->exposure->minimum, exposure_max, - imx219->exposure->step, - exposure_def); + rate_factor, exposure_def);if (ret)return ret;
@@ -902,7 +901,8 @@ 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 , -IMX219_FLL_MAX - mode->height,1 , +IMX219_FLL_MAX - mode->height, + rate_factor, mode->fll_def - mode->height);if (ret)return ret;
@@ -920,8 +920,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, ret =__v4l2_ctrl_modify_range (imx219->exposure, imx219->exposure->minimum, exposure_max, - imx219->exposure->step, - exposure_def); + rate_factor, exposure_def);if (ret)return ret;
@@ -946,8 +945,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)
Signature · 1 line
2.47.3
Re: [PATCH v7 03/14] media: imx219: Account for rate_factor in control steps
Quoted 10 lines · Sakari Ailus
The controls that are divided by the
rate_factorbefore writing them to the registers have the step of the value of therate_factor. Take this into account when the control's range is modified. The controls are created in a configuration whererate_factoris always 1, hence there's no need to change the code adding new controls.Fixes f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning")Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Dave Stevenson <[email protected]>
Quoted 64 lines
--- drivers/media/i2c/imx219.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)drivers/media/i2c/imx219.c +7
-9@@ -340,13 +340,13 @@ static const struct imx219_mode supported_modes[] = {/* 2x2 binned 60fps mode */ .width = 1640, .height = 1232, - .fll_def = 1707, + .fll_def = 1706, }, {/* 640x480 60fps mode */ .width = 640, .height = 480, - .fll_def = 1707, + .fll_def = 1706, }, };@@ -473,8 +473,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) ret =__v4l2_ctrl_modify_range (imx219->exposure, imx219->exposure->minimum, exposure_max, - imx219->exposure->step, - exposure_def); + rate_factor, exposure_def);if (ret)return ret;@@ -902,7 +901,8 @@ 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 , -IMX219_FLL_MAX - mode->height,1 , +IMX219_FLL_MAX - mode->height, + rate_factor, mode->fll_def - mode->height);if (ret)return ret;@@ -920,8 +920,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, ret =__v4l2_ctrl_modify_range (imx219->exposure, imx219->exposure->minimum, exposure_max, - imx219->exposure->step, - exposure_def); + rate_factor, exposure_def);if (ret)return ret;@@ -946,8 +945,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)
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerPATCH v7 4/14 media: imx219: The horizontal blanking step is 8
In reply to Sakari AilusThe step for the LINE_LENGTH_A register on imx219 is 8. Take this into account in creating and modifying the horizontal blanking control. The minimum line length in pixels as well as the horizontal blanking values are already divisible by 8.
--- drivers/media/i2c/imx219.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/media/i2c/imx219.c +5 -2
@@ -78,6 +78,7 @@#define IMX219_LLP_MIN 0x0d78#define IMX219_BINNED_LLP_MIN 0x0de8#define IMX219_LLP_MAX 0x7ff0 +#define IMX219_LLP_STEP 8#define IMX219_REG_X_ADD_STA_A CCI_REG16(0x0164)#define IMX219_REG_X_ADD_END_A CCI_REG16(0x0166)
@@ -593,7 +594,8 @@ static int imx219_init_controls(struct imx219 *imx219) imx219->hblank =v4l2_ctrl_new_std (ctrl_hdlr, &imx219_ctrl_ops,V4L2_CID_HBLANK ,IMX219_LLP_MIN - mode->width, -IMX219_LLP_MAX - mode->width,1 , +IMX219_LLP_MAX - mode->width, +IMX219_LLP_STEP ,IMX219_LLP_MIN - mode->width); exposure_max = mode->fll_def -IMX219_EXPOSURE_OFFSET ; exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ?
@@ -935,7 +937,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, IMX219_BINNED_LLP_MIN :IMX219_LLP_MIN ; ret =__v4l2_ctrl_modify_range (imx219->hblank, llp_min - mode->width, -IMX219_LLP_MAX - mode->width,1 , +IMX219_LLP_MAX - mode->width, +IMX219_LLP_STEP , llp_min - mode->width);if (ret)return ret;
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v7 5/14 media: imx219: Rename "binning" as "bin_hv" in imx219_set_pad_format
In reply to Sakari AilusRename "binning" as "bin_hv" in anticipation of having a variable called "binning" for another purpose.
--- drivers/media/i2c/imx219.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/i2c/imx219.c +4 -4
@@ -853,7 +853,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 );
@@ -886,11 +886,11 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, bin_v =min (IMX219_ACTIVE_AREA_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 ;
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v7 6/14 media: Improve enable_streams and disable_streams documentation
In reply to Sakari AilusDocument that enable_streams may start additional streams and disable_streams may not disable requested streams if other related streams are still enabled.
--- include/media/v4l2-subdev.h | 8 ++++++++ 1 file changed, 8 insertions(+)
include/media/v4l2-subdev.h +8 -0
@@ -814,6 +814,11 @@ struct v4l2_subdev_state {* V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask * argument. * +* Due to device constraints, starting the requested streams may result in +* additional streams also being started by the driver. Streams that are +* started and stopped together due to the nature of the 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 +828,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. +* +* When the requested stream are part of a stream group, they will be +* stopped once all streams in the group are stopped. */ struct v4l2_subdev_pad_ops { int (*enum_mbus_code)(struct v4l2_subdev *sd,
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v7 7/14 media: v4l2-subdev: Move subdev client capabilities into a new struct
In reply to Sakari AilusAdd 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.
--- drivers/media/v4l2-core/v4l2-subdev.c | 8 ++++---- include/media/v4l2-subdev.h | 12 ++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-)
drivers/media/v4l2-core/v4l2-subdev.c +4 -4
@@ -611,7 +611,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.caps &V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH )) fi->which =V4L2_SUBDEV_FORMAT_ACTIVE ;
@@ -650,7 +650,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.caps &V4L2_SUBDEV_CLIENT_CAP_STREAMS ;int rval;
@@ -1117,7 +1117,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.caps;return 0 ; }
@@ -1137,7 +1137,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.caps = client_cap->capabilities;return 0 ; }
include/media/v4l2-subdev.h +10 -2
@@ -734,6 +734,14 @@ struct v4l2_subdev_state {struct v4l2_subdev_stream_configs stream_configs; }; +/** +* struct v4l2_subdev_client_info - Sub-device client information +* @caps: bitmask of ``V4L2_SUBDEV_CLIENT_CAP_*`` +*/ +struct v4l2_subdev_client_info { +u64 caps; +}; +/** * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations *
@@ -1130,14 +1138,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 };
Signature · 1 line
2.47.3
Re: [PATCH v7 07/14] media: v4l2-subdev: Move subdev client capabilities into a new struct
Quoted 11 lines · Sakari Ailus
Add struct
v4l2_subdev_client_infoto hold sub-device client capability bits that used to be stored in theclient_capsfield of structv4l2_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.
Quoted 3 lines
Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Mirela Rabulea <[email protected]>Reviewed-by Frank Li <[email protected]>
Quoted 81 lines
--- drivers/media/v4l2-core/v4l2-subdev.c | 8 ++++---- include/media/v4l2-subdev.h | 12 ++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +4
-4@@ -611,7 +611,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.caps &V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH )) fi->which =V4L2_SUBDEV_FORMAT_ACTIVE ;@@ -650,7 +650,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.caps &V4L2_SUBDEV_CLIENT_CAP_STREAMS ;int rval;@@ -1117,7 +1117,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.caps;return 0 ; }@@ -1137,7 +1137,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.caps = client_cap->capabilities;return 0 ; }include/media/v4l2-subdev.h +10
-2@@ -734,6 +734,14 @@ struct v4l2_subdev_state {struct v4l2_subdev_stream_configs stream_configs; }; +/** +* struct v4l2_subdev_client_info - Sub-device client information +* @caps: bitmask of ``V4L2_SUBDEV_CLIENT_CAP_*`` +*/ +struct v4l2_subdev_client_info { +u64 caps; +}; +/** * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations * @@ -1130,14 +1138,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 };
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerPATCH v7 8/14 media: v4l2-subdev: Move op check to sub-device op wrappers
In reply to Sakari AilusIn anticipation of performing work for sub-device operation when the driver doesn't implement one, move the check of operation existence to the wrapper itself.
No functional change intended.
--- drivers/media/v4l2-core/v4l2-subdev.c | 92 ++++++++++++++++----------- include/media/v4l2-subdev.h | 6 +- 2 files changed, 59 insertions(+), 39 deletions(-)
drivers/media/v4l2-core/v4l2-subdev.c +55 -37
@@ -244,20 +244,32 @@ static inline int check_format(struct v4l2_subdev *sd,check_state (sd, state, format->which, format->pad, format->stream); } +#define do_subdev_call(sd, check, o, f, args...) \ + (!(sd)->ops->o->f ? -ENOIOCTLCMD : (check) ? : \ + (sd)->ops->o->f(sd, ##args)) +static int call_get_fmt (struct v4l2_subdev *sd,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) { -return check_format (sd, state, format) ? : - sd->ops->pad->get_fmt (sd, state, format); +return do_subdev_call (sd,check_format (sd, state, format), pad, get_fmt, + state, format); }static int call_set_fmt (struct v4l2_subdev *sd,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) { -return check_format (sd, state, format) ? : - sd->ops->pad->set_fmt (sd, state, format); +return do_subdev_call (sd,check_format (sd, state, format), pad, set_fmt, + state, format); +} + +static int check_which_pad_state (struct v4l2_subdev *sd, +struct v4l2_subdev_state *state,u32 which, +u32 pad,u32 stream) +{ +return check_which (which) ? :check_pad (sd, pad) ? : +check_state (sd, state, which, pad, stream); } static int call_enum_mbus_code(struct v4l2_subdev *sd,
@@ -267,9 +279,9 @@ static int call_enum_mbus_code(struct v4l2_subdev *sd,if (!code)return -EINVAL ; -return check_which (code->which) ? :check_pad (sd, code->pad) ? : -check_state (sd, state, code->which, code->pad, code->stream) ? : - sd->ops->pad->enum_mbus_code (sd, state, code); +return do_subdev_call (sd,check_which_pad_state (sd, state, code->which, + code->pad, code->stream), + pad, enum_mbus_code, state, code); } static int call_enum_frame_size(struct v4l2_subdev *sd,
@@ -279,9 +291,9 @@ static int call_enum_frame_size(struct v4l2_subdev *sd,if (!fse)return -EINVAL ; -return check_which (fse->which) ? :check_pad (sd, fse->pad) ? : -check_state (sd, state, fse->which, fse->pad, fse->stream) ? : - sd->ops->pad->enum_frame_size (sd, state, fse); +return do_subdev_call (sd,check_which_pad_state (sd, state, fse->which, + fse->pad, fse->stream), + pad, enum_frame_size, state, fse); } static int call_enum_frame_interval(struct v4l2_subdev *sd,
@@ -291,9 +303,9 @@ static int call_enum_frame_interval(struct v4l2_subdev *sd,if (!fie)return -EINVAL ; -return check_which (fie->which) ? :check_pad (sd, fie->pad) ? : -check_state (sd, state, fie->which, fie->pad, fie->stream) ? : - sd->ops->pad->enum_frame_interval (sd, state, fie); +return do_subdev_call (sd,check_which_pad_state (sd, state, fie->which, + fie->pad, fie->stream), + pad, enum_frame_interval, state, fie); } static inline int check_selection(struct v4l2_subdev *sd,
@@ -311,16 +323,16 @@ static int call_get_selection(struct v4l2_subdev *sd,struct v4l2_subdev_state *state, struct v4l2_subdev_selection *sel) { - return check_selection(sd, state, sel) ? : - sd->ops->pad->get_selection(sd, state, sel); + return do_subdev_call(sd, check_selection(sd, state, sel), +pad ,get_selection ,state ,sel ); }static int call_set_selection (struct v4l2_subdev *sd,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) { -return check_selection (sd, state, sel) ? : - sd->ops->pad->set_selection (sd, state, sel); +return do_subdev_call (sd,check_selection (sd, state, sel), + pad, set_selection, state, sel); } static inline int check_frame_interval(struct v4l2_subdev *sd,
@@ -338,16 +350,16 @@ static int call_get_frame_interval(struct v4l2_subdev *sd,struct v4l2_subdev_state *state, struct v4l2_subdev_frame_interval *fi) { - return check_frame_interval(sd, state, fi) ? : - sd->ops->pad->get_frame_interval(sd, state, fi); + return do_subdev_call(sd, check_frame_interval(sd, state, fi), +pad ,get_frame_interval ,state ,fi ); }static int call_set_frame_interval (struct v4l2_subdev *sd,struct v4l2_subdev_state *state,struct v4l2_subdev_frame_interval *fi) { -return check_frame_interval (sd, state, fi) ? : - sd->ops->pad->set_frame_interval (sd, state, fi); +return do_subdev_call (sd,check_frame_interval (sd, state, fi), + pad, set_frame_interval, state, fi); } static int call_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
@@ -361,6 +373,9 @@ static int call_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,return -EOPNOTSUPP ;#endif +if (!sd->ops->pad->get_frame_desc) +return -ENOIOCTLCMD ; +memset (fd,0 ,sizeof (*fd)); ret = sd->ops->pad->get_frame_desc (sd, pad, fd);
@@ -405,12 +420,12 @@ static inline int check_edid(struct v4l2_subdev *sd,static int call_get_edid (struct v4l2_subdev *sd,struct v4l2_subdev_edid *edid) { -return check_edid (sd, edid) ? : sd->ops->pad->get_edid (sd, edid); +return do_subdev_call (sd,check_edid (sd, edid), pad, get_edid, edid); }static int call_set_edid (struct v4l2_subdev *sd,struct v4l2_subdev_edid *edid) { -return check_edid (sd, edid) ? : sd->ops->pad->set_edid (sd, edid); +return do_subdev_call (sd,check_edid (sd, edid), pad, set_edid, edid); } static int call_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
@@ -419,8 +434,8 @@ static int call_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,if (!timings)return -EINVAL ; -return check_pad (sd, pad) ? : - sd->ops->pad->s_dv_timings (sd, pad, timings); +return do_subdev_call (sd,check_pad (sd, pad), + pad, s_dv_timings, pad, timings); } static int call_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
@@ -429,8 +444,8 @@ static int call_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,if (!timings)return -EINVAL ; -return check_pad (sd, pad) ? : - sd->ops->pad->g_dv_timings (sd, pad, timings); +return do_subdev_call (sd,check_pad (sd, pad), + pad, g_dv_timings, pad, timings); } static int call_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
@@ -439,8 +454,8 @@ static int call_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,if (!timings)return -EINVAL ; -return check_pad (sd, pad) ? : - sd->ops->pad->query_dv_timings (sd, pad, timings); +return do_subdev_call (sd,check_pad (sd, pad), + pad, query_dv_timings, pad, timings); } static int call_dv_timings_cap(struct v4l2_subdev *sd,
@@ -449,8 +464,8 @@ static int call_dv_timings_cap(struct v4l2_subdev *sd,if (!cap)return -EINVAL ; -return check_pad (sd, cap->pad) ? : - sd->ops->pad->dv_timings_cap (sd, cap); +return do_subdev_call (sd,check_pad (sd, cap->pad), + pad, dv_timings_cap, cap); } static int call_enum_dv_timings(struct v4l2_subdev *sd,
@@ -459,8 +474,8 @@ static int call_enum_dv_timings(struct v4l2_subdev *sd,if (!dvt)return -EINVAL ; -return check_pad (sd, dvt->pad) ? : - sd->ops->pad->enum_dv_timings (sd, dvt); +return do_subdev_call (sd,check_pad (sd, dvt->pad), + pad, enum_dv_timings, dvt); } static int call_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
@@ -468,14 +483,17 @@ static int call_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad, {memset (config,0 ,sizeof (*config)); -return check_pad (sd, pad) ? : - sd->ops->pad->get_mbus_config (sd, pad, config); +return do_subdev_call (sd,check_pad (sd, pad), pad, get_mbus_config, + pad, config); }static int call_s_stream (struct v4l2_subdev *sd,int enable) {int ret; +if (!sd->ops->video->s_stream) +return -ENOIOCTLCMD ; +/* * The .s_stream() operation must never be called to start or stop an * already started or stopped subdev. Catch offenders but don't return
@@ -509,7 +527,7 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)* wrapper handles the case where the caller does not provide the called * subdev's state. This should be removed when all the callers are fixed. */ -#define DEFINE_STATE_WRAPPER (f, arg_type) \ +#define DEFINE_STATE_WRAPPER (f, arg_type) \ static int call_##f##_state(struct v4l2_subdev *sd, \ struct v4l2_subdev_state *_state, \ arg_type *arg) \
@@ -526,7 +544,7 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)#else /* CONFIG_MEDIA_CONTROLLER */ -#define DEFINE_STATE_WRAPPER (f, arg_type) \ +#define DEFINE_STATE_WRAPPER (f, arg_type) \ static int call_##f##_state(struct v4l2_subdev *sd, \ struct v4l2_subdev_state *state, \ arg_type *arg) \
include/media/v4l2-subdev.h +4 -2
@@ -1951,14 +1951,16 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers;int __result; \if (!__sd) \ __result = -ENODEV ; \ -else if (!(__sd->ops->o && __sd->ops->o->f)) \ +else if (!__sd->ops->o) \ __result = -ENOIOCTLCMD ; \ else if (v4l2_subdev_call_wrappers.o && \ v4l2_subdev_call_wrappers.o->f) \ __result = v4l2_subdev_call_wrappers.o->f( \ __sd, ##args); \ - else \ + else if (__sd->ops->o->f) \ __result = __sd->ops->o->f(__sd, ##args); \ + else \ + __result = -ENOIOCTLCMD; \ __result; \ })
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v7 9/14 media: v4l2-subdev: Always call get_fmt() if set_fmt() is unavailable
In reply to Sakari AilusMany drivers implement set_fmt() pad op that simply returns the format just as get_fmt() would do, usually because the driver only supports a single one. As a driver should always implement set_fmt() either on its own or via get_fmt(), call get_fmt() in case set_fmt() isn't implemented by the driver. This allows removing a fair amount of boilerplate code as well as ensures that set_fmt() works whenever get_fmt() does.
--- drivers/media/v4l2-core/v4l2-subdev.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/media/v4l2-core/v4l2-subdev.c +13 -2
@@ -260,8 +260,19 @@ static int call_set_fmt(struct v4l2_subdev *sd,struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { - return do_subdev_call(sd, check_format(sd, state, format), pad, set_fmt, -state ,format ); + int ret; + +if (!sd->ops->pad->set_fmt && !sd->ops->pad->get_fmt) +return -ENOIOCTLCMD ; + + ret =check_format (sd, state, format); +if (ret) +return ret; + +if (sd->ops->pad->set_fmt) +return sd->ops->pad->set_fmt (sd, state, format); + +return sd->ops->pad->get_fmt (sd, state, format); } static int check_which_pad_state(struct v4l2_subdev *sd,
Signature · 1 line
2.47.3
Re: [PATCH v7 09/14] media: v4l2-subdev: Always call get_fmt() if set_fmt() is unavailable
Quoted 8 lines · Sakari Ailus
Many drivers implement
set_fmt()pad op that simply returns the format just asget_fmt()would do, usually because the driver only supports a single one. As a driver should always implementset_fmt()either on its own or viaget_fmt(), callget_fmt()in caseset_fmt()isn't implemented by the driver. This allows removing a fair amount of boilerplate code as well as ensures thatset_fmt()works wheneverget_fmt()does.Signed-off-by Sakari Ailus <[email protected]>
Regards,
Hans
Quoted 30 lines
--- drivers/media/v4l2-core/v4l2-subdev.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +13
-2@@ -260,8 +260,19 @@ static int call_set_fmt(struct v4l2_subdev *sd,struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { - return do_subdev_call(sd, check_format(sd, state, format), pad, set_fmt, -state ,format ); + int ret; + +if (!sd->ops->pad->set_fmt && !sd->ops->pad->get_fmt) +return -ENOIOCTLCMD ; + + ret =check_format (sd, state, format); +if (ret) +return ret; + +if (sd->ops->pad->set_fmt) +return sd->ops->pad->set_fmt (sd, state, format); + +return sd->ops->pad->get_fmt (sd, state, format); } static int check_which_pad_state(struct v4l2_subdev *sd,
Re: [PATCH v7 09/14] media: v4l2-subdev: Always call get_fmt() if set_fmt() is unavailable
In reply to Sakari AilusQuoted 8 lines · Sakari Ailus
Many drivers implement
set_fmt()pad op that simply returns the format just asget_fmt()would do, usually because the driver only supports a single one. As a driver should always implementset_fmt()either on its own or viaget_fmt(), callget_fmt()in caseset_fmt()isn't implemented by the driver. This allows removing a fair amount of boilerplate code as well as ensures thatset_fmt()works wheneverget_fmt()does.Signed-off-by Sakari Ailus <[email protected]>
Quoted 30 lines
--- drivers/media/v4l2-core/v4l2-subdev.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +13
-2@@ -260,8 +260,19 @@ static int call_set_fmt(struct v4l2_subdev *sd,struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) { - return do_subdev_call(sd, check_format(sd, state, format), pad, set_fmt, -state ,format ); + int ret; + +if (!sd->ops->pad->set_fmt && !sd->ops->pad->get_fmt) +return -ENOIOCTLCMD ; + + ret =check_format (sd, state, format); +if (ret) +return ret; + +if (sd->ops->pad->set_fmt) +return sd->ops->pad->set_fmt (sd, state, format); + +return sd->ops->pad->get_fmt (sd, state, format); } static int check_which_pad_state(struct v4l2_subdev *sd,
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerPATCH v7 10/14 media: v4l2-subdev: Don't assign set_fmt where it's equivalent to get_fmt
In reply to Sakari AilusDo not assign the set_fmt() pad op where it is the same as get_fmt(). The get_fmt() pad op is called by the framework now in absence of set_fmt() op.
--- drivers/media/i2c/ak881x.c | 1 - drivers/media/i2c/gc0310.c | 1 - drivers/media/i2c/rdacm20.c | 1 - drivers/media/i2c/rdacm21.c | 1 - drivers/media/i2c/tvp5150.c | 1 - drivers/staging/media/max96712/max96712.c | 1 - 6 files changed, 6 deletions(-)
drivers/media/i2c/ak881x.c +0 -1
@@ -216,7 +216,6 @@ static const struct v4l2_subdev_video_ops ak881x_subdev_video_ops = {static const struct v4l2_subdev_pad_ops ak881x_subdev_pad_ops = { .enum_mbus_code = ak881x_enum_mbus_code, .get_selection = ak881x_get_selection, - .set_fmt = ak881x_fill_fmt, .get_fmt = ak881x_fill_fmt, };
drivers/media/i2c/gc0310.c +0 -1
@@ -537,7 +537,6 @@ static const struct v4l2_subdev_pad_ops gc0310_pad_ops = { .enum_mbus_code = gc0310_enum_mbus_code, .enum_frame_size = gc0310_enum_frame_size, .get_fmt = v4l2_subdev_get_fmt, - .set_fmt = v4l2_subdev_get_fmt, /* Only 1 fixed mode supported */ .get_selection = gc0310_get_selection, .set_selection = gc0310_get_selection, .enable_streams = gc0310_enable_streams,
drivers/media/i2c/rdacm20.c +0 -1
@@ -442,7 +442,6 @@ static const struct v4l2_subdev_video_ops rdacm20_video_ops = {static const struct v4l2_subdev_pad_ops rdacm20_subdev_pad_ops = { .enum_mbus_code = rdacm20_enum_mbus_code, .get_fmt = rdacm20_get_fmt, - .set_fmt = rdacm20_get_fmt, };static const struct v4l2_subdev_ops rdacm20_subdev_ops = {
drivers/media/i2c/rdacm21.c +0 -1
@@ -322,7 +322,6 @@ static const struct v4l2_subdev_video_ops rdacm21_video_ops = {static const struct v4l2_subdev_pad_ops rdacm21_subdev_pad_ops = { .enum_mbus_code = rdacm21_enum_mbus_code, .get_fmt = rdacm21_get_fmt, - .set_fmt = rdacm21_get_fmt, };static const struct v4l2_subdev_ops rdacm21_subdev_ops = {
drivers/media/i2c/tvp5150.c +0 -1
@@ -1724,7 +1724,6 @@ static const struct v4l2_subdev_vbi_ops tvp5150_vbi_ops = {static const struct v4l2_subdev_pad_ops tvp5150_pad_ops = { .enum_mbus_code = tvp5150_enum_mbus_code, .enum_frame_size = tvp5150_enum_frame_size, - .set_fmt = tvp5150_fill_fmt, .get_fmt = tvp5150_fill_fmt, .get_selection = tvp5150_get_selection, .set_selection = tvp5150_set_selection,
drivers/staging/media/max96712/max96712.c +0 -1
@@ -264,7 +264,6 @@ static const struct v4l2_subdev_internal_ops max96712_internal_ops = {static const struct v4l2_subdev_pad_ops max96712_pad_ops = { .get_fmt = v4l2_subdev_get_fmt, - .set_fmt = v4l2_subdev_get_fmt, };static const struct v4l2_subdev_ops max96712_subdev_ops = {
Signature · 1 line
2.47.3
Re: [PATCH v7 10/14] media: v4l2-subdev: Don't assign set_fmt where it's equivalent to get_fmt
Quoted 5 lines · Sakari Ailus
Do not assign the
set_fmt()pad op where it is the same asget_fmt(). Theget_fmt()pad op is called by the framework now in absence ofset_fmt()op.Signed-off-by Sakari Ailus <[email protected]>
Regards,
Hans
Quoted 81 lines
--- drivers/media/i2c/ak881x.c | 1 - drivers/media/i2c/gc0310.c | 1 - drivers/media/i2c/rdacm20.c | 1 - drivers/media/i2c/rdacm21.c | 1 - drivers/media/i2c/tvp5150.c | 1 - drivers/staging/media/max96712/max96712.c | 1 - 6 files changed, 6 deletions(-)drivers/media/i2c/ak881x.c +0
-1@@ -216,7 +216,6 @@ static const struct v4l2_subdev_video_ops ak881x_subdev_video_ops = {static const struct v4l2_subdev_pad_ops ak881x_subdev_pad_ops = { .enum_mbus_code = ak881x_enum_mbus_code, .get_selection = ak881x_get_selection, - .set_fmt = ak881x_fill_fmt, .get_fmt = ak881x_fill_fmt, };drivers/media/i2c/gc0310.c +0
-1@@ -537,7 +537,6 @@ static const struct v4l2_subdev_pad_ops gc0310_pad_ops = { .enum_mbus_code = gc0310_enum_mbus_code, .enum_frame_size = gc0310_enum_frame_size, .get_fmt = v4l2_subdev_get_fmt, - .set_fmt = v4l2_subdev_get_fmt, /* Only 1 fixed mode supported */ .get_selection = gc0310_get_selection, .set_selection = gc0310_get_selection, .enable_streams = gc0310_enable_streams,drivers/media/i2c/rdacm20.c +0
-1@@ -442,7 +442,6 @@ static const struct v4l2_subdev_video_ops rdacm20_video_ops = {static const struct v4l2_subdev_pad_ops rdacm20_subdev_pad_ops = { .enum_mbus_code = rdacm20_enum_mbus_code, .get_fmt = rdacm20_get_fmt, - .set_fmt = rdacm20_get_fmt, };static const struct v4l2_subdev_ops rdacm20_subdev_ops = {drivers/media/i2c/rdacm21.c +0
-1@@ -322,7 +322,6 @@ static const struct v4l2_subdev_video_ops rdacm21_video_ops = {static const struct v4l2_subdev_pad_ops rdacm21_subdev_pad_ops = { .enum_mbus_code = rdacm21_enum_mbus_code, .get_fmt = rdacm21_get_fmt, - .set_fmt = rdacm21_get_fmt, };static const struct v4l2_subdev_ops rdacm21_subdev_ops = {drivers/media/i2c/tvp5150.c +0
-1@@ -1724,7 +1724,6 @@ static const struct v4l2_subdev_vbi_ops tvp5150_vbi_ops = {static const struct v4l2_subdev_pad_ops tvp5150_pad_ops = { .enum_mbus_code = tvp5150_enum_mbus_code, .enum_frame_size = tvp5150_enum_frame_size, - .set_fmt = tvp5150_fill_fmt, .get_fmt = tvp5150_fill_fmt, .get_selection = tvp5150_get_selection, .set_selection = tvp5150_set_selection,drivers/staging/media/max96712/max96712.c +0
-1@@ -264,7 +264,6 @@ static const struct v4l2_subdev_internal_ops max96712_internal_ops = {static const struct v4l2_subdev_pad_ops max96712_pad_ops = { .get_fmt = v4l2_subdev_get_fmt, - .set_fmt = v4l2_subdev_get_fmt, };static const struct v4l2_subdev_ops max96712_subdev_ops = {
Re: [PATCH v7 10/14] media: v4l2-subdev: Don't assign set_fmt where it's equivalent to get_fmt
In reply to Sakari AilusQuoted 8 lines · Sakari Ailus
Do not assign the
set_fmt()pad op where it is the same asget_fmt(). Theget_fmt()pad op is called by the framework now in absence ofset_fmt()op.Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/i2c/ak881x.c | 1 - drivers/media/i2c/gc0310.c | 1 -
You forgot ml86v7667.c. imx678.c has been added since v6 and should also be addressed here.
With that,
Quoted 78 lines
drivers/media/i2c/rdacm20.c | 1 - drivers/media/i2c/rdacm21.c | 1 - drivers/media/i2c/tvp5150.c | 1 - drivers/staging/media/max96712/max96712.c | 1 - 6 files changed, 6 deletions(-)drivers/media/i2c/ak881x.c +0
-1@@ -216,7 +216,6 @@ static const struct v4l2_subdev_video_ops ak881x_subdev_video_ops = {static const struct v4l2_subdev_pad_ops ak881x_subdev_pad_ops = { .enum_mbus_code = ak881x_enum_mbus_code, .get_selection = ak881x_get_selection, - .set_fmt = ak881x_fill_fmt, .get_fmt = ak881x_fill_fmt, };drivers/media/i2c/gc0310.c +0
-1@@ -537,7 +537,6 @@ static const struct v4l2_subdev_pad_ops gc0310_pad_ops = { .enum_mbus_code = gc0310_enum_mbus_code, .enum_frame_size = gc0310_enum_frame_size, .get_fmt = v4l2_subdev_get_fmt, - .set_fmt = v4l2_subdev_get_fmt, /* Only 1 fixed mode supported */ .get_selection = gc0310_get_selection, .set_selection = gc0310_get_selection, .enable_streams = gc0310_enable_streams,drivers/media/i2c/rdacm20.c +0
-1@@ -442,7 +442,6 @@ static const struct v4l2_subdev_video_ops rdacm20_video_ops = {static const struct v4l2_subdev_pad_ops rdacm20_subdev_pad_ops = { .enum_mbus_code = rdacm20_enum_mbus_code, .get_fmt = rdacm20_get_fmt, - .set_fmt = rdacm20_get_fmt, };static const struct v4l2_subdev_ops rdacm20_subdev_ops = {drivers/media/i2c/rdacm21.c +0
-1@@ -322,7 +322,6 @@ static const struct v4l2_subdev_video_ops rdacm21_video_ops = {static const struct v4l2_subdev_pad_ops rdacm21_subdev_pad_ops = { .enum_mbus_code = rdacm21_enum_mbus_code, .get_fmt = rdacm21_get_fmt, - .set_fmt = rdacm21_get_fmt, };static const struct v4l2_subdev_ops rdacm21_subdev_ops = {drivers/media/i2c/tvp5150.c +0
-1@@ -1724,7 +1724,6 @@ static const struct v4l2_subdev_vbi_ops tvp5150_vbi_ops = {static const struct v4l2_subdev_pad_ops tvp5150_pad_ops = { .enum_mbus_code = tvp5150_enum_mbus_code, .enum_frame_size = tvp5150_enum_frame_size, - .set_fmt = tvp5150_fill_fmt, .get_fmt = tvp5150_fill_fmt, .get_selection = tvp5150_get_selection, .set_selection = tvp5150_set_selection,drivers/staging/media/max96712/max96712.c +0
-1@@ -264,7 +264,6 @@ static const struct v4l2_subdev_internal_ops max96712_internal_ops = {static const struct v4l2_subdev_pad_ops max96712_pad_ops = { .get_fmt = v4l2_subdev_get_fmt, - .set_fmt = v4l2_subdev_get_fmt, };static const struct v4l2_subdev_ops max96712_subdev_ops = {
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH v7 10/14] media: v4l2-subdev: Don't assign set_fmt where it's equivalent to get_fmt
Hi Laurent,
Quoted 5 lines · Laurent Pinchart
Quoted 4 lines · Sakari Ailus
Do not assign the
set_fmt()pad op where it is the same asget_fmt(). Theget_fmt()pad op is called by the framework now in absence ofset_fmt()op.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/i2c/ak881x.c | 1 - drivers/media/i2c/gc0310.c | 1 -You forgot
ml86v7667.c.imx678.chas been added since v6 and should also be addressed here.
Thanks for spotting this. I'll address it for v8.
Quoted 4 lines
With that,
Reviewed-by Laurent Pinchart <[email protected]>
Signature · 1 line
Sakari Ailus
Sakari Ailus
maintainerPATCH v7 11/14 media: v4l2-subdev: Add v4l2_subdev_call_ci_state_{active,try}
In reply to Sakari AilusAdd v4l2_subdev_call_ci_state_active(), and v4l2_subdev_call_ci_state_try() to call sub-device pad ops that take struct v4l2_subdev_client_info pointer as an argument. These ops cannot be called using v4l2_subdev_call_state_active() or v4l2_subdev_call_state_try() as the client_info argument precedes the state argument.
--- include/media/v4l2-subdev.h | 95 +++++++++++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 21 deletions(-)
include/media/v4l2-subdev.h +74 -21
@@ -1964,6 +1964,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
@@ -1982,22 +1998,13 @@ 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_state_try - call an operation of a v4l2_subdev which -* takes state as a parameter, passing the -* subdev a newly allocated try state. +* 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.
@@ -2007,13 +2014,14 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers;* each element at &struct v4l2_subdev_ops. * @args: arguments for @f. * -* This is similar to v4l2_subdev_call_state_active(), except that as this -* version allocates a new state, this is only usable for -* V4L2_SUBDEV_FORMAT_TRY use cases. -* -* Note: only legacy non-MC drivers may need this macro. +* 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 set_fmt, get_selection and set_selection). */ -#define v4l2_subdev_call_state_try(sd, o, f, args...) \ +#define v4l2_subdev_call_ci_state_active(sd, o, f, args...) \ + __v4l2_subdev_call_state_active(v4l2_subdev_call, sd, o, f, ##args) + +#define __v4l2_subdev_call_state_try(call, sd, o, f, args...) \ ({ \ int __result; \ static struct lock_class_key __key; \
@@ -2025,13 +2033,58 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; __result =PTR_ERR (state); \ } else { \v4l2_subdev_lock_state (state ); \ - __result = v4l2_subdev_call(sd, o, f, state, ##args); \ + __result = call(sd, o, f, NULL, state, ##args); \ v4l2_subdev_unlock_state(state); \ __v4l2_subdev_state_free(state); \ } \ __result; \ }) +/** +* v4l2_subdev_call_state_try - call an operation of a v4l2_subdev which +* takes state as a parameter, passing the +* subdev a newly allocated try 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 is similar to v4l2_subdev_call_state_active(), except that as this +* version allocates a new state, this is only usable for +* V4L2_SUBDEV_FORMAT_TRY use cases. +* +* Note: only legacy non-MC drivers may need this macro. +*/ +#define v4l2_subdev_call_state_try(sd, o, f, args...) \ + __v4l2_subdev_call_state_try(__v4l2_subdev_call_drop_fourth, sd, o, f, \ + ##args); + +/** +* v4l2_subdev_call_ci_state_try - call an operation of a v4l2_subdev which +* takes state as a parameter, passing the +* subdev a newly allocated try 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 is similar to v4l2_subdev_call_state_try(), with the exception +* that it passes NULL as the client info to sub-device ops that need it +* (currently pad ops set_fmt, get_selection and set_selection). +* +* Note: only legacy non-MC drivers may need this macro. +*/ +#define v4l2_subdev_call_ci_state_try(sd, o, f, args...) \ + __v4l2_subdev_call_state_try(v4l2_subdev_call, sd, o, f, ##args); +/** * v4l2_subdev_has_op - Checks if a subdev defines a certain operation. *
Signature · 1 line
2.47.3
Re: [PATCH v7 11/14] media: v4l2-subdev: Add v4l2_subdev_call_ci_state_{active,try}
Quoted 6 lines · Sakari Ailus
Add
v4l2_subdev_call_ci_state_active(), andv4l2_subdev_call_ci_state_try()to call sub-device pad ops that take structv4l2_subdev_client_infopointer as an argument. These ops cannot be called usingv4l2_subdev_call_state_active()orv4l2_subdev_call_state_try()as theclient_infoargument precedes the state argument.
So if we have to jump through all these hoops just because the client_info pointer precedes the state pointer in the pad op argument list, wouldn't it be better to swap the order? For example by moving the client_info pointer as the last argument?
Honestly, these macros are getting really hard to follow, and I'm not sure it is worth it just to keep the client_info before the state pointer. Yes, that's the logical order, but at the price of some very hard to read defines.
Or am I missing something?
Regards,
Hans
Quoted 142 lines
Signed-off-by Sakari Ailus <[email protected]>--- include/media/v4l2-subdev.h | 95 +++++++++++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 21 deletions(-)include/media/v4l2-subdev.h +74
-21@@ -1964,6 +1964,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 @@ -1982,22 +1998,13 @@ 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_state_try - call an operation of a v4l2_subdev which -* takes state as a parameter, passing the -* subdev a newly allocated try state. +* 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. @@ -2007,13 +2014,14 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers;* each element at &struct v4l2_subdev_ops. * @args: arguments for @f. * -* This is similar to v4l2_subdev_call_state_active(), except that as this -* version allocates a new state, this is only usable for -* V4L2_SUBDEV_FORMAT_TRY use cases. -* -* Note: only legacy non-MC drivers may need this macro. +* 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 set_fmt, get_selection and set_selection). */ -#define v4l2_subdev_call_state_try(sd, o, f, args...) \ +#define v4l2_subdev_call_ci_state_active(sd, o, f, args...) \ + __v4l2_subdev_call_state_active(v4l2_subdev_call, sd, o, f, ##args) + +#define __v4l2_subdev_call_state_try(call, sd, o, f, args...) \ ({ \ int __result; \ static struct lock_class_key __key; \@@ -2025,13 +2033,58 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; __result =PTR_ERR (state); \ } else { \v4l2_subdev_lock_state (state ); \ - __result = v4l2_subdev_call(sd, o, f, state, ##args); \ + __result = call(sd, o, f, NULL, state, ##args); \ v4l2_subdev_unlock_state(state); \ __v4l2_subdev_state_free(state); \ } \ __result; \ }) +/** +* v4l2_subdev_call_state_try - call an operation of a v4l2_subdev which +* takes state as a parameter, passing the +* subdev a newly allocated try 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 is similar to v4l2_subdev_call_state_active(), except that as this +* version allocates a new state, this is only usable for +* V4L2_SUBDEV_FORMAT_TRY use cases. +* +* Note: only legacy non-MC drivers may need this macro. +*/ +#define v4l2_subdev_call_state_try(sd, o, f, args...) \ + __v4l2_subdev_call_state_try(__v4l2_subdev_call_drop_fourth, sd, o, f, \ + ##args); + +/** +* v4l2_subdev_call_ci_state_try - call an operation of a v4l2_subdev which +* takes state as a parameter, passing the +* subdev a newly allocated try 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 is similar to v4l2_subdev_call_state_try(), with the exception +* that it passes NULL as the client info to sub-device ops that need it +* (currently pad ops set_fmt, get_selection and set_selection). +* +* Note: only legacy non-MC drivers may need this macro. +*/ +#define v4l2_subdev_call_ci_state_try(sd, o, f, args...) \ + __v4l2_subdev_call_state_try(v4l2_subdev_call, sd, o, f, ##args); +/** * v4l2_subdev_has_op - Checks if a subdev defines a certain operation. *
Laurent Pinchart
maintainerRe: [PATCH v7 11/14] media: v4l2-subdev: Add v4l2_subdev_call_ci_state_{active,try}
Quoted 13 lines · Hans Verkuil
Quoted 6 lines · Sakari Ailus
Add
v4l2_subdev_call_ci_state_active(), andv4l2_subdev_call_ci_state_try()to call sub-device pad ops that take structv4l2_subdev_client_infopointer as an argument. These ops cannot be called usingv4l2_subdev_call_state_active()orv4l2_subdev_call_state_try()as theclient_infoargument precedes the state argument.So if we have to jump through all these hoops just because the
client_infopointer precedes the state pointer in the pad op argument list, wouldn't it be better to swap the order? For example by moving theclient_infopointer as the last argument?
Quoted 5 lines
Honestly, these macros are getting really hard to follow, and I'm not sure it is worth it just to keep the
client_infobefore the state pointer. Yes, that's the logical order, but at the price of some very hard to read defines.Or am I missing something?
Those are exactly the points I raised in the review of v6 :-)
Quoted 141 lines
Quoted 141 lines
Signed-off-by Sakari Ailus <[email protected]>--- include/media/v4l2-subdev.h | 95 +++++++++++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 21 deletions(-)include/media/v4l2-subdev.h +74
-21@@ -1964,6 +1964,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 @@ -1982,22 +1998,13 @@ 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_state_try - call an operation of a v4l2_subdev which -* takes state as a parameter, passing the -* subdev a newly allocated try state. +* 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. @@ -2007,13 +2014,14 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers;* each element at &struct v4l2_subdev_ops. * @args: arguments for @f. * -* This is similar to v4l2_subdev_call_state_active(), except that as this -* version allocates a new state, this is only usable for -* V4L2_SUBDEV_FORMAT_TRY use cases. -* -* Note: only legacy non-MC drivers may need this macro. +* 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 set_fmt, get_selection and set_selection). */ -#define v4l2_subdev_call_state_try(sd, o, f, args...) \ +#define v4l2_subdev_call_ci_state_active(sd, o, f, args...) \ + __v4l2_subdev_call_state_active(v4l2_subdev_call, sd, o, f, ##args) + +#define __v4l2_subdev_call_state_try(call, sd, o, f, args...) \ ({ \ int __result; \ static struct lock_class_key __key; \@@ -2025,13 +2033,58 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; __result =PTR_ERR (state); \ } else { \v4l2_subdev_lock_state (state ); \ - __result = v4l2_subdev_call(sd, o, f, state, ##args); \ + __result = call(sd, o, f, NULL, state, ##args); \ v4l2_subdev_unlock_state(state); \ __v4l2_subdev_state_free(state); \ } \ __result; \ }) +/** +* v4l2_subdev_call_state_try - call an operation of a v4l2_subdev which +* takes state as a parameter, passing the +* subdev a newly allocated try 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 is similar to v4l2_subdev_call_state_active(), except that as this +* version allocates a new state, this is only usable for +* V4L2_SUBDEV_FORMAT_TRY use cases. +* +* Note: only legacy non-MC drivers may need this macro. +*/ +#define v4l2_subdev_call_state_try(sd, o, f, args...) \ + __v4l2_subdev_call_state_try(__v4l2_subdev_call_drop_fourth, sd, o, f, \ + ##args); + +/** +* v4l2_subdev_call_ci_state_try - call an operation of a v4l2_subdev which +* takes state as a parameter, passing the +* subdev a newly allocated try 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 is similar to v4l2_subdev_call_state_try(), with the exception +* that it passes NULL as the client info to sub-device ops that need it +* (currently pad ops set_fmt, get_selection and set_selection). +* +* Note: only legacy non-MC drivers may need this macro. +*/ +#define v4l2_subdev_call_ci_state_try(sd, o, f, args...) \ + __v4l2_subdev_call_state_try(v4l2_subdev_call, sd, o, f, ##args); +/** * v4l2_subdev_has_op - Checks if a subdev defines a certain operation. *
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH v7 11/14] media: v4l2-subdev: Add v4l2_subdev_call_ci_state_{active,try}
Hi Hans, Laurent,
Quoted 14 lines · Laurent Pinchart
Quoted 13 lines · Hans Verkuil
Quoted 6 lines · Sakari Ailus
Add
v4l2_subdev_call_ci_state_active(), andv4l2_subdev_call_ci_state_try()to call sub-device pad ops that take structv4l2_subdev_client_infopointer as an argument. These ops cannot be called usingv4l2_subdev_call_state_active()orv4l2_subdev_call_state_try()as theclient_infoargument precedes the state argument.So if we have to jump through all these hoops just because the
client_infopointer precedes the state pointer in the pad op argument list, wouldn't it be better to swap the order? For example by moving theclient_infopointer as the last argument?
Quoted 7 lines
Quoted 5 lines
Honestly, these macros are getting really hard to follow, and I'm not sure it is worth it just to keep the
client_infobefore the state pointer. Yes, that's the logical order, but at the price of some very hard to read defines.Or am I missing something?
Those are exactly the points I raised in the review of v6 :-)
And my answer then was that I prefer some additional complexity on the framework side -- where we have a single implementation of this -- over pushing less than ideal APIs to all the drivers.
To give some idea, we currently have about 200 drivers implementing the set_fmt() pad op. I also expect the number of pad ops where we need client info will grow over time, making this quite a bit more visible in the drivers than the scope (set_fmt, get_selection and set_selection) introduced in this set.
Signature · 3 lines
Kind regards, Sakari Ailus
Laurent Pinchart
maintainerRe: [PATCH v7 11/14] media: v4l2-subdev: Add v4l2_subdev_call_ci_state_{active,try}
Quoted 19 lines · Sakari Ailus
Quoted 18 lines · Laurent Pinchart
Quoted 17 lines · Hans Verkuil
Quoted 6 lines · Sakari Ailus
Add
v4l2_subdev_call_ci_state_active(), andv4l2_subdev_call_ci_state_try()to call sub-device pad ops that take structv4l2_subdev_client_infopointer as an argument. These ops cannot be called usingv4l2_subdev_call_state_active()orv4l2_subdev_call_state_try()as theclient_infoargument precedes the state argument.So if we have to jump through all these hoops just because the
client_infopointer precedes the state pointer in the pad op argument list, wouldn't it be better to swap the order? For example by moving theclient_infopointer as the last argument?Honestly, these macros are getting really hard to follow, and I'm not sure it is worth it just to keep the
client_infobefore the state pointer. Yes, that's the logical order, but at the price of some very hard to read defines.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Or am I missing something?
Those are exactly the points I raised in the review of v6 :-)
And my answer then was that I prefer some additional complexity on the framework side -- where we have a single implementation of this -- over pushing less than ideal APIs to all the drivers.
I'm not convinced, but I won't make that a blocker if it's only me.
Quoted 2 lines
To give some idea, we currently have about 200 drivers implementing the
set_fmt()pad op.
Does the order of arguments really matter for drivers implementing those operations ?
Quoted 4 lines
I also expect the number of pad ops where we need client info will grow over time, making this quite a bit more visible in the drivers than the scope (
set_fmt,get_selectionandset_selection) introduced in this set.
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH v7 11/14] media: v4l2-subdev: Add v4l2_subdev_call_ci_state_{active,try}
Quoted 28 lines · Laurent Pinchart
Quoted 19 lines · Sakari Ailus
Quoted 18 lines · Laurent Pinchart
Quoted 17 lines · Hans Verkuil
Quoted 6 lines · Sakari Ailus
Add
v4l2_subdev_call_ci_state_active(), andv4l2_subdev_call_ci_state_try()to call sub-device pad ops that take structv4l2_subdev_client_infopointer as an argument. These ops cannot be called usingv4l2_subdev_call_state_active()orv4l2_subdev_call_state_try()as theclient_infoargument precedes the state argument.So if we have to jump through all these hoops just because the
client_infopointer precedes the state pointer in the pad op argument list, wouldn't it be better to swap the order? For example by moving theclient_infopointer as the last argument?Honestly, these macros are getting really hard to follow, and I'm not sure it is worth it just to keep the
client_infobefore the state pointer. Yes, that's the logical order, but at the price of some very hard to read defines.Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Or am I missing something?
Those are exactly the points I raised in the review of v6 :-)
And my answer then was that I prefer some additional complexity on the framework side -- where we have a single implementation of this -- over pushing less than ideal APIs to all the drivers.
Quoted 7 lines
I'm not convinced, but I won't make that a blocker if it's only me.
Quoted 2 lines
To give some idea, we currently have about 200 drivers implementing the
set_fmt()pad op.Does the order of arguments really matter for drivers implementing those operations ?
Each driver will implement these ops and it'll just look wrong in each of them. The complication here is rather minor so my preference is to keep it. It's already implemented, too.
Signature · 1 line
Sakari Ailus
Re: [PATCH v7 11/14] media: v4l2-subdev: Add v4l2_subdev_call_ci_state_{active,try}
Quoted 34 lines · Sakari Ailus
Quoted 33 lines · Laurent Pinchart
Quoted 19 lines · Sakari Ailus
Quoted 18 lines · Laurent Pinchart
Quoted 17 lines · Hans Verkuil
Quoted 6 lines · Sakari Ailus
Add
v4l2_subdev_call_ci_state_active(), andv4l2_subdev_call_ci_state_try()to call sub-device pad ops that take structv4l2_subdev_client_infopointer as an argument. These ops cannot be called usingv4l2_subdev_call_state_active()orv4l2_subdev_call_state_try()as theclient_infoargument precedes the state argument.So if we have to jump through all these hoops just because the
client_infopointer precedes the state pointer in the pad op argument list, wouldn't it be better to swap the order? For example by moving theclient_infopointer as the last argument?Honestly, these macros are getting really hard to follow, and I'm not sure it is worth it just to keep the
client_infobefore the state pointer. Yes, that's the logical order, but at the price of some very hard to read defines.Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Or am I missing something?
Those are exactly the points I raised in the review of v6 :-)
And my answer then was that I prefer some additional complexity on the framework side -- where we have a single implementation of this -- over pushing less than ideal APIs to all the drivers.
I'm not convinced, but I won't make that a blocker if it's only me.
Quoted 2 lines
To give some idea, we currently have about 200 drivers implementing the
set_fmt()pad op.
Quoted 7 lines
Quoted 2 lines
Does the order of arguments really matter for drivers implementing those operations ?
Each driver will implement these ops and it'll just look wrong in each of them. The complication here is rather minor so my preference is to keep it. It's already implemented, too.
I agree with Laurent. I don't think the set_fmt pad op will be any less readable if the client_info comes at the end. But if you want to follow what e.g. the v4l2_subdev_call_ci_state_try macro does with this patch in place, then that is an instant headache.
Regards,
Hans
Sakari Ailus
maintainerPATCH v7 12/14 media: mt9m001: Pass sub-device state to set_selection() callback
In reply to Sakari AilusWhen the set_selection() pad operation is called from mt9m001_s_fmt(), it receives a NULL pointer for the state argument. As the function does not use the state this does not cause any issue in practice, but it could cause NULL pointer dereferences if the mt9m001_set_selection() implementation is modified. Avoid future issues by passing the subdev state.
--- drivers/media/i2c/mt9m001.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/i2c/mt9m001.c +3 -2
@@ -343,6 +343,7 @@ static int mt9m001_get_fmt(struct v4l2_subdev *sd, }static int mt9m001_s_fmt (struct v4l2_subdev *sd, +struct v4l2_subdev_state *state,const struct mt9m001_datafmt *fmt,struct v4l2_mbus_framefmt *mf) {
@@ -359,7 +360,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, state, &sel);if (!ret) { mf->width = mt9m001->rect.width; mf->height = mt9m001->rect.height;
@@ -404,7 +405,7 @@ static int mt9m001_set_fmt(struct v4l2_subdev *sd, mf->xfer_func =V4L2_XFER_FUNC_DEFAULT ;if (format->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) -return mt9m001_s_fmt (sd, fmt, mf); +return mt9m001_s_fmt (sd, sd_state, fmt, mf); *v4l2_subdev_state_get_format (sd_state,0 ) = *mf;return 0 ; }
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v7 13/14 media: cvs: Drop comments on sub-device operations
In reply to Sakari AilusThe sub-device operations are well documented in the V4L2 sub-device framework already. Drop them from the CVS driver.
--- drivers/media/i2c/cvs/v4l2.c | 82 ------------------------------------ 1 file changed, 82 deletions(-)
drivers/media/i2c/cvs/v4l2.c +0 -82
@@ -71,19 +71,6 @@ static int csi_set_link_cfg(struct icvs *ctx, u64 link_freq)* Streaming */ -/** -* cvs_csi_enable_streams - Start streaming through the bridge -* @sd: Sub-device pointer -* @state: Active state -* @pad: Pad identifier (must be ICVS_CSI_PAD_SOURCE) -* @streams_mask: Streams to enable (bit 0 supported) -* -* Runtime-resumes the bridge (triggering cvs_runtime_resume() to claim CSI-2 -* link ownership), fetches the link frequency, programs the MIPI configuration, -* and forwards the enable request downstream. -* -* Return: 0 on success or negative errno. -*/ static int cvs_csi_enable_streams (struct v4l2_subdev *sd,struct v4l2_subdev_state *state,u32 pad,u64 streams_mask)
@@ -129,19 +116,6 @@ static int cvs_csi_enable_streams(struct v4l2_subdev *sd,return ret; } -/** -* cvs_csi_disable_streams - Stop streaming through the bridge -* @sd: Sub-device pointer -* @state: Active state -* @pad: Pad identifier (must be ICVS_CSI_PAD_SOURCE) -* @streams_mask: Streams to disable (bit 0 supported) -* -* Disables the remote sensor stream then drops the PM reference acquired -* during enable. After the autosuspend delay, cvs_runtime_suspend() will -* return CSI-2 link ownership to CVS firmware. -* -* Return: 0 on success or negative errno. -*/ static int cvs_csi_disable_streams (struct v4l2_subdev *sd,struct v4l2_subdev_state *state,u32 pad,u64 streams_mask)
@@ -167,15 +141,6 @@ static int cvs_csi_disable_streams(struct v4l2_subdev *sd,/* * Pad operations / formats */ -/** -* cvs_csi_init_state - Initialize pad formats in subdev state -* @sd: Sub-device -* @state: State container -* -* Sets all pad formats to a minimal 1x1 default. -* -* Return: 0. -*/ static int cvs_csi_init_state (struct v4l2_subdev *sd,struct v4l2_subdev_state *state) {
@@ -186,17 +151,6 @@ static int cvs_csi_init_state(struct v4l2_subdev *sd,return 0 ; } -/** -* cvs_csi_set_fmt - Negotiate pad format -* @sd: Sub-device -* @state: State -* @format: Desired / returned format -* -* Mirrors sink format onto source pad. Accepts many media bus codes, falling -* back to Y8 if unsupported. Normalizes field setting. -* -* Return: 0. -*/ static int cvs_csi_set_fmt (struct v4l2_subdev *sd,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format)
@@ -319,17 +273,6 @@ static int cvs_csi_set_fmt(struct v4l2_subdev *sd,return 0 ; } -/** -* cvs_csi_get_mbus_config - Provide current CSI-2 bus configuration -* @sd: Sub-device -* @pad: Pad index -* @cfg: Returned bus config -* -* Fills lane ordering and number of lanes; retrieves link frequency from -* remote entity. -* -* Return: 0 on success or negative errno. -*/ static int cvs_csi_get_mbus_config (struct v4l2_subdev *sd,unsigned int pad,struct v4l2_mbus_config *cfg) {
@@ -384,17 +327,6 @@ static const struct media_entity_operations cvs_csi_entity_ops = {/* * Async notifier */ -/** -* cvs_csi_notify_bound - Remote sensor bound callback -* @notifier: Async notifier -* @sd: Remote subdev -* @asc: Async match connection -* -* Locates the source pad of the remote sensor and creates a media link to -* the CVS bridge sink pad enabling it by default. -* -* Return: 0 on success or negative errno. -*/ static int cvs_csi_notify_bound (struct v4l2_async_notifier *notifier,struct v4l2_subdev *sd,struct v4l2_async_connection *asc)
@@ -414,12 +346,6 @@ static int cvs_csi_notify_bound(struct v4l2_async_notifier *notifier, MEDIA_LNK_FL_IMMUTABLE); } -/** -* cvs_csi_notify_unbind - Remote sensor unbind callback -* @notifier: Notifier -* @sd: Remote subdev -* @asc: Connection -*/ static void cvs_csi_notify_unbind (struct v4l2_async_notifier *notifier,struct v4l2_subdev *sd,struct v4l2_async_connection *asc)
@@ -437,14 +363,6 @@ static const struct v4l2_async_notifier_operations cvs_csi_notify_ops = {/* * Controls */ -/** -* cvs_csi_init_controls - Initialize V4L2 controls -* @ctx: CVS context -* -* Currently sets up a read-only privacy control placeholder. -* -* Return: 0 on success or negative errno. -*/ static int cvs_csi_init_controls (struct icvs *ctx) {struct v4l2_ctrl *privacy_ctrl;
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v7 14/14 media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops
In reply to Sakari AilusAdd 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.
--- drivers/media/i2c/adv7170.c | 1 + drivers/media/i2c/adv7175.c | 1 + drivers/media/i2c/adv7180.c | 3 +- drivers/media/i2c/adv7183.c | 3 +- drivers/media/i2c/adv748x/adv748x-afe.c | 1 + drivers/media/i2c/adv748x/adv748x-csi2.c | 1 + drivers/media/i2c/adv748x/adv748x-hdmi.c | 1 + drivers/media/i2c/adv7511-v4l2.c | 1 + drivers/media/i2c/adv7604.c | 2 + drivers/media/i2c/adv7842.c | 1 + drivers/media/i2c/ak881x.c | 1 + drivers/media/i2c/alvium-csi2.c | 3 + drivers/media/i2c/ar0521.c | 1 + drivers/media/i2c/ccs/ccs-core.c | 12 +++- drivers/media/i2c/cvs/v4l2.c | 1 + drivers/media/i2c/cx25840/cx25840-core.c | 1 + drivers/media/i2c/ds90ub913.c | 1 + drivers/media/i2c/ds90ub953.c | 1 + drivers/media/i2c/ds90ub960.c | 1 + drivers/media/i2c/et8ek8/et8ek8_driver.c | 1 + 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 | 2 + drivers/media/i2c/hi846.c | 2 + drivers/media/i2c/hi847.c | 1 + drivers/media/i2c/imx111.c | 1 + drivers/media/i2c/imx208.c | 1 + drivers/media/i2c/imx214.c | 4 +- drivers/media/i2c/imx219.c | 4 +- drivers/media/i2c/imx258.c | 2 + drivers/media/i2c/imx274.c | 3 + drivers/media/i2c/imx283.c | 2 + drivers/media/i2c/imx290.c | 4 +- drivers/media/i2c/imx296.c | 7 ++- drivers/media/i2c/imx319.c | 1 + drivers/media/i2c/imx334.c | 3 +- drivers/media/i2c/imx335.c | 4 +- drivers/media/i2c/imx355.c | 4 +- drivers/media/i2c/imx412.c | 3 +- drivers/media/i2c/imx415.c | 4 +- drivers/media/i2c/imx471.c | 4 +- drivers/media/i2c/imx678.c | 2 +- drivers/media/i2c/isl7998x.c | 1 + drivers/media/i2c/lt6911uxe.c | 5 +- drivers/media/i2c/max9286.c | 1 + drivers/media/i2c/max96714.c | 1 + drivers/media/i2c/max96717.c | 1 + drivers/media/i2c/ml86v7667.c | 1 - drivers/media/i2c/mt9m001.c | 8 ++- drivers/media/i2c/mt9m111.c | 3 + drivers/media/i2c/mt9m114.c | 6 ++ drivers/media/i2c/mt9p031.c | 3 + drivers/media/i2c/mt9t112.c | 3 + drivers/media/i2c/mt9v011.c | 1 + drivers/media/i2c/mt9v032.c | 3 + drivers/media/i2c/mt9v111.c | 1 + 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 | 3 +- drivers/media/i2c/ov02c10.c | 1 + drivers/media/i2c/ov02e10.c | 1 + drivers/media/i2c/ov08d10.c | 1 + drivers/media/i2c/ov08x40.c | 1 + drivers/media/i2c/ov13858.c | 1 + drivers/media/i2c/ov13b10.c | 1 + drivers/media/i2c/ov2640.c | 2 + drivers/media/i2c/ov2659.c | 1 + drivers/media/i2c/ov2680.c | 3 + drivers/media/i2c/ov2685.c | 2 + 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 | 2 + drivers/media/i2c/ov5645.c | 4 +- drivers/media/i2c/ov5647.c | 2 + drivers/media/i2c/ov5648.c | 1 + drivers/media/i2c/ov5670.c | 2 + drivers/media/i2c/ov5675.c | 2 + drivers/media/i2c/ov5693.c | 3 + drivers/media/i2c/ov5695.c | 1 + drivers/media/i2c/ov6211.c | 3 +- drivers/media/i2c/ov64a40.c | 2 + drivers/media/i2c/ov7251.c | 4 +- drivers/media/i2c/ov7670.c | 1 + drivers/media/i2c/ov772x.c | 2 + drivers/media/i2c/ov7740.c | 1 + drivers/media/i2c/ov8856.c | 1 + drivers/media/i2c/ov8858.c | 3 +- drivers/media/i2c/ov8865.c | 2 + drivers/media/i2c/ov9282.c | 4 +- drivers/media/i2c/ov9640.c | 2 + drivers/media/i2c/ov9650.c | 1 + drivers/media/i2c/ov9734.c | 1 + drivers/media/i2c/rj54n1cb0c.c | 3 + drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 + drivers/media/i2c/s5k3m5.c | 4 +- drivers/media/i2c/s5k5baf.c | 3 + drivers/media/i2c/s5k6a3.c | 1 + drivers/media/i2c/s5kjn1.c | 4 +- drivers/media/i2c/saa6752hs.c | 1 + 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 | 1 + drivers/media/i2c/tc358746.c | 1 + drivers/media/i2c/tda1997x.c | 1 + drivers/media/i2c/thp7312.c | 1 + drivers/media/i2c/tvp514x.c | 1 + drivers/media/i2c/tvp5150.c | 2 + drivers/media/i2c/tvp7002.c | 1 + drivers/media/i2c/tw9900.c | 1 + drivers/media/i2c/tw9910.c | 2 + drivers/media/i2c/vd55g1.c | 4 +- drivers/media/i2c/vd56g3.c | 4 +- drivers/media/i2c/vgxy61.c | 4 +- drivers/media/pci/cobalt/cobalt-driver.c | 8 +-- drivers/media/pci/cobalt/cobalt-v4l2.c | 10 ++-- 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 | 1 + drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 2 + .../media/pci/intel/ipu6/ipu6-isys-subdev.c | 1 + .../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 | 4 +- drivers/media/platform/amd/isp4/isp4_subdev.c | 1 + drivers/media/platform/amd/isp4/isp4_video.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 | 1 + .../amlogic/c3/mipi-csi2/c3-mipi-csi2.c | 1 + .../platform/arm/mali-c55/mali-c55-isp.c | 3 + .../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 | 1 + drivers/media/platform/cadence/cdns-csi2rx.c | 1 + drivers/media/platform/cadence/cdns-csi2tx.c | 1 + drivers/media/platform/intel/pxa_camera.c | 6 +- drivers/media/platform/marvell/mcam-core.c | 4 +- .../platform/microchip/microchip-csi2dc.c | 1 + .../platform/microchip/microchip-isc-scaler.c | 2 + drivers/media/platform/nxp/imx-mipi-csis.c | 3 +- drivers/media/platform/nxp/imx7-media-csi.c | 1 + .../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 1 + .../platform/nxp/imx8-isi/imx8-isi-pipe.c | 3 + drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 1 + .../media/platform/qcom/camss/camss-csid.c | 3 +- .../media/platform/qcom/camss/camss-csiphy.c | 3 +- .../media/platform/qcom/camss/camss-ispif.c | 3 +- drivers/media/platform/qcom/camss/camss-tpg.c | 3 +- drivers/media/platform/qcom/camss/camss-vfe.c | 12 ++-- .../media/platform/raspberrypi/rp1-cfe/csi2.c | 1 + .../platform/raspberrypi/rp1-cfe/pisp-fe.c | 1 + drivers/media/platform/renesas/rcar-csi2.c | 1 + .../media/platform/renesas/rcar-isp/csisp.c | 1 + drivers/media/platform/renesas/renesas-ceu.c | 7 ++- .../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 3 +- .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 3 +- .../renesas/rzv2h-ivc/rzv2h-ivc-subdev.c | 1 + drivers/media/platform/renesas/sh_vou.c | 6 +- .../media/platform/renesas/vsp1/vsp1_brx.c | 3 + .../media/platform/renesas/vsp1/vsp1_drm.c | 18 +++--- .../media/platform/renesas/vsp1/vsp1_entity.c | 4 +- .../media/platform/renesas/vsp1/vsp1_entity.h | 1 + .../media/platform/renesas/vsp1/vsp1_histo.c | 3 + .../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_uif.c | 2 + .../media/platform/renesas/vsp1/vsp1_vspx.c | 3 +- .../platform/rockchip/rkcif/rkcif-interface.c | 3 + .../platform/rockchip/rkisp1/rkisp1-csi.c | 1 + .../platform/rockchip/rkisp1/rkisp1-isp.c | 3 + .../platform/rockchip/rkisp1/rkisp1-resizer.c | 3 + .../samsung/exynos4-is/fimc-capture.c | 8 ++- .../platform/samsung/exynos4-is/fimc-isp.c | 1 + .../platform/samsung/exynos4-is/fimc-lite.c | 3 + .../platform/samsung/exynos4-is/mipi-csis.c | 1 + .../samsung/s3c-camif/camif-capture.c | 3 + .../platform/samsung/s3c-camif/camif-core.c | 2 +- drivers/media/platform/st/stm32/stm32-csi.c | 1 + drivers/media/platform/st/stm32/stm32-dcmi.c | 10 ++-- .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 3 + .../st/stm32/stm32-dcmipp/dcmipp-input.c | 1 + .../platform/sunxi/sun4i-csi/sun4i_v4l2.c | 1 + .../sunxi/sun6i-csi/sun6i_csi_bridge.c | 1 + .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 1 + .../sun8i_a83t_mipi_csi2.c | 1 + .../media/platform/synopsys/dw-mipi-csi2rx.c | 1 + .../media/platform/ti/am437x/am437x-vpfe.c | 2 +- drivers/media/platform/ti/cal/cal-camerarx.c | 1 + drivers/media/platform/ti/cal/cal-video.c | 4 +- .../platform/ti/j721e-csi2rx/j721e-csi2rx.c | 1 + drivers/media/platform/ti/omap3isp/ispccdc.c | 5 +- drivers/media/platform/ti/omap3isp/ispccp2.c | 3 +- drivers/media/platform/ti/omap3isp/ispcsi2.c | 3 +- .../media/platform/ti/omap3isp/isppreview.c | 5 +- .../media/platform/ti/omap3isp/ispresizer.c | 5 +- drivers/media/platform/ti/omap3isp/ispvideo.c | 4 +- drivers/media/platform/ti/vpe/vip.c | 4 +- drivers/media/platform/via/via-camera.c | 4 +- drivers/media/platform/video-mux.c | 1 + .../media/platform/xilinx/xilinx-csi2rxss.c | 1 + drivers/media/platform/xilinx/xilinx-tpg.c | 1 + .../media/test-drivers/vimc/vimc-debayer.c | 1 + 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 | 58 ++++++++++++++----- .../media/atomisp/i2c/atomisp-gc2235.c | 1 + .../media/atomisp/i2c/atomisp-ov2722.c | 1 + .../staging/media/atomisp/pci/atomisp_cmd.c | 16 +++-- .../staging/media/atomisp/pci/atomisp_csi2.c | 1 + .../media/atomisp/pci/atomisp_subdev.c | 3 + .../staging/media/atomisp/pci/atomisp_v4l2.c | 8 +-- drivers/staging/media/imx/imx-ic-prp.c | 1 + drivers/staging/media/imx/imx-ic-prpencvf.c | 1 + drivers/staging/media/imx/imx-media-csi.c | 3 + drivers/staging/media/imx/imx-media-vdic.c | 1 + drivers/staging/media/imx/imx6-mipi-csi2.c | 1 + drivers/staging/media/ipu3/ipu3-v4l2.c | 3 + drivers/staging/media/ipu7/ipu7-isys-csi2.c | 2 + drivers/staging/media/ipu7/ipu7-isys-subdev.c | 1 + drivers/staging/media/ipu7/ipu7-isys-subdev.h | 1 + .../media/sunxi/sun6i-isp/sun6i_isp_proc.c | 1 + drivers/staging/media/tegra-video/csi.c | 1 + drivers/staging/media/tegra-video/vi.c | 10 ++-- include/media/v4l2-subdev.h | 8 ++- 247 files changed, 547 insertions(+), 153 deletions(-)
drivers/media/i2c/adv7170.c +1 -0
@@ -284,6 +284,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) {
drivers/media/i2c/adv7175.c +1 -0
@@ -322,6 +322,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) {
drivers/media/i2c/adv7180.c +2 -1
@@ -771,6 +771,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 +809,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,
drivers/media/i2c/adv7183.c +2 -1
@@ -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) {
@@ -598,7 +599,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);
drivers/media/i2c/adv748x/adv748x-afe.c +1 -0
@@ -349,6 +349,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) {
drivers/media/i2c/adv748x/adv748x-csi2.c +1 -0
@@ -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) {
drivers/media/i2c/adv748x/adv748x-hdmi.c +1 -0
@@ -440,6 +440,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) {
drivers/media/i2c/adv7511-v4l2.c +1 -0
@@ -1273,6 +1273,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) {
drivers/media/i2c/adv7604.c +2 -0
@@ -1943,6 +1943,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 +1964,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) {
drivers/media/i2c/adv7842.c +1 -0
@@ -2110,6 +2110,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) {
drivers/media/i2c/ak881x.c +1 -0
@@ -122,6 +122,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) {
drivers/media/i2c/alvium-csi2.c +3 -0
@@ -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) {
drivers/media/i2c/ar0521.c +1 -0
@@ -457,6 +457,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) {
drivers/media/i2c/ccs/ccs-core.c +9 -3
@@ -2189,6 +2189,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) {
@@ -2242,6 +2243,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 +2254,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, ci, sd_state, fmt);return rval; }
@@ -2467,6 +2469,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 +2539,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 +2591,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 +2638,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 +2661,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, ci, sd_state, sel);break ;case V4L2_SEL_TGT_COMPOSE : - ret =ccs_set_compose (subdev, sd_state, sel); + ret =ccs_set_compose (subdev, ci, sd_state, sel);break ;default : ret = -EINVAL ;
drivers/media/i2c/cvs/v4l2.c +1 -0
@@ -152,6 +152,7 @@ static int cvs_csi_init_state(struct v4l2_subdev *sd, }static int cvs_csi_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
drivers/media/i2c/cx25840/cx25840-core.c +1 -0
@@ -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) {
drivers/media/i2c/ds90ub913.c +1 -0
@@ -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) {
drivers/media/i2c/ds90ub953.c +1 -0
@@ -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) {
drivers/media/i2c/ds90ub960.c +1 -0
@@ -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) {
drivers/media/i2c/et8ek8/et8ek8_driver.c +1 -0
@@ -1013,6 +1013,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) {
drivers/media/i2c/gc0308.c +1 -0
@@ -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) {
drivers/media/i2c/gc0310.c +1 -0
@@ -365,6 +365,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) {
drivers/media/i2c/gc05a2.c +3 -1
@@ -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 ; }
drivers/media/i2c/gc08a3.c +3 -1
@@ -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 ; }
drivers/media/i2c/gc2145.c +2 -0
@@ -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) {
drivers/media/i2c/hi556.c +2 -0
@@ -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) {
drivers/media/i2c/hi846.c +2 -0
@@ -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) {
@@ -1840,6 +1841,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) {
drivers/media/i2c/hi847.c +1 -0
@@ -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) {
drivers/media/i2c/imx111.c +1 -0
@@ -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) {
drivers/media/i2c/imx208.c +1 -0
@@ -574,6 +574,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) {
drivers/media/i2c/imx214.c +3 -1
@@ -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 ; }
drivers/media/i2c/imx219.c +3 -1
@@ -846,6 +846,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) {
@@ -959,6 +960,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) {
@@ -1001,7 +1003,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 = {
drivers/media/i2c/imx258.c +2 -0
@@ -913,6 +913,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 +989,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) {
drivers/media/i2c/imx274.c +3 -0
@@ -1059,6 +1059,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) {
@@ -1092,6 +1093,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) {
@@ -1208,6 +1210,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) {
drivers/media/i2c/imx283.c +2 -0
@@ -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) {
drivers/media/i2c/imx290.c +3 -1
@@ -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 ; }
drivers/media/i2c/imx296.c +5 -2
@@ -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 ; }
drivers/media/i2c/imx319.c +1 -0
@@ -2030,6 +2030,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) {
drivers/media/i2c/imx334.c +2 -1
@@ -741,6 +741,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 +787,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)
drivers/media/i2c/imx335.c +3 -1
@@ -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) {
drivers/media/i2c/imx355.c +3 -1
@@ -714,6 +714,7 @@ static void imx355_update_pad_format(struct imx355 *imx355,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) {
@@ -765,6 +766,7 @@ imx355_set_pad_format(struct v4l2_subdev *sd, }static int imx355_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -796,7 +798,7 @@ static int imx355_entity_init_state(struct v4l2_subdev *subdev, fmt.format.width = supported_modes[0 ].width; fmt.format.height = supported_modes[0 ].height; -imx355_set_pad_format (subdev, sd_state, &fmt); +imx355_set_pad_format (subdev,NULL , sd_state, &fmt);return 0 ; }
drivers/media/i2c/imx412.c +2 -1
@@ -588,6 +588,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) {
@@ -621,7 +622,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); }/**
drivers/media/i2c/imx415.c +3 -1
@@ -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 ; }
drivers/media/i2c/imx471.c +3 -1
@@ -416,6 +416,7 @@ static void imx471_update_pad_format(struct imx471 *sensor, }static int imx471_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) {
@@ -455,6 +456,7 @@ static int imx471_set_pad_format(struct v4l2_subdev *sd, }static int imx471_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -494,7 +496,7 @@ static int imx471_init_state(struct v4l2_subdev *sd, }, }; -return imx471_set_pad_format (sd, sd_state, &fmt); +return imx471_set_pad_format (sd,NULL , sd_state, &fmt); }static int imx471_identify_module (struct imx471 *sensor)
drivers/media/i2c/imx678.c +1 -1
@@ -849,6 +849,7 @@ static int imx678_enum_frame_size(struct v4l2_subdev *sd, }static int imx678_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -1130,7 +1131,6 @@ static const struct v4l2_subdev_video_ops imx678_video_ops = {static const struct v4l2_subdev_pad_ops imx678_pad_ops = { .enum_mbus_code = imx678_enum_mbus_code, .get_fmt = v4l2_subdev_get_fmt, - .set_fmt = v4l2_subdev_get_fmt, .get_selection = imx678_get_selection, .enum_frame_size = imx678_enum_frame_size, .enable_streams = imx678_enable_streams,
drivers/media/i2c/isl7998x.c +1 -0
@@ -1027,6 +1027,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) {
drivers/media/i2c/lt6911uxe.c +3 -2
@@ -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 ;
drivers/media/i2c/max9286.c +1 -0
@@ -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) {
drivers/media/i2c/max96714.c +1 -0
@@ -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) {
drivers/media/i2c/max96717.c +1 -0
@@ -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) {
drivers/media/i2c/ml86v7667.c +0 -1
@@ -298,7 +298,6 @@ static const struct v4l2_subdev_video_ops ml86v7667_subdev_video_ops = {static const struct v4l2_subdev_pad_ops ml86v7667_subdev_pad_ops = { .enum_mbus_code = ml86v7667_enum_mbus_code, .get_fmt = ml86v7667_fill_fmt, - .set_fmt = ml86v7667_fill_fmt, .get_mbus_config = ml86v7667_get_mbus_config, };
drivers/media/i2c/mt9m001.c +6 -2
@@ -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) {
@@ -343,6 +345,7 @@ static int mt9m001_get_fmt(struct v4l2_subdev *sd, }static int mt9m001_s_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,const struct mt9m001_datafmt *fmt,struct v4l2_mbus_framefmt *mf)
@@ -360,7 +363,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, state, &sel); + ret =mt9m001_set_selection (sd, ci, state, &sel);if (!ret) { mf->width = mt9m001->rect.width; mf->height = mt9m001->rect.height;
@@ -372,6 +375,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) {
@@ -405,7 +409,7 @@ static int mt9m001_set_fmt(struct v4l2_subdev *sd, mf->xfer_func =V4L2_XFER_FUNC_DEFAULT ;if (format->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) -return mt9m001_s_fmt (sd, sd_state, fmt, mf); +return mt9m001_s_fmt (sd, ci, sd_state, fmt, mf); *v4l2_subdev_state_get_format (sd_state,0 ) = *mf;return 0 ; }
drivers/media/i2c/mt9m111.c +3 -0
@@ -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) {
@@ -617,6 +619,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) {
drivers/media/i2c/mt9m114.c +6 -0
@@ -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) {
drivers/media/i2c/mt9p031.c +3 -0
@@ -581,6 +581,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) {
@@ -619,6 +620,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) {
@@ -643,6 +645,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) {
drivers/media/i2c/mt9t112.c +3 -0
@@ -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) {
@@ -953,6 +955,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) {
drivers/media/i2c/mt9v011.c +1 -0
@@ -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) {
drivers/media/i2c/mt9v032.c +3 -0
@@ -503,6 +503,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 +548,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 +563,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) {
drivers/media/i2c/mt9v111.c +1 -0
@@ -886,6 +886,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) {
drivers/media/i2c/og01a1b.c +2 -1
@@ -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) {
@@ -763,7 +764,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 ; }
drivers/media/i2c/og0ve1b.c +2 -1
@@ -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 ; }
drivers/media/i2c/os05b10.c +2 -0
@@ -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) {
drivers/media/i2c/ov01a10.c +3 -0
@@ -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) {
drivers/media/i2c/ov02a10.c +2 -1
@@ -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) {
@@ -523,7 +524,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 ; }
drivers/media/i2c/ov02c10.c +1 -0
@@ -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) {
drivers/media/i2c/ov02e10.c +1 -0
@@ -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) {
drivers/media/i2c/ov08d10.c +1 -0
@@ -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) {
drivers/media/i2c/ov08x40.c +1 -0
@@ -1844,6 +1844,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) {
drivers/media/i2c/ov13858.c +1 -0
@@ -1345,6 +1345,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) {
drivers/media/i2c/ov13b10.c +1 -0
@@ -1118,6 +1118,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) {
drivers/media/i2c/ov2640.c +2 -0
@@ -938,6 +938,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 +1029,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) {
drivers/media/i2c/ov2659.c +1 -0
@@ -1080,6 +1080,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) {
drivers/media/i2c/ov2680.c +3 -0
@@ -640,6 +640,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 +705,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 +736,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) {
drivers/media/i2c/ov2685.c +2 -0
@@ -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) {
@@ -413,6 +414,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) {
drivers/media/i2c/ov2732.c +3 -1
@@ -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 = {
drivers/media/i2c/ov2735.c +3 -1
@@ -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 ; }
drivers/media/i2c/ov2740.c +1 -0
@@ -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) {
drivers/media/i2c/ov4689.c +2 -0
@@ -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) {
drivers/media/i2c/ov5640.c +2 -0
@@ -2948,6 +2948,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 +2995,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) {
drivers/media/i2c/ov5645.c +3 -1
@@ -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) {
drivers/media/i2c/ov5647.c +2 -0
@@ -787,6 +787,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 +838,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) {
drivers/media/i2c/ov5648.c +1 -0
@@ -2215,6 +2215,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) {
drivers/media/i2c/ov5670.c +2 -0
@@ -2286,6 +2286,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 +2555,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) {
drivers/media/i2c/ov5675.c +2 -0
@@ -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) {
@@ -1075,6 +1076,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) {
drivers/media/i2c/ov5693.c +3 -0
@@ -807,6 +807,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 +883,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 +917,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) {
drivers/media/i2c/ov5695.c +1 -0
@@ -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) {
drivers/media/i2c/ov6211.c +2 -1
@@ -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 ; }
drivers/media/i2c/ov64a40.c +2 -0
@@ -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) {
drivers/media/i2c/ov7251.c +3 -1
@@ -1214,6 +1214,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 +1297,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) {
drivers/media/i2c/ov7670.c +1 -0
@@ -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) {
drivers/media/i2c/ov772x.c +2 -0
@@ -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) {
@@ -1212,6 +1213,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) {
drivers/media/i2c/ov7740.c +1 -0
@@ -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) {
drivers/media/i2c/ov8856.c +1 -0
@@ -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) {
drivers/media/i2c/ov8858.c +2 -1
@@ -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 ; }
drivers/media/i2c/ov8865.c +2 -0
@@ -2703,6 +2703,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) {
@@ -2811,6 +2812,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) {
drivers/media/i2c/ov9282.c +3 -1
@@ -780,6 +780,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 +827,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 +846,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) {
drivers/media/i2c/ov9640.c +2 -0
@@ -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) {
drivers/media/i2c/ov9650.c +1 -0
@@ -1226,6 +1226,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) {
drivers/media/i2c/ov9734.c +1 -0
@@ -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) {
drivers/media/i2c/rj54n1cb0c.c +3 -0
@@ -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) {
@@ -973,6 +975,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) {
drivers/media/i2c/s5c73m3/s5c73m3-core.c +2 -0
@@ -1069,6 +1069,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 +1109,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) {
drivers/media/i2c/s5k3m5.c +3 -1
@@ -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 ; }
drivers/media/i2c/s5k5baf.c +3 -0
@@ -1307,6 +1307,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 +1371,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) {
@@ -1463,6 +1465,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) {
drivers/media/i2c/s5k6a3.c +1 -0
@@ -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) {
drivers/media/i2c/s5kjn1.c +3 -1
@@ -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 ; }
drivers/media/i2c/saa6752hs.c +1 -0
@@ -563,6 +563,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) {
drivers/media/i2c/saa7115.c +1 -0
@@ -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) {
drivers/media/i2c/saa717x.c +1 -0
@@ -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) {
drivers/media/i2c/st-mipid02.c +1 -0
@@ -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) {
drivers/media/i2c/t4ka3.c +3 -0
@@ -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) {
drivers/media/i2c/tc358743.c +1 -0
@@ -1816,6 +1816,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) {
drivers/media/i2c/tc358746.c +1 -0
@@ -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) {
drivers/media/i2c/tda1997x.c +1 -0
@@ -1798,6 +1798,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) {
drivers/media/i2c/thp7312.c +1 -0
@@ -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) {
drivers/media/i2c/tvp514x.c +1 -0
@@ -880,6 +880,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) {
drivers/media/i2c/tvp5150.c +2 -0
@@ -1104,6 +1104,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 +1157,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) {
drivers/media/i2c/tvp7002.c +1 -0
@@ -854,6 +854,7 @@ 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) {
drivers/media/i2c/tw9900.c +1 -0
@@ -198,6 +198,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) {
drivers/media/i2c/tw9910.c +2 -0
@@ -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) {
@@ -792,6 +793,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) {
drivers/media/i2c/vd55g1.c +3 -1
@@ -1255,6 +1255,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) {
@@ -1332,6 +1333,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) {
@@ -1402,7 +1404,7 @@ static int vd55g1_init_state(struct v4l2_subdev *sd, fmt.format.width = vd55g1_supported_modes[VD55G1_MODE_IDX_DEF ].width; fmt.format.height = vd55g1_supported_modes[VD55G1_MODE_IDX_DEF ].height; -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,
drivers/media/i2c/vd56g3.c +3 -1
@@ -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 = {
drivers/media/i2c/vgxy61.c +3 -1
@@ -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) {
@@ -1197,6 +1198,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 +1262,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)
drivers/media/pci/cobalt/cobalt-driver.c +4 -4
@@ -524,8 +524,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 */
@@ -608,8 +608,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;
drivers/media/pci/cobalt/cobalt-v4l2.c +5 -5
@@ -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 ; }
@@ -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 ; }
drivers/media/pci/cx18/cx18-av-core.c +1 -0
@@ -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) {
drivers/media/pci/cx18/cx18-controls.c +1 -1
@@ -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 ; }
drivers/media/pci/cx18/cx18-ioctl.c +1 -1
@@ -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); }
drivers/media/pci/cx23885/cx23885-video.c +2 -2
@@ -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;
drivers/media/pci/intel/ipu3/ipu3-cio2.c +1 -0
@@ -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) {
drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c +2 -0
@@ -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) {
drivers/media/pci/intel/ipu6/ipu6-isys-subdev.c +1 -0
@@ -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) {
drivers/media/pci/intel/ipu6/ipu6-isys-subdev.h +1 -0
@@ -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,
drivers/media/pci/intel/ivsc/mei_csi.c +1 -0
@@ -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) {
drivers/media/pci/ivtv/ivtv-controls.c +1 -1
@@ -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 ; }
drivers/media/pci/ivtv/ivtv-ioctl.c +1 -1
@@ -587,7 +587,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); }
drivers/media/pci/saa7134/saa7134-empress.c +2 -2
@@ -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 ;
drivers/media/platform/amd/isp4/isp4_subdev.c +1 -0
@@ -890,6 +890,7 @@ static const struct v4l2_subdev_video_ops isp4sd_video_ops = { };static int isp4sd_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) {
drivers/media/platform/amd/isp4/isp4_video.c +1 -1
@@ -240,7 +240,7 @@ static int isp4vid_set_fmt_2_isp(struct v4l2_subdev *sdev, fmt.pad =ISP4VID_PAD_VIDEO_OUTPUT ; fmt.format.width = pix_fmt->width; fmt.format.height = pix_fmt->height; -return v4l2_subdev_call (sdev, pad, set_fmt,NULL , &fmt); +return v4l2_subdev_call (sdev, pad, set_fmt,NULL ,NULL , &fmt); } static int isp4vid_s_fmt_vid_cap(struct file *file, void *priv,
drivers/media/platform/amlogic/c3/isp/c3-isp-core.c +1 -0
@@ -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) {
drivers/media/platform/amlogic/c3/isp/c3-isp-resizer.c +3 -0
@@ -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) {
drivers/media/platform/amlogic/c3/mipi-adapter/c3-mipi-adap.c +1 -0
@@ -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) {
drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c +1 -0
@@ -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) {
drivers/media/platform/arm/mali-c55/mali-c55-isp.c +3 -0
@@ -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) {
@@ -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) {
drivers/media/platform/arm/mali-c55/mali-c55-resizer.c +11 -4
@@ -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, ci, state, format); -return mali_c55_rsz_set_source_fmt (sd, state, format); +return mali_c55_rsz_set_source_fmt (sd, ci, 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, ci, 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, ci, state, sel);return -EINVAL ; }
drivers/media/platform/arm/mali-c55/mali-c55-tpg.c +1 -0
@@ -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) {
drivers/media/platform/atmel/atmel-isi.c +2 -2
@@ -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;
drivers/media/platform/broadcom/bcm2835-unicam.c +1 -0
@@ -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) {
drivers/media/platform/cadence/cdns-csi2rx.c +1 -0
@@ -622,6 +622,7 @@ static int csi2rx_set_routing(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) {
drivers/media/platform/cadence/cdns-csi2tx.c +1 -0
@@ -201,6 +201,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) {
drivers/media/platform/intel/pxa_camera.c +3 -3
@@ -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;
drivers/media/platform/marvell/mcam-core.c +2 -2
@@ -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) {
drivers/media/platform/microchip/microchip-csi2dc.c +1 -0
@@ -245,6 +245,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) {
drivers/media/platform/microchip/microchip-isc-scaler.c +2 -0
@@ -46,6 +46,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 +125,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) {
drivers/media/platform/nxp/imx-mipi-csis.c +2 -1
@@ -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) {
@@ -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)
drivers/media/platform/nxp/imx7-media-csi.c +1 -0
@@ -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) {
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c +1 -0
@@ -260,6 +260,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) {
drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c +3 -0
@@ -524,6 +524,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) {
@@ -619,6 +620,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) {
@@ -678,6 +680,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) {
drivers/media/platform/nxp/imx8mq-mipi-csi2.c +1 -0
@@ -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) {
drivers/media/platform/qcom/camss/camss-csid.c +2 -1
@@ -987,6 +987,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) {
@@ -1036,7 +1037,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); }/*
drivers/media/platform/qcom/camss/camss-csiphy.c +2 -1
@@ -503,6 +503,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 +556,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 __printf(2, 3)
drivers/media/platform/qcom/camss/camss-ispif.c +2 -1
@@ -1037,6 +1037,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 +1086,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); }/*
drivers/media/platform/qcom/camss/camss-tpg.c +2 -1
@@ -292,6 +292,7 @@ static int tpg_get_format(struct v4l2_subdev *sd, }static int tpg_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -322,7 +323,7 @@ static int tpg_init_formats(struct v4l2_subdev *sd, } }; -return tpg_set_format (sd, fh ? fh->state :NULL , &format); +return tpg_set_format (sd,NULL , fh ? fh->state :NULL , &format); }static int tpg_s_ctrl (struct v4l2_ctrl *ctrl)
drivers/media/platform/qcom/camss/camss-vfe.c +8 -4
@@ -1562,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);
@@ -1574,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) {
@@ -1608,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, ci, sd_state, &sel);if (ret <0 )return ret; }
@@ -1625,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) {
@@ -1695,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) {
@@ -1721,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, ci, sd_state, &crop); }else if (sel->target ==V4L2_SEL_TGT_CROP && sel->pad ==MSM_VFE_PAD_SRC ) {struct v4l2_subdev_format fmt = {0 };
@@ -1742,7 +1746,7 @@ static int vfe_set_selection(struct v4l2_subdev *sd, fmt.format.width = rect->width; fmt.format.height = rect->height; - ret =vfe_set_format (sd, sd_state, &fmt); + ret =vfe_set_format (sd, ci, sd_state, &fmt); }else { ret = -EINVAL ; }
@@ -1772,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); }/*
drivers/media/platform/raspberrypi/rp1-cfe/csi2.c +1 -0
@@ -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) {
drivers/media/platform/raspberrypi/rp1-cfe/pisp-fe.c +1 -0
@@ -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) {
drivers/media/platform/renesas/rcar-csi2.c +1 -0
@@ -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) {
drivers/media/platform/renesas/rcar-isp/csisp.c +1 -0
@@ -331,6 +331,7 @@ 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) {
drivers/media/platform/renesas/renesas-ceu.c +4 -3
@@ -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;
drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +2 -1
@@ -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,
drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +2 -1
@@ -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 = {
drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-subdev.c +1 -0
@@ -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) {
drivers/media/platform/renesas/sh_vou.c +3 -3
@@ -714,7 +714,7 @@ static int sh_vou_set_fmt_vid_out(struct sh_vou_device *vou_dev, mbfmt->width = geo.output.width; mbfmt->height = geo.output.height; ret =v4l2_device_call_until_err (&vou_dev->v4l2_dev,0 , pad, - set_fmt,NULL , &format); + set_fmt,NULL ,NULL , &format);/* Must be implemented, so, don't check for -ENOIOCTLCMD */ if (ret <0 )return ret;
@@ -974,11 +974,11 @@ static int sh_vou_s_selection(struct file *file, void *fh,* final encoder configuration. */ v4l2_device_call_until_err (&vou_dev->v4l2_dev,0 , pad, - set_selection,NULL , &sd_sel); + set_selection,NULL ,NULL , &sd_sel); format.format.width = geo.output.width; format.format.height = geo.output.height; ret =v4l2_device_call_until_err (&vou_dev->v4l2_dev,0 , pad, - set_fmt,NULL , &format); + set_fmt,NULL ,NULL , &format);/* Must be implemented, so, don't check for -ENOIOCTLCMD */ if (ret <0 )return ret;
drivers/media/platform/renesas/vsp1/vsp1_brx.c +3 -0
@@ -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) {
@@ -165,6 +166,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) {
@@ -200,6 +202,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) {
drivers/media/platform/renesas/vsp1/vsp1_drm.c +11 -7
@@ -137,7 +137,8 @@ static int vsp1_du_insert_uif(struct vsp1_device *vsp1, 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;
@@ -184,7 +185,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;
@@ -199,6 +200,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;
@@ -226,7 +228,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;
@@ -240,7 +242,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;
@@ -254,6 +256,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;
@@ -387,7 +390,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;
@@ -538,7 +541,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;
@@ -558,7 +562,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;
drivers/media/platform/renesas/vsp1/vsp1_entity.c +3 -1
@@ -300,6 +300,7 @@ int vsp1_subdev_enum_frame_size(struct v4l2_subdev *subdev,* entity's limits, and propagates the sink pad format to the source pad. */ int vsp1_subdev_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) {
@@ -380,7 +381,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 ;
drivers/media/platform/renesas/vsp1/vsp1_entity.h +1 -0
@@ -188,6 +188,7 @@ int vsp1_subdev_get_pad_format(struct v4l2_subdev *subdev,struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt);int vsp1_subdev_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); int vsp1_subdev_enum_mbus_code(struct v4l2_subdev *subdev,
drivers/media/platform/renesas/vsp1/vsp1_histo.c +3 -0
@@ -185,6 +185,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) {
@@ -306,6 +307,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) {
@@ -330,6 +332,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) {
drivers/media/platform/renesas/vsp1/vsp1_hsit.c +1 -0
@@ -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) {
drivers/media/platform/renesas/vsp1/vsp1_rwpf.c +3 -0
@@ -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) {
@@ -214,6 +215,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) {
@@ -255,6 +257,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) {
drivers/media/platform/renesas/vsp1/vsp1_sru.c +1 -0
@@ -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) {
drivers/media/platform/renesas/vsp1/vsp1_uds.c +1 -0
@@ -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) {
drivers/media/platform/renesas/vsp1/vsp1_uif.c +2 -0
@@ -54,6 +54,7 @@ static const unsigned int uif_codes[] = { };static int uif_get_selection (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -92,6 +93,7 @@ static int uif_get_selection(struct v4l2_subdev *subdev, }static int uif_set_selection (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/platform/renesas/vsp1/vsp1_vspx.c +2 -1
@@ -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. */
drivers/media/platform/rockchip/rkcif/rkcif-interface.c +3 -0
@@ -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) {
@@ -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) {
drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c +1 -0
@@ -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) {
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c +3 -0
@@ -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) {
drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c +3 -0
@@ -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) {
drivers/media/platform/samsung/exynos4-is/fimc-capture.c +6 -2
@@ -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,7 +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 , - &sfmt); +NULL , &sfmt);if (ret)return ret; }
@@ -1509,6 +1510,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 +1577,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 +1634,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) {
drivers/media/platform/samsung/exynos4-is/fimc-isp.c +1 -0
@@ -191,6 +191,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) {
drivers/media/platform/samsung/exynos4-is/fimc-lite.c +3 -0
@@ -1052,6 +1052,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 +1114,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 +1150,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) {
drivers/media/platform/samsung/exynos4-is/mipi-csis.c +1 -0
@@ -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) {
drivers/media/platform/samsung/s3c-camif/camif-capture.c +3 -0
@@ -1275,6 +1275,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 +1343,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 +1431,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) {
drivers/media/platform/samsung/s3c-camif/camif-core.c +1 -1
@@ -227,7 +227,7 @@ static int camif_register_sensor(struct camif_dev *camif)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,
drivers/media/platform/st/stm32/stm32-csi.c +1 -0
@@ -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) {
drivers/media/platform/st/stm32/stm32-dcmi.c +6 -4
@@ -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,
@@ -1063,7 +1063,8 @@ static int dcmi_try_fmt(struct stm32_dcmi *dcmi, struct v4l2_format *f, }v4l2_fill_mbus_format (&format.format, pix, sd_fmt->mbus_code); - ret =v4l2_subdev_call_state_try (dcmi->source, pad, set_fmt, &format); + ret =v4l2_subdev_call_ci_state_try (dcmi->source, pad, set_fmt, + &format);if (ret <0 )return ret;
@@ -1224,7 +1225,8 @@ static int dcmi_set_sensor_format(struct stm32_dcmi *dcmi, }v4l2_fill_mbus_format (&format.format, pix, sd_fmt->mbus_code); - ret =v4l2_subdev_call_state_try (dcmi->source, pad, set_fmt, &format); + ret =v4l2_subdev_call_ci_state_try (dcmi->source, pad, set_fmt, + &format);if (ret <0 )return ret;
@@ -1246,7 +1248,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;
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c +3 -0
@@ -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) {
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c +1 -0
@@ -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) {
drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c +1 -0
@@ -295,6 +295,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) {
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c +1 -0
@@ -558,6 +558,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) {
drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c +1 -0
@@ -362,6 +362,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) {
drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c +1 -0
@@ -398,6 +398,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) {
drivers/media/platform/synopsys/dw-mipi-csi2rx.c +1 -0
@@ -479,6 +479,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) {
drivers/media/platform/ti/am437x/am437x-vpfe.c +1 -1
@@ -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;
drivers/media/platform/ti/cal/cal-camerarx.c +1 -0
@@ -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) {
drivers/media/platform/ti/cal/cal-video.c +2 -2
@@ -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;
drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c +1 -0
@@ -1043,6 +1043,7 @@ static int ti_csi2rx_enum_mbus_code(struct v4l2_subdev *subdev, }static int ti_csi2rx_sd_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
drivers/media/platform/ti/omap3isp/ispccdc.c +4 -1
@@ -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) {
@@ -2346,6 +2348,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 +2475,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 ; }
drivers/media/platform/ti/omap3isp/ispccp2.c +2 -1
@@ -776,6 +776,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 +821,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 ; }
drivers/media/platform/ti/omap3isp/ispcsi2.c +2 -1
@@ -994,6 +994,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 +1039,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 ; }
drivers/media/platform/ti/omap3isp/isppreview.c +4 -1
@@ -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) {
@@ -2035,6 +2037,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,
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispresizer.c +4 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispvideo.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/media/platform/via/via-camera.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/media/platform/xilinx/xilinx-csi2rxss.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/xilinx/xilinx-tpg.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/test-drivers/vimc/vimc-debayer.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/test-drivers/vimc/vimc-scaler.c +3 -0
Lines of this file are not shown. View the raw message.
drivers/media/test-drivers/vimc/vimc-sensor.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/usb/cx231xx/cx231xx-417.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/usb/cx231xx/cx231xx-video.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/media/usb/dvb-usb/cxusb-analog.c +4 -2
Lines of this file are not shown. View the raw message.
drivers/media/usb/em28xx/em28xx-camera.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/usb/pvrusb2/pvrusb2-hdw.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/v4l2-core/v4l2-subdev.c +43 -15
58 lines not on this page · raw message
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/atomisp/pci/atomisp_cmd.c +11 -5
Lines of this file are not shown. View the raw message.
drivers/staging/media/atomisp/pci/atomisp_csi2.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/atomisp/pci/atomisp_subdev.c +3 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +4 -4
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-ic-prpencvf.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-media-csi.c +3 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-media-vdic.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx6-mipi-csi2.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/ipu7/ipu7-isys-csi2.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/ipu7/ipu7-isys-subdev.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/ipu7/ipu7-isys-subdev.h +1 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/tegra-video/csi.c +1 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.47.3
Part of the diff is not shown here. View the raw message.
Laurent Pinchart
maintainerRe: [PATCH v7 14/14] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops
Hi Sakari,
Thank you for the patch.
Quoted 8 lines · Sakari Ailus
Add a pointer to const struct
v4l2_subdev_client_infoto theget_fmt,set_fmt,get_selectionandset_selectionsub-device pad ops. The client info struct will soon be used to differentiate UAPI based on client capabilities.Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Frank Li <[email protected]>---
[snip]
First, a partial review to point out one specific issue in two drivers.
Quoted 13 lines
drivers/media/i2c/imx678.c +1
-0@@ -849,6 +849,7 @@ static int imx678_enum_frame_size(struct v4l2_subdev *sd, }static int imx678_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/imx678.c static const struct v4l2_subdev_video_ops imx678_video_ops = { · line 1133
Quoted 4 lines
drivers/media/i2c/imx678.c +0
-1@@ -1130,7 +1131,6 @@ static const struct v4l2_subdev_video_ops imx678_video_ops = {static const struct v4l2_subdev_pad_ops imx678_pad_ops = { .enum_mbus_code = imx678_enum_mbus_code, .get_fmt = v4l2_subdev_get_fmt, - .set_fmt = v4l2_subdev_get_fmt,
This belongs to patch 10/14.
Quoted 3 lines
drivers/media/i2c/imx678.c +0
-0.get_selection = imx678_get_selection, .enum_frame_size = imx678_enum_frame_size, .enable_streams = imx678_enable_streams,
[snip]
drivers/media/i2c/ml86v7667.c static const struct v4l2_subdev_video_ops ml86v7667_subdev_video_ops = { · line 301
Quoted 9 lines
drivers/media/i2c/ml86v7667.c +0
-1@@ -298,7 +298,6 @@ static const struct v4l2_subdev_video_ops ml86v7667_subdev_video_ops = {static const struct v4l2_subdev_pad_ops ml86v7667_subdev_pad_ops = { .enum_mbus_code = ml86v7667_enum_mbus_code, .get_fmt = ml86v7667_fill_fmt, - .set_fmt = ml86v7667_fill_fmt,
This too.
Quoted 3 lines
drivers/media/i2c/ml86v7667.c +0
-0.get_mbus_config = ml86v7667_get_mbus_config, };
[snip]
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH v7 14/14] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops
In reply to Sakari AilusHi Sakari,
Thank you for the patch.
Quoted 8 lines · Sakari Ailus
Add a pointer to const struct
v4l2_subdev_client_infoto theget_fmt,set_fmt,get_selectionandset_selectionsub-device pad ops. The client info struct will soon be used to differentiate UAPI based on client capabilities.Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Frank Li <[email protected]>---
[snip]
I really dislike that the operations can receive a NULL client info pointer. Let's see where that's the case. We have multiple categories of users:
- Drivers that call their own .set_fmt() or .set_selection() operations from .init_state():
- drivers/media/i2c/adv7180.c
- drivers/media/i2c/gc05a2.c
- drivers/media/i2c/gc08a3.c
- drivers/media/i2c/imx214.c
- drivers/media/i2c/imx219.c
- drivers/media/i2c/imx290.c
- drivers/media/i2c/imx296.c
- drivers/media/i2c/imx334.c
- drivers/media/i2c/imx335.c
- drivers/media/i2c/imx355.c
- drivers/media/i2c/imx412.c
- drivers/media/i2c/imx415.c
- drivers/media/i2c/imx471.c
- drivers/media/i2c/lt6911uxe.c
- drivers/media/i2c/og01a1b.c
- drivers/media/i2c/og0ve1b.c
- drivers/media/i2c/ov02a10.c
- drivers/media/i2c/ov2732.c
- drivers/media/i2c/ov2735.c
- drivers/media/i2c/ov5645.c
- drivers/media/i2c/ov6211.c
- drivers/media/i2c/ov7251.c
- drivers/media/i2c/ov8858.c
- drivers/media/i2c/ov9282.c
- drivers/media/i2c/s5k3m5.c
- drivers/media/i2c/s5kjn1.c
- drivers/media/i2c/vd55g1.c
- drivers/media/i2c/vd56g3.c
- drivers/media/i2c/vgxy61.c
- drivers/media/platform/nxp/imx-mipi-csis.c
- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c
- drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c
Those are internal calls, so the driver knows what to expect. We can live with that for the time being. However, I don't want to see NULL checks appearing in the .set_fmt() and .set_selection() operations for those drivers. This design pattern should be deprecated, and drivers should be refactored to avoid introducing NULL checks. If we agree on paying attention to this during reviews, I have no objection to addressing this issue in the future.
- Drivers that call their own .set_fmt() or .set_selection() operations from .open():
- drivers/media/platform/qcom/camss/camss-csid.c
- drivers/media/platform/qcom/camss/camss-csiphy.c
- drivers/media/platform/qcom/camss/camss-ispif.c
- drivers/media/platform/qcom/camss/camss-tpg.c
- drivers/media/platform/qcom/camss/camss-vfe.c
- drivers/media/platform/ti/omap3isp/ispccdc.c
- drivers/media/platform/ti/omap3isp/ispccp2.c
- drivers/media/platform/ti/omap3isp/ispcsi2.c
- drivers/media/platform/ti/omap3isp/isppreview.c
- drivers/media/platform/ti/omap3isp/ispresizer.c
- drivers/media/platform/ti/omap3isp/ispvideo.c
Bryan has volunteered (or maybe I should say I have volunteered Bryan) to convert the camss driver to the active state API and use .init_state(). It will then fall in the previous category.
The omap3isp driver should be converted as well. Furthermore, it should stop calling internal subdev operations to implement G_SELECTION and S_SELECTION on video nodes. No objection against doing so at a later date.
- Drivers that call their own .set_fmt() or .set_selection() operations from .probe():
- drivers/media/i2c/adv7183.c
The proper fix is to convert the driver to use the subdev active state. This can be left for later (likely never, as the driver doesn't receive much attention).
- Drivers that call their own .set_fmt() or .set_selection() operations at runtime:
- drivers/media/platform/renesas/vsp1/vsp1_drm.c
- drivers/media/platform/renesas/vsp1/vsp1_entity.c
- drivers/media/platform/renesas/vsp1/vsp1_vspx.c
This is a special case. The driver calls subdev operations of its internal subdevs to configure the media pipeline on behalf of in-kernel clients. Should there be a need to check the client info in subdevs, an in-kernel client info will be allocated. Using NULL is fine for the time being, it doesn't cross any driver boundary.
- Drivers that call their own .set_fmt() or .set_selection() operations from an IRQ handler:
- drivers/media/i2c/lt6911uxe.c
The driver calls the .set_fmt() handler to update the active format when the device reports an input format change. This seems to be an incorrect usage of the V4L2 API, the right fix will be to drop that. It can be done later.
- Drivers that already pass a NULL (or fake) subdev state to .set_fmt() or .set_selection() and now also pass a NULL client info:
- drivers/media/pci/cobalt/cobalt-driver.c
- drivers/media/pci/cobalt/cobalt-v4l2.c
- drivers/media/pci/cx18/cx18-controls.c
- drivers/media/pci/cx18/cx18-ioctl.c
- drivers/media/pci/cx23885/cx23885-video.c
- drivers/media/pci/ivtv/ivtv-controls.c
- drivers/media/pci/ivtv/ivtv-ioctl.c
- drivers/media/pci/saa7134/saa7134-empress.c
- drivers/media/platform/amd/isp4/isp4_video.c
- drivers/media/platform/atmel/atmel-isi.c
- drivers/media/platform/intel/pxa_camera.c
- drivers/media/platform/marvell/mcam-core.c
- drivers/media/platform/renesas/renesas-ceu.c
- drivers/media/platform/renesas/sh_vou.c
- drivers/media/platform/samsung/exynos4-is/fimc-capture.c
- drivers/media/platform/samsung/s3c-camif/camif-core.c
- drivers/media/platform/st/stm32/stm32-dcmi.c
- drivers/media/platform/ti/am437x/am437x-vpfe.c
- drivers/media/platform/ti/vpe/vip.c
- drivers/media/platform/via/via-camera.c
- drivers/media/usb/cx231xx/cx231xx-417.c
- drivers/media/usb/cx231xx/cx231xx-video.c
- drivers/media/usb/dvb-usb/cxusb-analog.c
- drivers/media/usb/em28xx/em28xx-camera.c
- drivers/media/usb/go7007/go7007-v4l2.c
- drivers/media/usb/pvrusb2/pvrusb2-hdw.c
- drivers/staging/media/tegra-video/vi.c
Those drivers are not compatible with modern source (i.e. image sensors, video receivers, ...) subdev drivers that use the active state API. No workaround will be added to source drivers to support the above drivers, they should instead be converted to modern APIs. I have no objection passing a NULL client info.
drivers/media/platform/ti/cal/cal-video.c is in a similar category. It calls those operations to implement the legacy video node-centric API, which is getting deprecated. No concern there either.
- Finally, there's the atomisp driver. Cleaning that up will require time. As it's a staging driver I'm not concerned about adding NULL checks to sensor drivers. If atomisp uses a sensor driver that requires client info, the fix should be on the atomisp side.
Conclusion: I'm fine with this patch (with two changes pointed out separately moved to 10/14) as long as we address the above issues when required, without adding NULL checks on the client info in subdev drivers.
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH v7 14/14] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops
Hi Laurent,
Quoted 56 lines · Laurent Pinchart
Hi Sakari,
Thank you for the patch.
Quoted 8 lines · Sakari Ailus
Add a pointer to const struct
v4l2_subdev_client_infoto theget_fmt,set_fmt,get_selectionandset_selectionsub-device pad ops. The client info struct will soon be used to differentiate UAPI based on client capabilities.Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Frank Li <[email protected]>---
[snip]
I really dislike that the operations can receive a NULL client info pointer. Let's see where that's the case. We have multiple categories of users:
- Drivers that call their own .set_fmt() or .set_selection() operations from .init_state():
-
drivers/media/i2c/adv7180.c
-drivers/media/i2c/gc05a2.c
-drivers/media/i2c/gc08a3.c
-drivers/media/i2c/imx214.c
-drivers/media/i2c/imx219.c
-drivers/media/i2c/imx290.c
-drivers/media/i2c/imx296.c
-drivers/media/i2c/imx334.c
-drivers/media/i2c/imx335.c
-drivers/media/i2c/imx355.c
-drivers/media/i2c/imx412.c
-drivers/media/i2c/imx415.c
-drivers/media/i2c/imx471.c
-drivers/media/i2c/lt6911uxe.c
-drivers/media/i2c/og01a1b.c
-drivers/media/i2c/og0ve1b.c
-drivers/media/i2c/ov02a10.c
-drivers/media/i2c/ov2732.c
-drivers/media/i2c/ov2735.c
-drivers/media/i2c/ov5645.c
-drivers/media/i2c/ov6211.c
-drivers/media/i2c/ov7251.c
-drivers/media/i2c/ov8858.c
-drivers/media/i2c/ov9282.c
-drivers/media/i2c/s5k3m5.c
-drivers/media/i2c/s5kjn1.c
-drivers/media/i2c/vd55g1.c
-drivers/media/i2c/vd56g3.c
-drivers/media/i2c/vgxy61.c
-drivers/media/platform/nxp/imx-mipi-csis.c
-drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c
-drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c
Quoted 7 lines
Those are internal calls, so the driver knows what to expect. We can live with that for the time being. However, I don't want to see NULL checks appearing in the .set_fmt() and .set_selection() operations for those drivers. This design pattern should be deprecated, and drivers should be refactored to avoid introducing NULL checks. If we agree on paying attention to this during reviews, I have no objection to addressing this issue in the future.
I'm fine with that.
Quoted 50 lines
- Drivers that call their own .set_fmt() or .set_selection() operations from .open():
-
drivers/media/platform/qcom/camss/camss-csid.c
-drivers/media/platform/qcom/camss/camss-csiphy.c
-drivers/media/platform/qcom/camss/camss-ispif.c
-drivers/media/platform/qcom/camss/camss-tpg.c
-drivers/media/platform/qcom/camss/camss-vfe.c
-drivers/media/platform/ti/omap3isp/ispccdc.c
-drivers/media/platform/ti/omap3isp/ispccp2.c
-drivers/media/platform/ti/omap3isp/ispcsi2.c
-drivers/media/platform/ti/omap3isp/isppreview.c
-drivers/media/platform/ti/omap3isp/ispresizer.c
-drivers/media/platform/ti/omap3isp/ispvideo.cBryan has volunteered (or maybe I should say I have volunteered Bryan) to convert the camss driver to the active state API and use .init_state(). It will then fall in the previous category.
The omap3isp driver should be converted as well. Furthermore, it should stop calling internal subdev operations to implement
G_SELECTIONandS_SELECTIONon video nodes. No objection against doing so at a later date.- Drivers that call their own .set_fmt() or .set_selection() operations from .probe():
-
drivers/media/i2c/adv7183.cThe proper fix is to convert the driver to use the subdev active state. This can be left for later (likely never, as the driver doesn't receive much attention).
- Drivers that call their own .set_fmt() or .set_selection() operations at runtime:
-
drivers/media/platform/renesas/vsp1/vsp1_drm.c
-drivers/media/platform/renesas/vsp1/vsp1_entity.c
-drivers/media/platform/renesas/vsp1/vsp1_vspx.cThis is a special case. The driver calls subdev operations of its internal subdevs to configure the media pipeline on behalf of in-kernel clients. Should there be a need to check the client info in subdevs, an in-kernel client info will be allocated. Using NULL is fine for the time being, it doesn't cross any driver boundary.
- Drivers that call their own .set_fmt() or .set_selection() operations from an IRQ handler:
Quoted 6 lines
-
drivers/media/i2c/lt6911uxe.cThe driver calls the .set_fmt() handler to update the active format when the device reports an input format change. This seems to be an incorrect usage of the V4L2 API, the right fix will be to drop that. It can be done later.
In this case the format is obtained from the upstream HDMI link and there's no subdevice driver there.
Quoted 48 lines
- Drivers that already pass a NULL (or fake) subdev state to .set_fmt() or .set_selection() and now also pass a NULL client info:
-
drivers/media/pci/cobalt/cobalt-driver.c
-drivers/media/pci/cobalt/cobalt-v4l2.c
-drivers/media/pci/cx18/cx18-controls.c
-drivers/media/pci/cx18/cx18-ioctl.c
-drivers/media/pci/cx23885/cx23885-video.c
-drivers/media/pci/ivtv/ivtv-controls.c
-drivers/media/pci/ivtv/ivtv-ioctl.c
-drivers/media/pci/saa7134/saa7134-empress.c
-drivers/media/platform/amd/isp4/isp4_video.c
-drivers/media/platform/atmel/atmel-isi.c
-drivers/media/platform/intel/pxa_camera.c
-drivers/media/platform/marvell/mcam-core.c
-drivers/media/platform/renesas/renesas-ceu.c
-drivers/media/platform/renesas/sh_vou.c
-drivers/media/platform/samsung/exynos4-is/fimc-capture.c
-drivers/media/platform/samsung/s3c-camif/camif-core.c
-drivers/media/platform/st/stm32/stm32-dcmi.c
-drivers/media/platform/ti/am437x/am437x-vpfe.c
-drivers/media/platform/ti/vpe/vip.c
-drivers/media/platform/via/via-camera.c
-drivers/media/usb/cx231xx/cx231xx-417.c
-drivers/media/usb/cx231xx/cx231xx-video.c
-drivers/media/usb/dvb-usb/cxusb-analog.c
-drivers/media/usb/em28xx/em28xx-camera.c
-drivers/media/usb/go7007/go7007-v4l2.c
-drivers/media/usb/pvrusb2/pvrusb2-hdw.c
-drivers/staging/media/tegra-video/vi.cThose drivers are not compatible with modern source (i.e. image sensors, video receivers, ...) subdev drivers that use the active state API. No workaround will be added to source drivers to support the above drivers, they should instead be converted to modern APIs. I have no objection passing a NULL client info.
drivers/media/platform/ti/cal/cal-video.cis in a similar category. It calls those operations to implement the legacy video node-centric API, which is getting deprecated. No concern there either.- Finally, there's the atomisp driver. Cleaning that up will require time. As it's a staging driver I'm not concerned about adding NULL checks to sensor drivers. If atomisp uses a sensor driver that requires client info, the fix should be on the atomisp side.
Quoted 6 lines
Conclusion: I'm fine with this patch (with two changes pointed out separately moved to 10/14) as long as we address the above issues when required, without adding NULL checks on the client info in subdev drivers.
Reviewed-by Laurent Pinchart <[email protected]>
Thanks!
Signature · 3 lines
Regards, Sakari Ailus
Laurent Pinchart
maintainerRe: [PATCH v7 14/14] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops
Quoted 115 lines · Sakari Ailus
Quoted 52 lines · Laurent Pinchart
Quoted 8 lines · Sakari Ailus
Add a pointer to const struct
v4l2_subdev_client_infoto theget_fmt,set_fmt,get_selectionandset_selectionsub-device pad ops. The client info struct will soon be used to differentiate UAPI based on client capabilities.Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Frank Li <[email protected]>---
[snip]
I really dislike that the operations can receive a NULL client info pointer. Let's see where that's the case. We have multiple categories of users:
- Drivers that call their own .set_fmt() or .set_selection() operations from .init_state():
-
drivers/media/i2c/adv7180.c
-drivers/media/i2c/gc05a2.c
-drivers/media/i2c/gc08a3.c
-drivers/media/i2c/imx214.c
-drivers/media/i2c/imx219.c
-drivers/media/i2c/imx290.c
-drivers/media/i2c/imx296.c
-drivers/media/i2c/imx334.c
-drivers/media/i2c/imx335.c
-drivers/media/i2c/imx355.c
-drivers/media/i2c/imx412.c
-drivers/media/i2c/imx415.c
-drivers/media/i2c/imx471.c
-drivers/media/i2c/lt6911uxe.c
-drivers/media/i2c/og01a1b.c
-drivers/media/i2c/og0ve1b.c
-drivers/media/i2c/ov02a10.c
-drivers/media/i2c/ov2732.c
-drivers/media/i2c/ov2735.c
-drivers/media/i2c/ov5645.c
-drivers/media/i2c/ov6211.c
-drivers/media/i2c/ov7251.c
-drivers/media/i2c/ov8858.c
-drivers/media/i2c/ov9282.c
-drivers/media/i2c/s5k3m5.c
-drivers/media/i2c/s5kjn1.c
-drivers/media/i2c/vd55g1.c
-drivers/media/i2c/vd56g3.c
-drivers/media/i2c/vgxy61.c
-drivers/media/platform/nxp/imx-mipi-csis.c
-drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c
-drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.cQuoted 7 lines
Those are internal calls, so the driver knows what to expect. We can live with that for the time being. However, I don't want to see NULL checks appearing in the .set_fmt() and .set_selection() operations for those drivers. This design pattern should be deprecated, and drivers should be refactored to avoid introducing NULL checks. If we agree on paying attention to this during reviews, I have no objection to addressing this issue in the future.
I'm fine with that.
Quoted 52 lines
- Drivers that call their own .set_fmt() or .set_selection() operations from .open():
-
drivers/media/platform/qcom/camss/camss-csid.c
-drivers/media/platform/qcom/camss/camss-csiphy.c
-drivers/media/platform/qcom/camss/camss-ispif.c
-drivers/media/platform/qcom/camss/camss-tpg.c
-drivers/media/platform/qcom/camss/camss-vfe.c
-drivers/media/platform/ti/omap3isp/ispccdc.c
-drivers/media/platform/ti/omap3isp/ispccp2.c
-drivers/media/platform/ti/omap3isp/ispcsi2.c
-drivers/media/platform/ti/omap3isp/isppreview.c
-drivers/media/platform/ti/omap3isp/ispresizer.c
-drivers/media/platform/ti/omap3isp/ispvideo.cBryan has volunteered (or maybe I should say I have volunteered Bryan) to convert the camss driver to the active state API and use .init_state(). It will then fall in the previous category.
The omap3isp driver should be converted as well. Furthermore, it should stop calling internal subdev operations to implement
G_SELECTIONandS_SELECTIONon video nodes. No objection against doing so at a later date.- Drivers that call their own .set_fmt() or .set_selection() operations from .probe():
-
drivers/media/i2c/adv7183.cThe proper fix is to convert the driver to use the subdev active state. This can be left for later (likely never, as the driver doesn't receive much attention).
- Drivers that call their own .set_fmt() or .set_selection() operations at runtime:
-
drivers/media/platform/renesas/vsp1/vsp1_drm.c
-drivers/media/platform/renesas/vsp1/vsp1_entity.c
-drivers/media/platform/renesas/vsp1/vsp1_vspx.cThis is a special case. The driver calls subdev operations of its internal subdevs to configure the media pipeline on behalf of in-kernel clients. Should there be a need to check the client info in subdevs, an in-kernel client info will be allocated. Using NULL is fine for the time being, it doesn't cross any driver boundary.
- Drivers that call their own .set_fmt() or .set_selection() operations from an IRQ handler:
-
drivers/media/i2c/lt6911uxe.c
Quoted 7 lines
Quoted 4 lines
The driver calls the .set_fmt() handler to update the active format when the device reports an input format change. This seems to be an incorrect usage of the V4L2 API, the right fix will be to drop that. It can be done later.
In this case the format is obtained from the upstream HDMI link and there's no subdevice driver there.
As far as I understand, the driver is responsible for notifying userspace that a format change occurred, but is not supposed to modify the pad format automatically.
Quoted 56 lines
Quoted 48 lines
- Drivers that already pass a NULL (or fake) subdev state to .set_fmt() or .set_selection() and now also pass a NULL client info:
-
drivers/media/pci/cobalt/cobalt-driver.c
-drivers/media/pci/cobalt/cobalt-v4l2.c
-drivers/media/pci/cx18/cx18-controls.c
-drivers/media/pci/cx18/cx18-ioctl.c
-drivers/media/pci/cx23885/cx23885-video.c
-drivers/media/pci/ivtv/ivtv-controls.c
-drivers/media/pci/ivtv/ivtv-ioctl.c
-drivers/media/pci/saa7134/saa7134-empress.c
-drivers/media/platform/amd/isp4/isp4_video.c
-drivers/media/platform/atmel/atmel-isi.c
-drivers/media/platform/intel/pxa_camera.c
-drivers/media/platform/marvell/mcam-core.c
-drivers/media/platform/renesas/renesas-ceu.c
-drivers/media/platform/renesas/sh_vou.c
-drivers/media/platform/samsung/exynos4-is/fimc-capture.c
-drivers/media/platform/samsung/s3c-camif/camif-core.c
-drivers/media/platform/st/stm32/stm32-dcmi.c
-drivers/media/platform/ti/am437x/am437x-vpfe.c
-drivers/media/platform/ti/vpe/vip.c
-drivers/media/platform/via/via-camera.c
-drivers/media/usb/cx231xx/cx231xx-417.c
-drivers/media/usb/cx231xx/cx231xx-video.c
-drivers/media/usb/dvb-usb/cxusb-analog.c
-drivers/media/usb/em28xx/em28xx-camera.c
-drivers/media/usb/go7007/go7007-v4l2.c
-drivers/media/usb/pvrusb2/pvrusb2-hdw.c
-drivers/staging/media/tegra-video/vi.cThose drivers are not compatible with modern source (i.e. image sensors, video receivers, ...) subdev drivers that use the active state API. No workaround will be added to source drivers to support the above drivers, they should instead be converted to modern APIs. I have no objection passing a NULL client info.
drivers/media/platform/ti/cal/cal-video.cis in a similar category. It calls those operations to implement the legacy video node-centric API, which is getting deprecated. No concern there either.- Finally, there's the atomisp driver. Cleaning that up will require time. As it's a staging driver I'm not concerned about adding NULL checks to sensor drivers. If atomisp uses a sensor driver that requires client info, the fix should be on the atomisp side.
Quoted 6 lines
Conclusion: I'm fine with this patch (with two changes pointed out separately moved to 10/14) as long as we address the above issues when required, without adding NULL checks on the client info in subdev drivers.
Reviewed-by Laurent Pinchart <[email protected]>Thanks!
Signature · 3 lines
Regards, Laurent Pinchart