Metadata series preparation
Subsystems (162)
Sakari Ailus
maintainerv2 cover Metadata series preparation
Hi folks,
This smallish set contains patches that prepare for merging the metadata series.
There are simple cleanups but also two noteworthy changes: the addition of the VALIDATE_LATE media link flag and the addition of the new struct v4l2_subdev_client_info struct to the get_fmt, set_fmt, get_selection and set_selection pad operation arguments.
The VALIDATE_LATE allows using the link_validate callback as the way to validate the links connected to the sink pads of video nodes on pipelines with multiple capture video nodes. Without this flag, the entire pipeline will be validated at the time of the first streamon, with the V4L2 pixel (or other) format set on the other capture video nodes at the time, requiring all formats to be set before starting streaming anywhere. But this does generally not match with what the userspace would do, hence the new flag. The patches in the upcoming metadata series version adds the support for the flag to the IPU6 driver.
Secondly, the new struct v4l2_subdev_client_info enables passing around file handler specific client capability information, which is used to differentiate UAPI between existing users and those that are aware of the new common raw sensor model. This is effectively required if we want to add support for the new model to existing raw sensor drivers: the new model is in a direct conflict with how things worked before the model. There still needs to be a single driver internal state, the different UAPIs simply offer a different view to that state. In-kernel users that do not deal with capabilities just use NULL when calling these ops. This also means that whatever client capabilities are being used, there may not be a change to inter-driver interfaces such as get_fmt() when dealing with external pads.
I'm leaving the last Coccinelle-generated patch out this time as it's more than 200 kiB. The patch can be found here <URL:<https://git.linuxtv.org/sailus/media_tree.git/log/?h=metadata-pre>. Patches 11--14 will be squashed together before merging.
The Coccinelle spatch used to generate the 14th patch is below, as is a Perl script to generate another Coccinelle patch doing the rest of the job:
caps.cocci
------------------8<----------------------
@ fmt @
identifier a1, a2, a3;
identifier fn;
@@
fn(struct v4l2_subdev *a1,
+ const struct v4l2_subdev_client_info *ci,
struct v4l2_subdev_state *a2, struct v4l2_subdev_format *a3) {...}
@ sel @
identifier a1, a2, a3;
identifier fn2;
@@
fn2(struct v4l2_subdev *a1,
+ const struct v4l2_subdev_client_info *ci,
struct v4l2_subdev_state *a2, struct v4l2_subdev_selection *a3) {...}
@ fmt_call @
expression a1, a2, a3;
identifier fmt.fn;
@@
fn(a1
+ , NULL
, a2, a3);
@ fmt_call2 @
expression a1, a2, a3;
identifier fmt.fn;
@@
return fn(a1
+ , NULL
, a2, a3);
@ fmt_call3 @
expression ret, a1, a2, a3;
identifier fmt.fn;
@@
ret = fn(a1
+ , NULL
, a2, a3);
@ fmt_call4 @
expression a1, a2, a3;
identifier sel.fn2;
@@
fn2(a1
+ , NULL
, a2, a3);
@ fmt_call5 @
expression a1, a2, a3;
identifier sel.fn2;
@@
return fn2(a1
+ , NULL
, a2, a3);
@ fmt_call6 @
expression ret, a1, a2, a3;
identifier sel.fn2;
@@
ret = fn2(a1
+ , NULL
, a2, a3);
------------------8<----------------------
mk-caps2.pl
------------------8<----------------------
#!/usr/bin/perl -w
my @prefix = (
"(void)", "", "ret = ", "return "
);
my $state_args = [
[ "sd", "state", "fmt" ]
];
my $pad_active_args = [
[ "sd", "pad", "get_fmt", "fmt" ], [ "sd", "pad", "set_fmt", "fmt" ], [ "sd", "pad", "get_selection", "fmt" ], [ "sd", "pad", "set_selection", "fmt" ],
];
my $pad_args = [
[ "sd", "pad", "get_fmt", "state", "fmt" ], [ "sd", "pad", "set_fmt", "state", "fmt" ], [ "sd", "pad", "get_selection", "state", "fmt" ], [ "sd", "pad", "set_selection", "state", "fmt" ],
];
my $group_args = [
[ "dev", "group", "pad", "get_fmt", "state", "fmt" ], [ "dev", "group", "pad", "set_fmt", "state", "fmt" ], [ "dev", "group", "pad", "get_selection", "state", "fmt" ], [ "dev", "group", "pad", "set_selection", "state", "fmt" ],
];
my %funcs = (
# "function_name" => [ arg ref, new arg position from the end ],
"v4l2_subdev_call" => { args => $pad_args, pos => 1 },
"v4l2_device_call_all" => { args => $group_args, pos => 1 },
"v4l2_subdev_get_fmt" => { args => $state_args, pos => 1 },
"sensor_call" => { args => $pad_args, pos => 1 },
"saa_call_all" => { args => $pad_args, pos => 1 },
"call_all" => { args => $pad_args, pos => 1 },
"v4l2_subdev_call_state_active" => { args => $pad_active_args, newname => "v4l2_subdev_call_ci_state_active" },);
my $rule;
foreach my $p (@prefix) {
foreach my $f (keys %funcs) {
my $aref = $funcs{$f};
foreach my $i (@{$aref->{args}}) {
my $newname = $aref->{newname};
print "@ rule" . $rule++ . " @\n";
print "symbol $f;\n";
print map {
((/_/ || /^pad$/) ?
"symbol" : "expression") . " $_;\n";
} @$i;
my @pre = @$i;
my @post = splice @pre, $#pre - ($aref->{pos} // 0);
print "identifier ret;\n" if $p =~ "ret =";
print "@@\n";
if (! defined $newname) {
print " $p$f(" . join(", ", @pre) . "\n";
print "+ , NULL\n";
print " , " . join(", ", @post) . ");\n";
} else {
print " $p\n";
print "- $f(\n";
print "+ $newname(\n";
print " " . join(", ", (@pre, @post)) . ");\n";
}
}
}
}------------------8<----------------------
since v2:
- 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: imx219: Rename "PIXEL_ARRAY" as "CROP"
media: v4l2-subdev: Allow accessing routes with STREAMS client
capability
media: Documentation: Improve LINK_FREQ documentation
media: Documentation: Improve pixel rate calculation documentation
media: v4l2-subdev: Refactor returning routes
media: mc: Separate single link validation into a new function
media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE
media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP
media: Document enable_streams and disable_streams behaviour
media: v4l2-subdev: Move subdev client capabilities into a new struct
media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad
ops
media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state
media: v4l2-subdev: Perform client info changes to i2c drivers
media: v4l2-subdev: Add struct v4l2_subdev_client_info argument to pad
ops
Documentation/driver-api/media/tx-rx.rst | 9 +- .../media/mediactl/media-ioc-setup-link.rst | 4 + .../media/mediactl/media-types.rst | 5 + .../media/v4l/ext-ctrls-image-process.rst | 4 +- drivers/media/i2c/adv7170.c | 2 + drivers/media/i2c/adv7175.c | 2 + drivers/media/i2c/adv7180.c | 4 +- drivers/media/i2c/adv7183.c | 4 +- drivers/media/i2c/adv748x/adv748x-afe.c | 4 +- drivers/media/i2c/adv748x/adv748x-csi2.c | 3 +- drivers/media/i2c/adv748x/adv748x-hdmi.c | 4 +- drivers/media/i2c/adv7511-v4l2.c | 2 + drivers/media/i2c/adv7604.c | 3 + drivers/media/i2c/adv7842.c | 4 +- drivers/media/i2c/ak881x.c | 2 + drivers/media/i2c/alvium-csi2.c | 3 + drivers/media/i2c/ar0521.c | 2 + drivers/media/i2c/ccs/ccs-core.c | 15 +- drivers/media/i2c/cx25840/cx25840-core.c | 1 + drivers/media/i2c/ds90ub913.c | 3 +- drivers/media/i2c/ds90ub953.c | 3 +- drivers/media/i2c/ds90ub960.c | 3 +- drivers/media/i2c/et8ek8/et8ek8_driver.c | 2 + drivers/media/i2c/gc0308.c | 1 + drivers/media/i2c/gc0310.c | 1 + drivers/media/i2c/gc05a2.c | 4 +- drivers/media/i2c/gc08a3.c | 4 +- drivers/media/i2c/gc2145.c | 2 + drivers/media/i2c/hi556.c | 3 + drivers/media/i2c/hi846.c | 3 + drivers/media/i2c/hi847.c | 2 + drivers/media/i2c/imx111.c | 1 + drivers/media/i2c/imx208.c | 2 + drivers/media/i2c/imx214.c | 4 +- drivers/media/i2c/imx219.c | 32 ++-- drivers/media/i2c/imx258.c | 3 + drivers/media/i2c/imx274.c | 4 + drivers/media/i2c/imx283.c | 2 + drivers/media/i2c/imx290.c | 4 +- drivers/media/i2c/imx296.c | 7 +- drivers/media/i2c/imx319.c | 2 + drivers/media/i2c/imx334.c | 4 +- drivers/media/i2c/imx335.c | 4 +- drivers/media/i2c/imx355.c | 2 + drivers/media/i2c/imx412.c | 4 +- drivers/media/i2c/imx415.c | 4 +- drivers/media/i2c/isl7998x.c | 2 + drivers/media/i2c/lt6911uxe.c | 5 +- drivers/media/i2c/max9286.c | 3 +- drivers/media/i2c/max96714.c | 3 +- drivers/media/i2c/max96717.c | 3 +- drivers/media/i2c/ml86v7667.c | 1 + drivers/media/i2c/mt9m001.c | 6 +- drivers/media/i2c/mt9m111.c | 4 + drivers/media/i2c/mt9m114.c | 6 + drivers/media/i2c/mt9p031.c | 4 + drivers/media/i2c/mt9t112.c | 4 + drivers/media/i2c/mt9v011.c | 1 + drivers/media/i2c/mt9v032.c | 4 + drivers/media/i2c/mt9v111.c | 2 + drivers/media/i2c/og01a1b.c | 2 + drivers/media/i2c/og0ve1b.c | 3 +- drivers/media/i2c/os05b10.c | 2 + drivers/media/i2c/ov01a10.c | 3 + drivers/media/i2c/ov02a10.c | 4 +- drivers/media/i2c/ov02c10.c | 1 + drivers/media/i2c/ov02e10.c | 2 + drivers/media/i2c/ov08d10.c | 2 + drivers/media/i2c/ov08x40.c | 2 + drivers/media/i2c/ov13858.c | 2 + drivers/media/i2c/ov13b10.c | 2 + drivers/media/i2c/ov2640.c | 3 + drivers/media/i2c/ov2659.c | 2 + drivers/media/i2c/ov2680.c | 4 + drivers/media/i2c/ov2685.c | 3 + drivers/media/i2c/ov2735.c | 4 +- drivers/media/i2c/ov2740.c | 1 + drivers/media/i2c/ov4689.c | 2 + drivers/media/i2c/ov5640.c | 3 + drivers/media/i2c/ov5645.c | 4 +- drivers/media/i2c/ov5647.c | 3 + drivers/media/i2c/ov5648.c | 2 + drivers/media/i2c/ov5670.c | 3 + drivers/media/i2c/ov5675.c | 3 + drivers/media/i2c/ov5693.c | 4 + drivers/media/i2c/ov5695.c | 2 + drivers/media/i2c/ov6211.c | 3 +- drivers/media/i2c/ov64a40.c | 2 + drivers/media/i2c/ov7251.c | 5 +- drivers/media/i2c/ov7670.c | 2 + drivers/media/i2c/ov772x.c | 3 + drivers/media/i2c/ov7740.c | 2 + drivers/media/i2c/ov8856.c | 2 + drivers/media/i2c/ov8858.c | 3 +- drivers/media/i2c/ov8865.c | 3 + drivers/media/i2c/ov9282.c | 5 +- drivers/media/i2c/ov9640.c | 2 + drivers/media/i2c/ov9650.c | 2 + drivers/media/i2c/ov9734.c | 2 + drivers/media/i2c/rdacm20.c | 1 + drivers/media/i2c/rdacm21.c | 1 + drivers/media/i2c/rj54n1cb0c.c | 4 + drivers/media/i2c/s5c73m3/s5c73m3-core.c | 4 + drivers/media/i2c/s5k3m5.c | 4 +- drivers/media/i2c/s5k5baf.c | 4 + drivers/media/i2c/s5k6a3.c | 2 + drivers/media/i2c/s5kjn1.c | 4 +- drivers/media/i2c/saa6752hs.c | 2 + drivers/media/i2c/saa7115.c | 1 + drivers/media/i2c/saa717x.c | 1 + drivers/media/i2c/st-mipid02.c | 1 + drivers/media/i2c/tc358743.c | 4 +- drivers/media/i2c/tc358746.c | 3 +- drivers/media/i2c/tda1997x.c | 2 + drivers/media/i2c/thp7312.c | 1 + drivers/media/i2c/tvp514x.c | 2 + drivers/media/i2c/tvp5150.c | 3 + drivers/media/i2c/tvp7002.c | 4 +- drivers/media/i2c/tw9900.c | 2 + drivers/media/i2c/tw9910.c | 3 + drivers/media/i2c/vd55g1.c | 4 +- drivers/media/i2c/vd56g3.c | 4 +- drivers/media/i2c/vgxy61.c | 5 +- drivers/media/mc/mc-entity.c | 144 +++++++++++++----- drivers/media/pci/cobalt/cobalt-driver.c | 8 +- drivers/media/pci/cobalt/cobalt-v4l2.c | 14 +- drivers/media/pci/cx18/cx18-av-core.c | 1 + drivers/media/pci/cx18/cx18-controls.c | 2 +- drivers/media/pci/cx18/cx18-ioctl.c | 2 +- drivers/media/pci/cx23885/cx23885-video.c | 4 +- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 5 +- drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 2 + .../media/pci/intel/ipu6/ipu6-isys-subdev.c | 3 +- .../media/pci/intel/ipu6/ipu6-isys-subdev.h | 1 + drivers/media/pci/intel/ivsc/mei_csi.c | 1 + drivers/media/pci/ivtv/ivtv-controls.c | 2 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +- drivers/media/pci/saa7134/saa7134-empress.c | 6 +- .../platform/amlogic/c3/isp/c3-isp-capture.c | 2 +- .../platform/amlogic/c3/isp/c3-isp-core.c | 1 + .../platform/amlogic/c3/isp/c3-isp-resizer.c | 3 + .../amlogic/c3/mipi-adapter/c3-mipi-adap.c | 3 +- .../amlogic/c3/mipi-csi2/c3-mipi-csi2.c | 3 +- .../platform/arm/mali-c55/mali-c55-capture.c | 2 +- .../platform/arm/mali-c55/mali-c55-isp.c | 5 +- .../platform/arm/mali-c55/mali-c55-resizer.c | 15 +- .../platform/arm/mali-c55/mali-c55-tpg.c | 1 + drivers/media/platform/atmel/atmel-isi.c | 4 +- .../media/platform/broadcom/bcm2835-unicam.c | 3 +- drivers/media/platform/cadence/cdns-csi2rx.c | 7 +- drivers/media/platform/cadence/cdns-csi2tx.c | 7 +- drivers/media/platform/intel/pxa_camera.c | 6 +- drivers/media/platform/marvell/mcam-core.c | 4 +- .../platform/microchip/microchip-csi2dc.c | 2 + .../platform/microchip/microchip-isc-base.c | 1 + .../platform/microchip/microchip-isc-scaler.c | 3 + drivers/media/platform/nxp/imx-mipi-csis.c | 5 +- drivers/media/platform/nxp/imx7-media-csi.c | 3 +- .../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 3 +- .../platform/nxp/imx8-isi/imx8-isi-pipe.c | 3 + drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 3 +- .../media/platform/qcom/camss/camss-csid.c | 4 +- .../media/platform/qcom/camss/camss-csiphy.c | 4 +- .../media/platform/qcom/camss/camss-ispif.c | 4 +- drivers/media/platform/qcom/camss/camss-vfe.c | 17 ++- .../media/platform/qcom/camss/camss-video.c | 2 +- .../media/platform/raspberrypi/rp1-cfe/csi2.c | 1 + .../platform/raspberrypi/rp1-cfe/pisp-fe.c | 3 +- drivers/media/platform/renesas/rcar-csi2.c | 3 +- .../media/platform/renesas/rcar-isp/csisp.c | 3 +- .../platform/renesas/rcar-vin/rcar-v4l2.c | 2 +- drivers/media/platform/renesas/renesas-ceu.c | 7 +- .../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 3 +- .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 3 +- .../platform/renesas/rzg2l-cru/rzg2l-video.c | 2 +- .../renesas/rzv2h-ivc/rzv2h-ivc-subdev.c | 3 +- .../media/platform/renesas/vsp1/vsp1_brx.c | 3 + .../media/platform/renesas/vsp1/vsp1_clu.c | 1 + .../media/platform/renesas/vsp1/vsp1_drm.c | 26 ++-- .../media/platform/renesas/vsp1/vsp1_entity.c | 4 +- .../media/platform/renesas/vsp1/vsp1_histo.c | 9 +- .../media/platform/renesas/vsp1/vsp1_hsit.c | 1 + .../media/platform/renesas/vsp1/vsp1_iif.c | 1 + .../media/platform/renesas/vsp1/vsp1_lif.c | 1 + .../media/platform/renesas/vsp1/vsp1_lut.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 | 3 + .../media/platform/renesas/vsp1/vsp1_video.c | 2 +- .../media/platform/renesas/vsp1/vsp1_vspx.c | 3 +- .../platform/rockchip/rkcif/rkcif-interface.c | 5 +- .../platform/rockchip/rkisp1/rkisp1-capture.c | 2 +- .../platform/rockchip/rkisp1/rkisp1-csi.c | 3 +- .../platform/rockchip/rkisp1/rkisp1-isp.c | 3 + .../platform/rockchip/rkisp1/rkisp1-resizer.c | 3 + .../samsung/exynos4-is/fimc-capture.c | 13 +- .../samsung/exynos4-is/fimc-isp-video.c | 5 +- .../platform/samsung/exynos4-is/fimc-isp.c | 2 + .../platform/samsung/exynos4-is/fimc-lite.c | 8 +- .../platform/samsung/exynos4-is/mipi-csis.c | 2 + .../samsung/s3c-camif/camif-capture.c | 7 +- .../platform/samsung/s3c-camif/camif-core.c | 4 +- drivers/media/platform/st/stm32/stm32-csi.c | 1 + drivers/media/platform/st/stm32/stm32-dcmi.c | 6 +- .../st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 3 +- .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 3 + .../st/stm32/stm32-dcmipp/dcmipp-input.c | 1 + .../platform/sunxi/sun4i-csi/sun4i_v4l2.c | 2 + .../sunxi/sun6i-csi/sun6i_csi_bridge.c | 2 + .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 2 + .../sun8i_a83t_mipi_csi2.c | 2 + .../media/platform/ti/am437x/am437x-vpfe.c | 4 +- drivers/media/platform/ti/cal/cal-camerarx.c | 3 +- drivers/media/platform/ti/cal/cal-video.c | 6 +- .../media/platform/ti/davinci/vpif_capture.c | 2 +- .../platform/ti/j721e-csi2rx/j721e-csi2rx.c | 2 +- drivers/media/platform/ti/omap3isp/ispccdc.c | 6 +- drivers/media/platform/ti/omap3isp/ispccp2.c | 4 +- drivers/media/platform/ti/omap3isp/ispcsi2.c | 4 +- .../media/platform/ti/omap3isp/isppreview.c | 6 +- .../media/platform/ti/omap3isp/ispresizer.c | 6 +- drivers/media/platform/ti/omap3isp/ispvideo.c | 12 +- drivers/media/platform/ti/vpe/vip.c | 7 +- drivers/media/platform/via/via-camera.c | 4 +- drivers/media/platform/video-mux.c | 1 + .../media/platform/xilinx/xilinx-csi2rxss.c | 2 + drivers/media/platform/xilinx/xilinx-dma.c | 2 +- drivers/media/platform/xilinx/xilinx-tpg.c | 2 + drivers/media/test-drivers/vimc/vimc-common.c | 2 +- .../media/test-drivers/vimc/vimc-debayer.c | 3 +- drivers/media/test-drivers/vimc/vimc-scaler.c | 3 + drivers/media/test-drivers/vimc/vimc-sensor.c | 1 + drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 4 +- drivers/media/usb/dvb-usb/cxusb-analog.c | 6 +- drivers/media/usb/em28xx/em28xx-camera.c | 2 +- drivers/media/usb/go7007/go7007-v4l2.c | 2 +- drivers/media/usb/go7007/s2250-board.c | 1 + drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- drivers/media/v4l2-core/v4l2-subdev.c | 117 +++++++++----- .../media/atomisp/i2c/atomisp-gc2235.c | 2 + .../media/atomisp/i2c/atomisp-ov2722.c | 2 + .../staging/media/atomisp/pci/atomisp_cmd.c | 16 +- .../staging/media/atomisp/pci/atomisp_csi2.c | 2 + .../media/atomisp/pci/atomisp_subdev.c | 4 + .../staging/media/atomisp/pci/atomisp_v4l2.c | 8 +- .../media/deprecated/atmel/atmel-isc-base.c | 4 +- drivers/staging/media/imx/imx-ic-prp.c | 2 + drivers/staging/media/imx/imx-ic-prpencvf.c | 2 + drivers/staging/media/imx/imx-media-capture.c | 14 +- drivers/staging/media/imx/imx-media-csi.c | 4 + drivers/staging/media/imx/imx-media-utils.c | 2 +- drivers/staging/media/imx/imx-media-vdic.c | 2 + drivers/staging/media/imx/imx6-mipi-csi2.c | 2 + drivers/staging/media/ipu3/ipu3-v4l2.c | 4 + drivers/staging/media/ipu7/ipu7-isys-csi2.c | 2 + drivers/staging/media/ipu7/ipu7-isys-subdev.c | 3 +- .../staging/media/starfive/camss/stf-isp.c | 12 +- .../staging/media/starfive/camss/stf-video.c | 2 +- .../media/sunxi/sun6i-isp/sun6i_isp_proc.c | 2 + drivers/staging/media/tegra-video/csi.c | 2 + drivers/staging/media/tegra-video/vi.c | 13 +- include/media/v4l2-subdev.h | 77 ++++++++-- include/uapi/linux/media.h | 1 + 265 files changed, 969 insertions(+), 324 deletions(-)
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v2 1/14 media: imx219: Rename "PIXEL_ARRAY" as "CROP"
The imx219 driver uses macros for denoting different aspects of the pixel array. The values used for IMX219_PIXEL_ARRAY_* macros imply a crop configuration however, not the size of the pixel array. Reflect this in the naming, too.
--- drivers/media/i2c/imx219.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/media/i2c/imx219.c +14 -14
@@ -142,10 +142,10 @@/* IMX219 native and active pixel array size. */ #define IMX219_NATIVE_WIDTH 3296U#define IMX219_NATIVE_HEIGHT 2480U -#define IMX219_PIXEL_ARRAY_LEFT 8U -#define IMX219_PIXEL_ARRAY_TOP 8U -#define IMX219_PIXEL_ARRAY_WIDTH 3280U -#define IMX219_PIXEL_ARRAY_HEIGHT 2464U +#define IMX219_CROP_LEFT 8U +#define IMX219_CROP_TOP 8U +#define IMX219_CROP_WIDTH 3280U +#define IMX219_CROP_HEIGHT 2464U/* Mode : resolution and related config&values */ struct imx219_mode {
@@ -675,13 +675,13 @@ static int imx219_set_framefmt(struct imx219 *imx219, bpp =imx219_get_format_bpp (format);cci_write (imx219->regmap,IMX219_REG_X_ADD_STA_A , - crop->left -IMX219_PIXEL_ARRAY_LEFT , &ret); + crop->left -IMX219_CROP_LEFT , &ret);cci_write (imx219->regmap,IMX219_REG_X_ADD_END_A , - crop->left -IMX219_PIXEL_ARRAY_LEFT + crop->width -1 , &ret); + crop->left -IMX219_CROP_LEFT + crop->width -1 , &ret);cci_write (imx219->regmap,IMX219_REG_Y_ADD_STA_A , - crop->top -IMX219_PIXEL_ARRAY_TOP , &ret); + crop->top -IMX219_CROP_TOP , &ret);cci_write (imx219->regmap,IMX219_REG_Y_ADD_END_A , - crop->top -IMX219_PIXEL_ARRAY_TOP + crop->height -1 , &ret); + crop->top -IMX219_CROP_TOP + crop->height -1 , &ret);imx219_get_binning (state, &bin_h, &bin_v);cci_write (imx219->regmap,IMX219_REG_BINNING_MODE_H , bin_h, &ret);
@@ -867,8 +867,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,* Use binning to maximize the crop rectangle size, and centre it in the * sensor. */ - bin_h =min (IMX219_PIXEL_ARRAY_WIDTH / format->width,2U ); - bin_v =min (IMX219_PIXEL_ARRAY_HEIGHT / format->height,2U ); + bin_h =min (IMX219_CROP_WIDTH / format->width,2U ); + bin_v =min (IMX219_CROP_HEIGHT / format->height,2U );/* Ensure bin_h and bin_v are same to avoid 1:2 or 2:1 stretching */ binning =min (bin_h, bin_v);
@@ -967,10 +967,10 @@ static int imx219_get_selection(struct v4l2_subdev *sd,case V4L2_SEL_TGT_CROP_DEFAULT :case V4L2_SEL_TGT_CROP_BOUNDS : - sel->r.top =IMX219_PIXEL_ARRAY_TOP ; - sel->r.left =IMX219_PIXEL_ARRAY_LEFT ; - sel->r.width =IMX219_PIXEL_ARRAY_WIDTH ; - sel->r.height =IMX219_PIXEL_ARRAY_HEIGHT ; + sel->r.top =IMX219_CROP_TOP ; + sel->r.left =IMX219_CROP_LEFT ; + sel->r.width =IMX219_CROP_WIDTH ; + sel->r.height =IMX219_CROP_HEIGHT ;return 0 ; }
Signature · 1 line
2.47.3
Re: [PATCH v2 01/14] media: imx219: Rename "PIXEL_ARRAY" as "CROP"
Hi Sakari
How is this related to the metadata seris ? :)
Shouldn't we aim to fast track that series instead of adding more things as requisites ?
Quoted 4 lines · Sakari Ailus
The imx219 driver uses macros for denoting different aspects of the pixel array. The values used for IMX219_PIXEL_ARRAY_* macros imply a crop configuration however, not the size of the pixel array. Reflect this in the naming, too.
3280x2464 is the active pixel array area, according to the datasheet. I guess one can claim is the default crop (it is in facts used as DEFAULT_CROP and CROP_BOUNDS rectangle), so:
Quoted 73 lines
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/i2c/imx219.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)drivers/media/i2c/imx219.c +14
-15@@ -142,10 +142,10 @@/* IMX219 native and active pixel array size. */ #define IMX219_NATIVE_WIDTH 3296U#define IMX219_NATIVE_HEIGHT 2480U -#define IMX219_PIXEL_ARRAY_LEFT 8U -#define IMX219_PIXEL_ARRAY_TOP 8U -#define IMX219_PIXEL_ARRAY_WIDTH 3280U -#define IMX219_PIXEL_ARRAY_HEIGHT 2464U +#define IMX219_CROP_LEFT 8U +#define IMX219_CROP_TOP 8U +#define IMX219_CROP_WIDTH 3280U +#define IMX219_CROP_HEIGHT 2464U/* Mode : resolution and related config&values */ struct imx219_mode {@@ -675,13 +675,13 @@ static int imx219_set_framefmt(struct imx219 *imx219, bpp =imx219_get_format_bpp (format);cci_write (imx219->regmap,IMX219_REG_X_ADD_STA_A , - crop->left -IMX219_PIXEL_ARRAY_LEFT , &ret); + crop->left -IMX219_CROP_LEFT , &ret);cci_write (imx219->regmap,IMX219_REG_X_ADD_END_A , - crop->left -IMX219_PIXEL_ARRAY_LEFT + crop->width -1 , &ret); + crop->left -IMX219_CROP_LEFT + crop->width -1 , &ret);cci_write (imx219->regmap,IMX219_REG_Y_ADD_STA_A , - crop->top -IMX219_PIXEL_ARRAY_TOP , &ret); + crop->top -IMX219_CROP_TOP , &ret);cci_write (imx219->regmap,IMX219_REG_Y_ADD_END_A , - crop->top -IMX219_PIXEL_ARRAY_TOP + crop->height -1 , &ret); + crop->top -IMX219_CROP_TOP + crop->height -1 , &ret);imx219_get_binning (state, &bin_h, &bin_v);cci_write (imx219->regmap,IMX219_REG_BINNING_MODE_H , bin_h, &ret);@@ -867,8 +867,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,* Use binning to maximize the crop rectangle size, and centre it in the * sensor. */ - bin_h =min (IMX219_PIXEL_ARRAY_WIDTH / format->width,2U ); - bin_v =min (IMX219_PIXEL_ARRAY_HEIGHT / format->height,2U ); + bin_h =min (IMX219_CROP_WIDTH / format->width,2U ); + bin_v =min (IMX219_CROP_HEIGHT / format->height,2U );/* Ensure bin_h and bin_v are same to avoid 1:2 or 2:1 stretching */ binning =min (bin_h, bin_v);@@ -967,10 +967,10 @@ static int imx219_get_selection(struct v4l2_subdev *sd,case V4L2_SEL_TGT_CROP_DEFAULT :case V4L2_SEL_TGT_CROP_BOUNDS : - sel->r.top =IMX219_PIXEL_ARRAY_TOP ; - sel->r.left =IMX219_PIXEL_ARRAY_LEFT ; - sel->r.width =IMX219_PIXEL_ARRAY_WIDTH ; - sel->r.height =IMX219_PIXEL_ARRAY_HEIGHT ; + sel->r.top =IMX219_CROP_TOP ; + sel->r.left =IMX219_CROP_LEFT ; + sel->r.width =IMX219_CROP_WIDTH ; + sel->r.height =IMX219_CROP_HEIGHT ;return 0 ; } --2.47.3
Sakari Ailus
maintainerRe: [PATCH v2 01/14] media: imx219: Rename "PIXEL_ARRAY" as "CROP"
Hi Jacopo,
Quoted 2 lines · Jacopo Mondi
Hi Sakari
How is this related to the metadata seris ? :)
It's related as I'm working on the imx219 driver to add support for the common raw sensor model to it.
Quoted 3 lines
Shouldn't we aim to fast track that series instead of adding more things as requisites ?
The intent here is to merge early what can be merged early, to avoid making the series unnecessarily large.
Quoted 10 lines · Sakari Ailus
Quoted 4 lines
The imx219 driver uses macros for denoting different aspects of the pixel array. The values used for IMX219_PIXEL_ARRAY_* macros imply a crop configuration however, not the size of the pixel array. Reflect this in the naming, too.
3280x2464 is the active pixel array area, according to the datasheet. I guess one can claim is the default crop (it is in facts used as
DEFAULT_CROPandCROP_BOUNDSrectangle), so:
It's a good question what should be done with this. I took another glance to the datasheet and inded the borders are said to be "InValid" pixels without further explaining what it actually means. Probably nothing apart from the vendor making no guarantees of the quality, even if in practice there might be no difference.
To me this border area looks like extra rows and columns of pixels to counter the ISPs effectively dropping a few rows and columns while still keeping the resulting image slightly larger than 8 Mp.
Have you tried capturing these pixels?
Quoted 2 lines
Acked-by Jacopo Mondi <[email protected]>
Thank you.
Quoted 70 lines
Quoted 70 lines
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/i2c/imx219.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)drivers/media/i2c/imx219.c +14
-14@@ -142,10 +142,10 @@/* IMX219 native and active pixel array size. */ #define IMX219_NATIVE_WIDTH 3296U#define IMX219_NATIVE_HEIGHT 2480U -#define IMX219_PIXEL_ARRAY_LEFT 8U -#define IMX219_PIXEL_ARRAY_TOP 8U -#define IMX219_PIXEL_ARRAY_WIDTH 3280U -#define IMX219_PIXEL_ARRAY_HEIGHT 2464U +#define IMX219_CROP_LEFT 8U +#define IMX219_CROP_TOP 8U +#define IMX219_CROP_WIDTH 3280U +#define IMX219_CROP_HEIGHT 2464U/* Mode : resolution and related config&values */ struct imx219_mode {@@ -675,13 +675,13 @@ static int imx219_set_framefmt(struct imx219 *imx219, bpp =imx219_get_format_bpp (format);cci_write (imx219->regmap,IMX219_REG_X_ADD_STA_A , - crop->left -IMX219_PIXEL_ARRAY_LEFT , &ret); + crop->left -IMX219_CROP_LEFT , &ret);cci_write (imx219->regmap,IMX219_REG_X_ADD_END_A , - crop->left -IMX219_PIXEL_ARRAY_LEFT + crop->width -1 , &ret); + crop->left -IMX219_CROP_LEFT + crop->width -1 , &ret);cci_write (imx219->regmap,IMX219_REG_Y_ADD_STA_A , - crop->top -IMX219_PIXEL_ARRAY_TOP , &ret); + crop->top -IMX219_CROP_TOP , &ret);cci_write (imx219->regmap,IMX219_REG_Y_ADD_END_A , - crop->top -IMX219_PIXEL_ARRAY_TOP + crop->height -1 , &ret); + crop->top -IMX219_CROP_TOP + crop->height -1 , &ret);imx219_get_binning (state, &bin_h, &bin_v);cci_write (imx219->regmap,IMX219_REG_BINNING_MODE_H , bin_h, &ret);@@ -867,8 +867,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,* Use binning to maximize the crop rectangle size, and centre it in the * sensor. */ - bin_h =min (IMX219_PIXEL_ARRAY_WIDTH / format->width,2U ); - bin_v =min (IMX219_PIXEL_ARRAY_HEIGHT / format->height,2U ); + bin_h =min (IMX219_CROP_WIDTH / format->width,2U ); + bin_v =min (IMX219_CROP_HEIGHT / format->height,2U );/* Ensure bin_h and bin_v are same to avoid 1:2 or 2:1 stretching */ binning =min (bin_h, bin_v);@@ -967,10 +967,10 @@ static int imx219_get_selection(struct v4l2_subdev *sd,case V4L2_SEL_TGT_CROP_DEFAULT :case V4L2_SEL_TGT_CROP_BOUNDS : - sel->r.top =IMX219_PIXEL_ARRAY_TOP ; - sel->r.left =IMX219_PIXEL_ARRAY_LEFT ; - sel->r.width =IMX219_PIXEL_ARRAY_WIDTH ; - sel->r.height =IMX219_PIXEL_ARRAY_HEIGHT ; + sel->r.top =IMX219_CROP_TOP ; + sel->r.left =IMX219_CROP_LEFT ; + sel->r.width =IMX219_CROP_WIDTH ; + sel->r.height =IMX219_CROP_HEIGHT ;return 0 ; }
Signature · 3 lines
Kind regards, Sakari Ailus
Sakari Ailus
maintainerPATCH v2 2/14 media: v4l2-subdev: Allow accessing routes with STREAMS client capability
In reply to Sakari AilusDisable access to routes when the STREAMS client capability bit isn't set. Routes aren't relevant otherwise anyway.
--- drivers/media/v4l2-core/v4l2-subdev.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/media/v4l2-core/v4l2-subdev.c +6 -0
@@ -1008,6 +1008,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,if (!(sd->flags &V4L2_SUBDEV_FL_STREAMS ))return -ENOIOCTLCMD ; +if (!client_supports_streams) +return -EINVAL ; +memset (routing->reserved,0 ,sizeof (routing->reserved)); krouting = &state->routing;
@@ -1035,6 +1038,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,if (!(sd->flags &V4L2_SUBDEV_FL_STREAMS ))return -ENOIOCTLCMD ; +if (!client_supports_streams) +return -EINVAL ; +if (routing->which !=V4L2_SUBDEV_FORMAT_TRY && ro_subdev)return -EPERM ;
Signature · 1 line
2.47.3
Re: [PATCH v2 02/14] media: v4l2-subdev: Allow accessing routes with STREAMS client capability
Hi Sakari
Quoted 4 lines · Sakari Ailus
Disable access to routes when the STREAMS client capability bit isn't set. Routes aren't relevant otherwise anyway.
Signed-off-by Sakari Ailus <[email protected]>
Thanks
j
Quoted 32 lines
--- drivers/media/v4l2-core/v4l2-subdev.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/media/v4l2-core/v4l2-subdev.c +6
-1@@ -1008,6 +1008,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,if (!(sd->flags &V4L2_SUBDEV_FL_STREAMS ))return -ENOIOCTLCMD ; +if (!client_supports_streams) +return -EINVAL ; +memset (routing->reserved,0 ,sizeof (routing->reserved)); krouting = &state->routing;@@ -1035,6 +1038,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,if (!(sd->flags &V4L2_SUBDEV_FL_STREAMS ))return -ENOIOCTLCMD ; +if (!client_supports_streams) +return -EINVAL ; +if (routing->which !=V4L2_SUBDEV_FORMAT_TRY && ro_subdev)return -EPERM ; --2.47.3
Re: [PATCH v2 02/14] media: v4l2-subdev: Allow accessing routes with STREAMS client capability
In reply to Sakari AilusHi Sakari,
Quoted 4 lines · Sakari Ailus
Disable access to routes when the STREAMS client capability bit isn't set. Routes aren't relevant otherwise anyway.
Signed-off-by Sakari Ailus<[email protected]>
Reviewed-by <[email protected]>
Quoted 31 lines
--- drivers/media/v4l2-core/v4l2-subdev.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/media/v4l2-core/v4l2-subdev.c +6
-1@@ -1008,6 +1008,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,if (!(sd->flags &V4L2_SUBDEV_FL_STREAMS ))return -ENOIOCTLCMD ; +if (!client_supports_streams) +return -EINVAL ; +memset (routing->reserved,0 ,sizeof (routing->reserved)); krouting = &state->routing;@@ -1035,6 +1038,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,if (!(sd->flags &V4L2_SUBDEV_FL_STREAMS ))return -ENOIOCTLCMD ; +if (!client_supports_streams) +return -EINVAL ; +if (routing->which !=V4L2_SUBDEV_FORMAT_TRY && ro_subdev)return -EPERM ; --2.47.3
Re: [PATCH v2 02/14] media: v4l2-subdev: Allow accessing routes with STREAMS client capability
Hi Mirela,
Quoted 8 lines · Mirela Rabulea
Hi Sakari,
Quoted 4 lines · Sakari Ailus
Disable access to routes when the STREAMS client capability bit isn't set. Routes aren't relevant otherwise anyway.
Signed-off-by Sakari Ailus<[email protected]>Reviewed-by <[email protected]>
Let me know if you meant something else than:
Signature · 1 line
Sakari Ailus
Sakari Ailus
maintainerPATCH v2 3/14 media: Documentation: Improve LINK_FREQ documentation
In reply to Sakari AilusAdd a reference to the LINK_FREQ control and precise the meaning of the control as for C-PHY the matter is less obvious.
--- Documentation/driver-api/media/tx-rx.rst | 3 ++- .../userspace-api/media/v4l/ext-ctrls-image-process.rst | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-)
Documentation/driver-api/media/tx-rx.rst +2 -1
@@ -93,7 +93,8 @@ where * - variable or constant - description * - link_freq - - The value of the ``V4L2_CID_LINK_FREQ`` integer64 menu item. + - The value of the :ref:`V4L2_CID_LINK_FREQ <v4l2-cid-link-freq>` integer64 + menu item. * - nr_of_lanes - Number of data lanes used on the CSI-2 link. * - 2
Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst +3 -1
@@ -24,7 +24,9 @@ Image Process Control IDs .. _v4l2-cid-link-freq: ``V4L2_CID_LINK_FREQ (integer menu)`` - The frequency of the data bus (e.g. parallel or CSI-2). + The fundamental frequency of the operating symbol rate (serial interfaces + such as CSI-2) or the sampling rate (parallel interfaces such as DVP or + Bt.565) of the data interface. .. _v4l2-cid-pixel-rate:
Signature · 1 line
2.47.3
Re: [PATCH v2 03/14] media: Documentation: Improve LINK_FREQ documentation
Hi Sakari
Quoted 28 lines · Sakari Ailus
Add a reference to the
LINK_FREQcontrol and precise the meaning of the control as for C-PHY the matter is less obvious.Signed-off-by Sakari Ailus <[email protected]>--- Documentation/driver-api/media/tx-rx.rst | 3 ++- .../userspace-api/media/v4l/ext-ctrls-image-process.rst | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-)Documentation/driver-api/media/tx-rx.rst +2
-1@@ -93,7 +93,8 @@ where * - variable or constant - description * - link_freq - - The value of the ``V4L2_CID_LINK_FREQ`` integer64 menu item. + - The value of the :ref:`V4L2_CID_LINK_FREQ <v4l2-cid-link-freq>` integer64 + menu item. * - nr_of_lanes - Number of data lanes used on the CSI-2 link. * - 2Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst +0
-0
Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst Image Process Control IDs · line 27
Quoted 5 lines
Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst +1
-1@@ -24,7 +24,9 @@ Image Process Control IDs .. _v4l2-cid-link-freq: ``V4L2_CID_LINK_FREQ (integer menu)`` - The frequency of the data bus (e.g. parallel or CSI-2). + The fundamental frequency of the operating symbol rate (serial interfaces
Or just: "The symbol rate frequency" ?
Quoted 9 lines
Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst +2
-1+ such as CSI-2) or the sampling rate (parallel interfaces such as DVP or + Bt.565) of the data interface. .. _v4l2-cid-pixel-rate: --2.47.3
Re: [PATCH v2 03/14] media: Documentation: Improve LINK_FREQ documentation
In reply to Sakari AilusHi Sakari,
Quoted 1 line · Sakari Ailus
Add a reference to the
LINK_FREQcontrol and precise the meaning of the
Precise is not a verb, maybe use clarify instead.
Other than that,
Quoted 40 lines
control as for C-PHY the matter is less obvious.
Signed-off-by Sakari Ailus<[email protected]>--- Documentation/driver-api/media/tx-rx.rst | 3 ++- .../userspace-api/media/v4l/ext-ctrls-image-process.rst | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-)Documentation/driver-api/media/tx-rx.rst +2
-1@@ -93,7 +93,8 @@ where * - variable or constant - description * - link_freq - - The value of the ``V4L2_CID_LINK_FREQ`` integer64 menu item. + - The value of the :ref:`V4L2_CID_LINK_FREQ <v4l2-cid-link-freq>` integer64 + menu item. * - nr_of_lanes - Number of data lanes used on the CSI-2 link. * - 2Documentation/userspace-api/media/v4l/ext-ctrls-image-process.rst +3
-2@@ -24,7 +24,9 @@ Image Process Control IDs .. _v4l2-cid-link-freq: ``V4L2_CID_LINK_FREQ (integer menu)`` - The frequency of the data bus (e.g. parallel or CSI-2). + The fundamental frequency of the operating symbol rate (serial interfaces + such as CSI-2) or the sampling rate (parallel interfaces such as DVP or + Bt.565) of the data interface. .. _v4l2-cid-pixel-rate: --2.47.3
Sakari Ailus
maintainerRe: [PATCH v2 03/14] media: Documentation: Improve LINK_FREQ documentation
Hi Mirela,
Thank you for the review.
Quoted 6 lines · Mirela Rabulea
Hi Sakari,
Quoted 1 line · Sakari Ailus
Add a reference to the
LINK_FREQcontrol and precise the meaning of thePrecise is not a verb, maybe use clarify instead.
I'll use that for v3.
Quoted 4 lines
Other than that,
Reviewed-by Mirela Rabulea <[email protected]>
Thanks!
Signature · 3 lines
Kind regards, Sakari Ailus
Sakari Ailus
maintainerPATCH v2 4/14 media: Documentation: Improve pixel rate calculation documentation
In reply to Sakari AilusImprove 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
Re: [PATCH v2 04/14] media: Documentation: Improve pixel rate calculation documentation
Hi Sakari
Quoted 5 lines · Sakari Ailus
Improve documentation on calculating the pixel rate, by adding references to relevant functions and mentioning V4L2 fwnode endpoint instead of OF endpoint.
Signed-off-by Sakari Ailus <[email protected]>
Thanks
j
Quoted 25 lines
--- Documentation/driver-api/media/tx-rx.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)Documentation/driver-api/media/tx-rx.rst +5
-2@@ -104,7 +104,11 @@ where * - k - 16 for D-PHY and 7 for C-PHY. -Information on whether D-PHY or C-PHY is used, and the value of ``nr_of_lanes``, can be obtained from the OF endpoint configuration. +Information on whether D-PHY or C-PHY is used as well as the value of +``nr_of_lanes`` can be obtained from the V4L2 endpoint configuration; see +:c:func:`v4l2_fwnode_endpoint_alloc_parse()`, +:c:func:`v4l2_fwnode_endpoint_parse()` and +:c:func:`v4l2_get_active_data_lanes()`. .. note:: --2.47.3
Re: [PATCH v2 04/14] media: Documentation: Improve pixel rate calculation documentation
In reply to Sakari AilusHi Sakari,
Quoted 5 lines · Sakari Ailus
Improve documentation on calculating the pixel rate, by adding references to relevant functions and mentioning V4L2 fwnode endpoint instead of OF endpoint.
Signed-off-by Sakari Ailus <[email protected]>
Quoted 24 lines
--- Documentation/driver-api/media/tx-rx.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)Documentation/driver-api/media/tx-rx.rst +5
-2@@ -104,7 +104,11 @@ where * - k - 16 for D-PHY and 7 for C-PHY. -Information on whether D-PHY or C-PHY is used, and the value of ``nr_of_lanes``, can be obtained from the OF endpoint configuration. +Information on whether D-PHY or C-PHY is used as well as the value of +``nr_of_lanes`` can be obtained from the V4L2 endpoint configuration; see +:c:func:`v4l2_fwnode_endpoint_alloc_parse()`, +:c:func:`v4l2_fwnode_endpoint_parse()` and +:c:func:`v4l2_get_active_data_lanes()`. .. note:: --2.47.3
Sakari Ailus
maintainerPATCH v2 5/14 media: v4l2-subdev: Refactor returning routes
In reply to Sakari AilusRefactor returning the routes by adding a new function that essentially does a memcopy and sets the number of the number of the routes in the routing table.
--- drivers/media/v4l2-core/v4l2-subdev.c | 40 +++++++++++++++------------ 1 file changed, 22 insertions(+), 18 deletions(-)
drivers/media/v4l2-core/v4l2-subdev.c +22 -18
@@ -629,6 +629,19 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh,v4l2_subdev_get_unlocked_active_state (sd); } +static void subdev_copy_fix_routes (struct v4l2_subdev_routing *routing, +const struct v4l2_subdev_route *src, +u32 copy_routes,u32 num_routes) +{ +struct v4l2_subdev_route *routes = + (struct v4l2_subdev_route *)(uintptr_t )routing->routes; + +for (u32 i =0 ; i < copy_routes; i++) + routes[i] = src[i]; + + routing->num_routes = num_routes; +} +static long subdev_do_ioctl (struct file *file,unsigned int cmd,void *arg,struct v4l2_subdev_state *state) {
@@ -1000,7 +1013,6 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,case VIDIOC_SUBDEV_G_ROUTING : {struct v4l2_subdev_routing *routing = arg; -struct v4l2_subdev_krouting *krouting;if (!v4l2_subdev_enable_streams_api)return -ENOIOCTLCMD ;
@@ -1013,13 +1025,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,memset (routing->reserved,0 ,sizeof (routing->reserved)); - krouting = &state->routing; - -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - krouting->routes, -min (krouting->num_routes, routing->len_routes) * -sizeof (*krouting->routes)); - routing->num_routes = krouting->num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; }
@@ -1090,11 +1098,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,* the routing table. */ if (!v4l2_subdev_has_op (sd, pad, set_routing)) { -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - state->routing.routes, -min (state->routing.num_routes, routing->len_routes) * -sizeof (*state->routing.routes)); - routing->num_routes = state->routing.num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; }
@@ -1108,11 +1114,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,if (rval <0 )return rval; -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - state->routing.routes, -min (state->routing.num_routes, routing->len_routes) * -sizeof (*state->routing.routes)); - routing->num_routes = state->routing.num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; }
Signature · 1 line
2.47.3
Jacopo Mondi
maintainerRe: [PATCH v2 05/14] media: v4l2-subdev: Refactor returning routes
Hi Sakari
Quoted 14 lines · Sakari Ailus
Refactor returning the routes by adding a new function that essentially does a memcopy and sets the number of the number of the routes in the routing table.
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/v4l2-core/v4l2-subdev.c | 40 +++++++++++++++------------ 1 file changed, 22 insertions(+), 18 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +0
-0
drivers/media/v4l2-core/v4l2-subdev.c subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, · line 632
Quoted 4 lines
drivers/media/v4l2-core/v4l2-subdev.c +1
-0@@ -629,6 +629,19 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh,v4l2_subdev_get_unlocked_active_state (sd); } +static void subdev_copy_fix_routes(struct v4l2_subdev_routing *routing,
or just subdev_copy_routes()
drivers/media/v4l2-core/v4l2-subdev.c subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, · line 639
Quoted 7 lines
drivers/media/v4l2-core/v4l2-subdev.c +7
-0+const struct v4l2_subdev_route *src, + u32 copy_routes, u32 num_routes) +{ + struct v4l2_subdev_route *routes = + (struct v4l2_subdev_route *)(uintptr_t )routing->routes; + +for (u32 i =0 ; i < copy_routes; i++)
Shouldn't this copy the min(copy_routes, num_routes) as the callers used to do ?
Even better, shouldn't we just accept one 'dest' and one 'source' v4l2_subdev_routing arguments and make sure we don't copy more than min(dest->num_routes, source->num_routes) ?
Having the number of routes being passed in by the caller opens the door for memory errors.
Quoted 67 lines
drivers/media/v4l2-core/v4l2-subdev.c +14
-19+ routes[i] = src[i]; + + routing->num_routes = num_routes; +} +static long subdev_do_ioctl (struct file *file,unsigned int cmd,void *arg,struct v4l2_subdev_state *state) {@@ -1000,7 +1013,6 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,case VIDIOC_SUBDEV_G_ROUTING : {struct v4l2_subdev_routing *routing = arg; -struct v4l2_subdev_krouting *krouting;if (!v4l2_subdev_enable_streams_api)return -ENOIOCTLCMD ;@@ -1013,13 +1025,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,memset (routing->reserved,0 ,sizeof (routing->reserved)); - krouting = &state->routing; - -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - krouting->routes, -min (krouting->num_routes, routing->len_routes) * -sizeof (*krouting->routes)); - routing->num_routes = krouting->num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; }@@ -1090,11 +1098,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,* the routing table. */ if (!v4l2_subdev_has_op (sd, pad, set_routing)) { -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - state->routing.routes, -min (state->routing.num_routes, routing->len_routes) * -sizeof (*state->routing.routes)); - routing->num_routes = state->routing.num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; }@@ -1108,11 +1114,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,if (rval <0 )return rval; -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - state->routing.routes, -min (state->routing.num_routes, routing->len_routes) * -sizeof (*state->routing.routes)); - routing->num_routes = state->routing.num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; } --2.47.3
Sakari Ailus
maintainerRe: [PATCH v2 05/14] media: v4l2-subdev: Refactor returning routes
Hi Jacopo,
Quoted 24 lines · Jacopo Mondi
Hi Sakari
Quoted 14 lines · Sakari Ailus
Refactor returning the routes by adding a new function that essentially does a memcopy and sets the number of the number of the routes in the routing table.
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/v4l2-core/v4l2-subdev.c | 40 +++++++++++++++------------ 1 file changed, 22 insertions(+), 18 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +0
-0drivers/media/v4l2-core/v4l2-subdev.c subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, · line 632
Quoted 4 lines
drivers/media/v4l2-core/v4l2-subdev.c +1
-0@@ -629,6 +629,19 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh,v4l2_subdev_get_unlocked_active_state (sd); } +static void subdev_copy_fix_routes(struct v4l2_subdev_routing *routing,or just
subdev_copy_routes()
Quoted 10 lines
drivers/media/v4l2-core/v4l2-subdev.c subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, · line 639
Quoted 7 lines
drivers/media/v4l2-core/v4l2-subdev.c +7
-0+const struct v4l2_subdev_route *src, + u32 copy_routes, u32 num_routes) +{ + struct v4l2_subdev_route *routes = + (struct v4l2_subdev_route *)(uintptr_t )routing->routes; + +for (u32 i =0 ; i < copy_routes; i++)Shouldn't this copy the
min(copy_routes, num_routes)as the callers used to do ?
Indeed. I'll fix that for v3.
Quoted 7 lines
Even better, shouldn't we just accept one 'dest' and one 'source'
v4l2_subdev_routingarguments and make sure we don't copy more thanmin(dest->num_routes, source->num_routes)?Having the number of routes being passed in by the caller opens the door for memory errors.
The arguments indeed appear to be the same for all callers; I'll refactor this for v3.
Quoted 65 lines
Quoted 65 lines
drivers/media/v4l2-core/v4l2-subdev.c +14
-18+ routes[i] = src[i]; + + routing->num_routes = num_routes; +} +static long subdev_do_ioctl (struct file *file,unsigned int cmd,void *arg,struct v4l2_subdev_state *state) {@@ -1000,7 +1013,6 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,case VIDIOC_SUBDEV_G_ROUTING : {struct v4l2_subdev_routing *routing = arg; -struct v4l2_subdev_krouting *krouting;if (!v4l2_subdev_enable_streams_api)return -ENOIOCTLCMD ;@@ -1013,13 +1025,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,memset (routing->reserved,0 ,sizeof (routing->reserved)); - krouting = &state->routing; - -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - krouting->routes, -min (krouting->num_routes, routing->len_routes) * -sizeof (*krouting->routes)); - routing->num_routes = krouting->num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; }@@ -1090,11 +1098,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,* the routing table. */ if (!v4l2_subdev_has_op (sd, pad, set_routing)) { -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - state->routing.routes, -min (state->routing.num_routes, routing->len_routes) * -sizeof (*state->routing.routes)); - routing->num_routes = state->routing.num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; }@@ -1108,11 +1114,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,if (rval <0 )return rval; -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - state->routing.routes, -min (state->routing.num_routes, routing->len_routes) * -sizeof (*state->routing.routes)); - routing->num_routes = state->routing.num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; }
Signature · 3 lines
Regards, Sakari Ailus
Re: [PATCH v2 05/14] media: v4l2-subdev: Refactor returning routes
In reply to Sakari AilusHi Sakari,
Quoted 2 lines · Sakari Ailus
Refactor returning the routes by adding a new function that essentially does a memcopy and sets the number of the number of the routes in the
Repetition "The number of the number"
Quoted 17 lines
routing table.
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/v4l2-core/v4l2-subdev.c | 40 +++++++++++++++------------ 1 file changed, 22 insertions(+), 18 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +2
-0@@ -629,6 +629,19 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh,v4l2_subdev_get_unlocked_active_state (sd); } +static void subdev_copy_fix_routes(struct v4l2_subdev_routing *routing, + const struct v4l2_subdev_route *src,
drivers/media/v4l2-core/v4l2-subdev.c subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, · line 643
Quoted 10 lines
drivers/media/v4l2-core/v4l2-subdev.c +10
-0+ u32 copy_routes, u32 num_routes) +{ +struct v4l2_subdev_route *routes = + (struct v4l2_subdev_route *)(uintptr_t )routing->routes; + +for (u32 i =0 ; i < copy_routes; i++) + routes[i] = src[i]; + + routing->num_routes = num_routes; +}
The function just copies routes, no fixing, so I agree with Jacopo's comment, subdev_copy_routes seems like a better name.
Clear names for src/dest sound better, and also address the case when copy_routes>num_routes, at the calling place it was min(state->routing.num_routes, routing->len_routes).
Regards,
Mirela
Quoted 62 lines
drivers/media/v4l2-core/v4l2-subdev.c +10
-19+static long subdev_do_ioctl (struct file *file,unsigned int cmd,void *arg,struct v4l2_subdev_state *state) {@@ -1000,7 +1013,6 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,case VIDIOC_SUBDEV_G_ROUTING : {struct v4l2_subdev_routing *routing = arg; -struct v4l2_subdev_krouting *krouting;if (!v4l2_subdev_enable_streams_api)return -ENOIOCTLCMD ;@@ -1013,13 +1025,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,memset (routing->reserved,0 ,sizeof (routing->reserved)); - krouting = &state->routing; - -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - krouting->routes, -min (krouting->num_routes, routing->len_routes) * -sizeof (*krouting->routes)); - routing->num_routes = krouting->num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; }@@ -1090,11 +1098,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,* the routing table. */ if (!v4l2_subdev_has_op (sd, pad, set_routing)) { -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - state->routing.routes, -min (state->routing.num_routes, routing->len_routes) * -sizeof (*state->routing.routes)); - routing->num_routes = state->routing.num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; }@@ -1108,11 +1114,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,if (rval <0 )return rval; -memcpy ((struct v4l2_subdev_route *)(uintptr_t )routing->routes, - state->routing.routes, -min (state->routing.num_routes, routing->len_routes) * -sizeof (*state->routing.routes)); - routing->num_routes = state->routing.num_routes; +subdev_copy_fix_routes (routing, state->routing.routes, + routing->len_routes, + state->routing.num_routes);return 0 ; } --2.47.3
Sakari Ailus
maintainerRe: [PATCH v2 05/14] media: v4l2-subdev: Refactor returning routes
Hi Mirela,
Quoted 6 lines · Mirela Rabulea
Hi Sakari,
Quoted 2 lines · Sakari Ailus
Refactor returning the routes by adding a new function that essentially does a memcopy and sets the number of the number of the routes in the
Repetition "The number of the number"
Fixed for v3.
Quoted 31 lines
Quoted 17 lines
routing table.
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/v4l2-core/v4l2-subdev.c | 40 +++++++++++++++------------ 1 file changed, 22 insertions(+), 18 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +2
-0@@ -629,6 +629,19 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh,v4l2_subdev_get_unlocked_active_state (sd); } +static void subdev_copy_fix_routes(struct v4l2_subdev_routing *routing, + const struct v4l2_subdev_route *src,drivers/media/v4l2-core/v4l2-subdev.c subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, · line 643
Quoted 10 lines
drivers/media/v4l2-core/v4l2-subdev.c +10
-0+ u32 copy_routes, u32 num_routes) +{ +struct v4l2_subdev_route *routes = + (struct v4l2_subdev_route *)(uintptr_t )routing->routes; + +for (u32 i =0 ; i < copy_routes; i++) + routes[i] = src[i]; + + routing->num_routes = num_routes; +}The function just copies routes, no fixing, so I agree with Jacopo's comment, subdev_copy_routes seems like a better name.
Quoted 3 lines
Clear names for src/dest sound better, and also address the case when copy_routes>num_routes, at the calling place it was
min(state->routing.num_routes, routing->len_routes).
I agree. I'll also change the arguments to just include the routing struct and the state -- all the callers already use these. How about calling it copy_routes_state_to_routing()?
Signature · 3 lines
Regards, Sakari Ailus
Re: Re: [PATCH v2 05/14] media: v4l2-subdev: Refactor returning routes
Hi Sakari,
Quoted 9 lines · Sakari Ailus
Quoted 6 lines
The function just copies routes, no fixing, so I agree with Jacopo's comment,
subdev_copy_routesseems like a better name.Clear names for src/dest sound better, and also address the case when copy_routes>num_routes, at the calling place it was
min(state->routing.num_routes, routing->len_routes).I agree. I'll also change the arguments to just include the routing struct and the state -- all the callers already use these. How about calling it
copy_routes_state_to_routing()?
Ok.
Regards,
Mirela
Quoted 5 lines
--
Regards,Sakari Ailus
Sakari Ailus
maintainerPATCH v2 6/14 media: mc: Separate single link validation into a new function
In reply to Sakari AilusAdd a new function __media_pipeline_validate_one() to validate a single link in a pipeline. This will soon be used for performing validation in multiple phases.
--- drivers/media/mc/mc-entity.c | 80 +++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 33 deletions(-)
drivers/media/mc/mc-entity.c +47 -33
@@ -768,6 +768,49 @@ static int media_pipeline_populate(struct media_pipeline *pipe,return ret; } +static int +__media_pipeline_validate_one (struct media_pad *origin, +struct media_pipeline *pipe, +struct media_pad *pad,struct media_link *link, +bool *has_enabled_link) +{ +struct media_device *mdev = origin->graph_obj.mdev; +struct media_entity *entity = pad->entity; +int ret; + +/* Record if the pad has links and enabled links. */ +if (link->flags &MEDIA_LNK_FL_ENABLED && has_enabled_link) + *has_enabled_link = true; + +/* +* Validate the link if it's enabled and has the +* current pad as its sink. +*/ +if (!(link->flags &MEDIA_LNK_FL_ENABLED )) +return 0 ; + +if (link->sink != pad) +return 0 ; + +if (!entity->ops || !entity->ops->link_validate) +return 0 ; + + ret = entity->ops->link_validate (link); +if (ret) { +dev_dbg (mdev->dev, +"Link '%s':%u -> '%s':%u failed validation: %d\n" , + link->source->entity->name, link->source->index, + link->sink->entity->name, link->sink->index, ret); +return ret; + } + +dev_dbg (mdev->dev,"Link '%s':%u -> '%s':%u is valid\n" , + link->source->entity->name, link->source->index, + link->sink->entity->name, link->sink->index); + +return 0 ; +} +__must_check int __media_pipeline_start (struct media_pad *origin,struct media_pipeline *pipe) {
@@ -838,40 +881,11 @@ __must_check int __media_pipeline_start(struct media_pad *origin,if (link->sink != pad && link->source != pad)continue ; -/* Record if the pad has links and enabled links. */ -if (link->flags &MEDIA_LNK_FL_ENABLED ) - has_enabled_link = true; - -/* -* Validate the link if it's enabled and has the -* current pad as its sink. -*/ -if (!(link->flags &MEDIA_LNK_FL_ENABLED )) -continue ; - -if (link->sink != pad) -continue ; - -if (!entity->ops || !entity->ops->link_validate) -continue ; - - ret = entity->ops->link_validate (link); -if (ret) { -dev_dbg (mdev->dev, -"Link '%s':%u -> '%s':%u failed validation: %d\n" , - link->source->entity->name, - link->source->index, - link->sink->entity->name, - link->sink->index, ret); + ret =__media_pipeline_validate_one (origin, pipe, + origin, link, + &has_enabled_link); +if (ret) goto error; - } - -dev_dbg (mdev->dev, -"Link '%s':%u -> '%s':%u is valid\n" , - link->source->entity->name, - link->source->index, - link->sink->entity->name, - link->sink->index); }/*
Signature · 1 line
2.47.3
Re: [PATCH v2 06/14] media: mc: Separate single link validation into a new function
Hi Sakari,
Quoted 14 lines · Sakari Ailus
Add a new function
__media_pipeline_validate_one()to validate a single link in a pipeline. This will soon be used for performing validation in multiple phases.Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/mc/mc-entity.c | 80 +++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 33 deletions(-)drivers/media/mc/mc-entity.c +0
-0
drivers/media/mc/mc-entity.c static int media_pipeline_populate(struct media_pipeline *pipe, · line 773
Quoted 6 lines
drivers/media/mc/mc-entity.c +3
-0@@ -768,6 +768,49 @@ static int media_pipeline_populate(struct media_pipeline *pipe,return ret; } +static int +__media_pipeline_validate_one(struct media_pad *origin, + struct media_pipeline *pipe,
pipe parameter is not used
Quoted 65 lines
drivers/media/mc/mc-entity.c +40
-18+ struct media_pad *pad, struct media_link *link, + bool *has_enabled_link) +{ + struct media_device *mdev = origin->graph_obj.mdev; +struct media_entity *entity = pad->entity; +int ret; + +/* Record if the pad has links and enabled links. */ +if (link->flags &MEDIA_LNK_FL_ENABLED && has_enabled_link) + *has_enabled_link = true; + +/* +* Validate the link if it's enabled and has the +* current pad as its sink. +*/ +if (!(link->flags &MEDIA_LNK_FL_ENABLED )) +return 0 ; + +if (link->sink != pad) +return 0 ; + +if (!entity->ops || !entity->ops->link_validate) +return 0 ; + + ret = entity->ops->link_validate (link); +if (ret) { +dev_dbg (mdev->dev, +"Link '%s':%u -> '%s':%u failed validation: %d\n" , + link->source->entity->name, link->source->index, + link->sink->entity->name, link->sink->index, ret); +return ret; + } + +dev_dbg (mdev->dev,"Link '%s':%u -> '%s':%u is valid\n" , + link->source->entity->name, link->source->index, + link->sink->entity->name, link->sink->index); + +return 0 ; +} +__must_check int __media_pipeline_start (struct media_pad *origin,struct media_pipeline *pipe) {@@ -838,40 +881,11 @@ __must_check int __media_pipeline_start(struct media_pad *origin,if (link->sink != pad && link->source != pad)continue ; -/* Record if the pad has links and enabled links. */ -if (link->flags &MEDIA_LNK_FL_ENABLED ) - has_enabled_link = true; - -/* -* Validate the link if it's enabled and has the -* current pad as its sink. -*/ -if (!(link->flags &MEDIA_LNK_FL_ENABLED )) -continue ; - -if (link->sink != pad) -continue ; - -if (!entity->ops || !entity->ops->link_validate) -continue ; - - ret = entity->ops->link_validate (link);
drivers/media/mc/mc-entity.c __must_check int __media_pipeline_start(struct media_pad *origin, · line 886
Quoted 10 lines
drivers/media/mc/mc-entity.c +3
-7-if (ret) { -dev_dbg (mdev->dev, -"Link '%s':%u -> '%s':%u failed validation: %d\n" , - link->source->entity->name, - link->source->index, - link->sink->entity->name, - link->sink->index, ret); + ret =__media_pipeline_validate_one (origin, pipe, + origin, link, + &has_enabled_link);
Shouldn't this be __media_pipeline_validate_one(origin, pipe, pad, link, &has_enabled_link) ?
Also, before refactoring, there were 2 checks, I think the first one was unnecessary:
if (link->sink != pad && link->source != pad)
continue;
The second one was more complete, it is the check that should remain in the end, either before calling the new function, or inside the function, but please adjust also the comments according to the actual code:
if (link->sink != pad)
continue;
Regards,
Mirela
Quoted 16 lines
drivers/media/mc/mc-entity.c +1
-9+if (ret) goto error; - } - -dev_dbg (mdev->dev, -"Link '%s':%u -> '%s':%u is valid\n" , - link->source->entity->name, - link->source->index, - link->sink->entity->name, - link->sink->index); }/* -- 2.47.3
Sakari Ailus
maintainerRe: [PATCH v2 06/14] media: mc: Separate single link validation into a new function
Hi Mirela,
Quoted 20 lines · Mirela Rabulea
Hi Sakari,
Quoted 17 lines · Sakari Ailus
Add a new function
__media_pipeline_validate_one()to validate a single link in a pipeline. This will soon be used for performing validation in multiple phases.Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/mc/mc-entity.c | 80 +++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 33 deletions(-)drivers/media/mc/mc-entity.c +0
-0@@ -768,6 +768,49 @@ static int media_pipeline_populate(struct media_pipeline *pipe,return ret; }
Quoted 4 lines
drivers/media/mc/mc-entity.c static int media_pipeline_populate(struct media_pipeline *pipe, · line 773
Quoted 3 lines
drivers/media/mc/mc-entity.c +3
-0+static int +__media_pipeline_validate_one(struct media_pad *origin, + struct media_pipeline *pipe,pipe parameter is not used
I'll remove it for v3.
Quoted 70 lines
Quoted 70 lines
drivers/media/mc/mc-entity.c +40
-23+ struct media_pad *pad, struct media_link *link, + bool *has_enabled_link) +{ + struct media_device *mdev = origin->graph_obj.mdev; +struct media_entity *entity = pad->entity; +int ret; + +/* Record if the pad has links and enabled links. */ +if (link->flags &MEDIA_LNK_FL_ENABLED && has_enabled_link) + *has_enabled_link = true; + +/* +* Validate the link if it's enabled and has the +* current pad as its sink. +*/ +if (!(link->flags &MEDIA_LNK_FL_ENABLED )) +return 0 ; + +if (link->sink != pad) +return 0 ; + +if (!entity->ops || !entity->ops->link_validate) +return 0 ; + + ret = entity->ops->link_validate (link); +if (ret) { +dev_dbg (mdev->dev, +"Link '%s':%u -> '%s':%u failed validation: %d\n" , + link->source->entity->name, link->source->index, + link->sink->entity->name, link->sink->index, ret); +return ret; + } + +dev_dbg (mdev->dev,"Link '%s':%u -> '%s':%u is valid\n" , + link->source->entity->name, link->source->index, + link->sink->entity->name, link->sink->index); + +return 0 ; +} +__must_check int __media_pipeline_start (struct media_pad *origin,struct media_pipeline *pipe) {@@ -838,40 +881,11 @@ __must_check int __media_pipeline_start(struct media_pad *origin,if (link->sink != pad && link->source != pad)continue ; -/* Record if the pad has links and enabled links. */ -if (link->flags &MEDIA_LNK_FL_ENABLED ) - has_enabled_link = true; - -/* -* Validate the link if it's enabled and has the -* current pad as its sink. -*/ -if (!(link->flags &MEDIA_LNK_FL_ENABLED )) -continue ; - -if (link->sink != pad) -continue ; - -if (!entity->ops || !entity->ops->link_validate) -continue ; - - ret = entity->ops->link_validate (link); -if (ret) { - dev_dbg(mdev->dev, - "Link '%s':%u -> '%s':%u failed validation: %d\n", - link->source->entity->name, - link->source->index,
Quoted 8 lines
drivers/media/mc/mc-entity.c __must_check int __media_pipeline_start(struct media_pad *origin, · line 886
Quoted 5 lines
drivers/media/mc/mc-entity.c +3
-2- link->sink->entity->name, - link->sink->index, ret); + ret =__media_pipeline_validate_one (origin, pipe, + origin, link, + &has_enabled_link);Shouldn't this be
__media_pipeline_validate_one(origin, pipe, pad, link, &has_enabled_link)?
Yes, good find! This would have been bitten us later...
Quoted 11 lines
Also, before refactoring, there were 2 checks, I think the first one was unnecessary:
if (
link->sink!= pad &&link->source!= pad) continue;
The second one was more complete, it is the check that should remain in the end, either before calling the new function, or inside the function, but please adjust also the comments according to the actual code:
if (link->sink!= pad)
continue;
There are two checks in order to collect information on enabled links to the pad (first check) and perform validation on sink pads only (second check). Both should remain.
There's additional cleanup that can be done on the conditions here; I'll prepend a new patch for that.
Signature · 3 lines
Kind regards, Sakari Ailus
Sakari Ailus
maintainerPATCH v2 7/14 media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE
In reply to Sakari AilusAdd MEDIA_LNK_FL_VALIDATE_LATE flag to support late validation of links. This is serving the use case where video devices are configured and started streaming indepenently of each other but this sequence may be run in series, in such a way that a video device in a pipeline starts streaming before another one is configured.
Before this flag, drivers have resorted to implementing the link validation separately for the video nodes as part of streaming start sequence.
media_pipeline_start() shall be called on each leaf entity connected to the graph with a link where MEDIA_LNK_FL_VALIDATE_LATE is set before uphardware operation.
--- .../media/mediactl/media-ioc-setup-link.rst | 4 ++ .../media/mediactl/media-types.rst | 5 ++ drivers/media/mc/mc-entity.c | 58 ++++++++++++++++++- include/uapi/linux/media.h | 1 + 4 files changed, 66 insertions(+), 2 deletions(-)
Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst +4 -0
@@ -49,6 +49,10 @@ Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled while streaming media data. Attempting to enable or disable a streaming non-dynamic link will return an ``EBUSY`` error code. +The ``VALIDATE_LATE`` flag is used to signal that the validation of the link may +be delayed until actual hardware operation even if the rest of the pipeline +would be validated at an earlier point of time. + If the specified link can't be found the driver returns with an ``EINVAL`` error code.
Documentation/userspace-api/media/mediactl/media-types.rst +5 -0
@@ -391,6 +391,7 @@ must be set for every pad. .. _MEDIA-LNK-FL-ENABLED: .. _MEDIA-LNK-FL-IMMUTABLE: .. _MEDIA-LNK-FL-DYNAMIC: +.. _MEDIA-LNK-FL-VALIDATE-LATE: .. _MEDIA-LNK-FL-LINK-TYPE: .. flat-table:: Media link flags
@@ -410,6 +411,10 @@ must be set for every pad. - The link enabled state can be modified during streaming. This flag is set by drivers and is read-only for applications. + * - ``MEDIA_LNK_FL_VALIDATE_LATE`` + - The validation of the link may be delayed up to until the start of + hardware operation. + * - ``MEDIA_LNK_FL_LINK_TYPE`` - This is a bitmask that defines the type of the link. The following link types are currently supported:
drivers/media/mc/mc-entity.c +56 -2
91 lines not on this page · raw message
include/uapi/linux/media.h +1 -0
@@ -219,6 +219,7 @@ struct media_pad_desc {#define MEDIA_LNK_FL_ENABLED (1U << 0)#define MEDIA_LNK_FL_IMMUTABLE (1U << 1)#define MEDIA_LNK_FL_DYNAMIC (1U << 2) +#define MEDIA_LNK_FL_VALIDATE_LATE (1U << 3)#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)# define MEDIA_LNK_FL_DATA_LINK (0U << 28)
Signature · 1 line
2.47.3
Re: [PATCH v2 07/14] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE
Hi Sakari,
Quoted 84 lines · Sakari Ailus
Add
MEDIA_LNK_FL_VALIDATE_LATEflag to support late validation of links. This is serving the use case where video devices are configured and started streaming indepenently of each other but this sequence may be run in series, in such a way that a video device in a pipeline starts streaming before another one is configured.Before this flag, drivers have resorted to implementing the link validation separately for the video nodes as part of streaming start sequence.
media_pipeline_start()shall be called on each leaf entity connected to the graph with a link whereMEDIA_LNK_FL_VALIDATE_LATEis set before uphardware operation.Signed-off-by Sakari Ailus <[email protected]>--- .../media/mediactl/media-ioc-setup-link.rst | 4 ++ .../media/mediactl/media-types.rst | 5 ++ drivers/media/mc/mc-entity.c | 58 ++++++++++++++++++- include/uapi/linux/media.h | 1 + 4 files changed, 66 insertions(+), 2 deletions(-)Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst +4
-0@@ -49,6 +49,10 @@ Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled while streaming media data. Attempting to enable or disable a streaming non-dynamic link will return an ``EBUSY`` error code. +The ``VALIDATE_LATE`` flag is used to signal that the validation of the link may +be delayed until actual hardware operation even if the rest of the pipeline +would be validated at an earlier point of time. + If the specified link can't be found the driver returns with an ``EINVAL`` error code.Documentation/userspace-api/media/mediactl/media-types.rst +5
-0@@ -391,6 +391,7 @@ must be set for every pad. .. _MEDIA-LNK-FL-ENABLED: .. _MEDIA-LNK-FL-IMMUTABLE: .. _MEDIA-LNK-FL-DYNAMIC: +.. _MEDIA-LNK-FL-VALIDATE-LATE: .. _MEDIA-LNK-FL-LINK-TYPE: .. flat-table:: Media link flags@@ -410,6 +411,10 @@ must be set for every pad. - The link enabled state can be modified during streaming. This flag is set by drivers and is read-only for applications. + * - ``MEDIA_LNK_FL_VALIDATE_LATE`` + - The validation of the link may be delayed up to until the start of + hardware operation. + * - ``MEDIA_LNK_FL_LINK_TYPE`` - This is a bitmask that defines the type of the link. The following link types are currently supported:drivers/media/mc/mc-entity.c +4
-1@@ -772,7 +772,7 @@ static int __media_pipeline_validate_one(struct media_pad *origin, struct media_pipeline *pipe, struct media_pad *pad, struct media_link *link, - bool *has_enabled_link) + bool *has_enabled_link, bool skip_validation) { struct media_device *mdev = origin->graph_obj.mdev;struct media_entity *entity = pad->entity;@@ -782,6 +782,9 @@ __media_pipeline_validate_one(struct media_pad *origin,if (link->flags &MEDIA_LNK_FL_ENABLED && has_enabled_link) *has_enabled_link = true; +if (skip_validation) +return 0 ; +/* * Validate the link if it's enabled and has the * current pad as its sink.
drivers/media/mc/mc-entity.c __must_check int __media_pipeline_start(struct media_pad *origin, · line 836
Quoted 1 line
drivers/media/mc/mc-entity.c +0
-0@@ -833,7 +836,24 @@ __must_check int __media_pipeline_start(struct media_pad *origin,* valid, so just increase the start count.
The above comment is no longer accurate.
drivers/media/mc/mc-entity.c __must_check int __media_pipeline_start(struct media_pad *origin, · line 842
Quoted 6 lines
drivers/media/mc/mc-entity.c +4
-0*/ if (pipe->start_count) { +struct media_link *link; + + link =__media_entity_next_link (origin->entity,NULL , +MEDIA_LNK_FL_DATA_LINK );
This __media_entity_next_link() will retrieve the first data link. Is this guaranteed to be connected to origin pad? Is this intended, or is a check for (link->source == origin || link->sink == origin) also necessary?
Quoted 18 lines
drivers/media/mc/mc-entity.c +13
-0+if (link && link->flags &MEDIA_LNK_FL_VALIDATE_LATE ) { +dev_dbg (mdev->dev, +"Validating pad '%s':%u late\n" , + origin->entity->name, origin->index); + + ret =__media_pipeline_validate_one (link->sink, pipe, + link->sink, link, +NULL , false); +if (ret) +return ret; + } + pipe->start_count++; +return 0 ; }
drivers/media/mc/mc-entity.c __must_check int __media_pipeline_start(struct media_pad *origin, · line 905
Quoted 5 lines
drivers/media/mc/mc-entity.c +2
-0@@ -881,9 +901,16 @@ __must_check int __media_pipeline_start(struct media_pad *origin,if (link->sink != pad && link->source != pad)continue ; +/* Skip late-validated links not connected to origin. */ + bool skip_validation =
Move skip_validation declaration at beginning of the block.
Regards,
Mirela
Quoted 61 lines
drivers/media/mc/mc-entity.c +33
-1+ link->flags &MEDIA_LNK_FL_VALIDATE_LATE && + (link->sink == origin || + link->source == origin); + ret =__media_pipeline_validate_one (origin, pipe, origin, link, - &has_enabled_link); + &has_enabled_link, + skip_validation);if (ret) goto error; }@@ -1163,6 +1190,33 @@ media_create_pad_link(struct media_entity *source, u16 source_pad,if (WARN_ON (!(sink->pads[sink_pad].flags &MEDIA_PAD_FL_SINK )))return -EINVAL ; +/* +* With the late validate flag, either source or sink shall have exactly +* one pad and no links before this one. Similarly, no links may be +* added to entities with a single pad and an existing late-validated +* link. +*/ +if (flags &MEDIA_LNK_FL_VALIDATE_LATE ) { +if (!(source->num_pads ==1 && !source->num_links) && + !(sink->num_pads ==1 && !sink->num_links)) +return -EINVAL ; + }else { +struct media_entity *entities[] = { source, sink }; + +for (unsigned int i =0 ; i <ARRAY_SIZE (entities); i++) { +if (entities[i]->num_pads !=1 ) +continue ; + +struct media_link *__link = +__media_entity_next_link (entities[i],NULL , +MEDIA_LNK_FL_DATA_LINK ); + +if (__link && + __link->flags &MEDIA_LNK_FL_VALIDATE_LATE ) +return -EINVAL ; + } + } + link =media_add_link (&source->links);if (link ==NULL )return -ENOMEM ;include/uapi/linux/media.h +1
-1@@ -219,6 +219,7 @@ struct media_pad_desc {#define MEDIA_LNK_FL_ENABLED (1U << 0)#define MEDIA_LNK_FL_IMMUTABLE (1U << 1)#define MEDIA_LNK_FL_DYNAMIC (1U << 2) +#define MEDIA_LNK_FL_VALIDATE_LATE (1U << 3)#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)# define MEDIA_LNK_FL_DATA_LINK (0U << 28) --2.47.3
Sakari Ailus
maintainerRe: [PATCH v2 07/14] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE
Hi Mirela,
Quoted 80 lines · Mirela Rabulea
Hi Sakari,
Quoted 77 lines · Sakari Ailus
Add
MEDIA_LNK_FL_VALIDATE_LATEflag to support late validation of links. This is serving the use case where video devices are configured and started streaming indepenently of each other but this sequence may be run in series, in such a way that a video device in a pipeline starts streaming before another one is configured.Before this flag, drivers have resorted to implementing the link validation separately for the video nodes as part of streaming start sequence.
media_pipeline_start()shall be called on each leaf entity connected to the graph with a link whereMEDIA_LNK_FL_VALIDATE_LATEis set before uphardware operation.Signed-off-by Sakari Ailus <[email protected]>--- .../media/mediactl/media-ioc-setup-link.rst | 4 ++ .../media/mediactl/media-types.rst | 5 ++ drivers/media/mc/mc-entity.c | 58 ++++++++++++++++++- include/uapi/linux/media.h | 1 + 4 files changed, 66 insertions(+), 2 deletions(-)Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst +4
-0@@ -49,6 +49,10 @@ Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled while streaming media data. Attempting to enable or disable a streaming non-dynamic link will return an ``EBUSY`` error code. +The ``VALIDATE_LATE`` flag is used to signal that the validation of the link may +be delayed until actual hardware operation even if the rest of the pipeline +would be validated at an earlier point of time. + If the specified link can't be found the driver returns with an ``EINVAL`` error code.Documentation/userspace-api/media/mediactl/media-types.rst +5
-0@@ -391,6 +391,7 @@ must be set for every pad. .. _MEDIA-LNK-FL-ENABLED: .. _MEDIA-LNK-FL-IMMUTABLE: .. _MEDIA-LNK-FL-DYNAMIC: +.. _MEDIA-LNK-FL-VALIDATE-LATE: .. _MEDIA-LNK-FL-LINK-TYPE: .. flat-table:: Media link flags@@ -410,6 +411,10 @@ must be set for every pad. - The link enabled state can be modified during streaming. This flag is set by drivers and is read-only for applications. + * - ``MEDIA_LNK_FL_VALIDATE_LATE`` + - The validation of the link may be delayed up to until the start of + hardware operation. + * - ``MEDIA_LNK_FL_LINK_TYPE`` - This is a bitmask that defines the type of the link. The following link types are currently supported:drivers/media/mc/mc-entity.c +1
-1@@ -772,7 +772,7 @@ static int __media_pipeline_validate_one(struct media_pad *origin, struct media_pipeline *pipe, struct media_pad *pad, struct media_link *link, - bool *has_enabled_link) + bool *has_enabled_link, bool skip_validation) { struct media_device *mdev = origin->graph_obj.mdev;struct media_entity *entity = pad->entity;@@ -782,6 +782,9 @@ __media_pipeline_validate_one(struct media_pad *origin,if (link->flags &MEDIA_LNK_FL_ENABLED && has_enabled_link) *has_enabled_link = true;
Quoted 9 lines
drivers/media/mc/mc-entity.c __must_check int __media_pipeline_start(struct media_pad *origin, · line 836
Quoted 8 lines
drivers/media/mc/mc-entity.c +3
-0+if (skip_validation) +return 0 ; +/* * Validate the link if it's enabled and has the * current pad as its sink. @@ -833,7 +836,24 @@ __must_check int __media_pipeline_start(struct media_pad *origin,* valid, so just increase the start count. The above comment is no longer accurate.
I'll see how to reword this for v3.
Quoted 9 lines
drivers/media/mc/mc-entity.c __must_check int __media_pipeline_start(struct media_pad *origin, · line 842
Quoted 6 lines
drivers/media/mc/mc-entity.c +4
-0*/ if (pipe->start_count) { +struct media_link *link; + + link =__media_entity_next_link (origin->entity,NULL , +MEDIA_LNK_FL_DATA_LINK );This
__media_entity_next_link()will retrieve the first data link. Is this guaranteed to be connected to origin pad? Is this intended, or is a check for (link->source== origin ||link->sink== origin) also necessary?
I'd say so, when it comes to video nodes, but theoretically the flag could be set on other entities as well, albeit probably erroneously. I think we could add a check there's exacly one pad in the entity and that pad has a single link.
Quoted 17 lines
Quoted 17 lines
drivers/media/mc/mc-entity.c +13
-0+if (link && link->flags &MEDIA_LNK_FL_VALIDATE_LATE ) { +dev_dbg (mdev->dev, +"Validating pad '%s':%u late\n" , + origin->entity->name, origin->index); + + ret =__media_pipeline_validate_one (link->sink, pipe, + link->sink, link, +NULL , false); +if (ret) +return ret; + } + pipe->start_count++; +return 0 ; }
Quoted 8 lines
drivers/media/mc/mc-entity.c __must_check int __media_pipeline_start(struct media_pad *origin, · line 905
Quoted 6 lines
drivers/media/mc/mc-entity.c +2
-0@@ -881,9 +901,16 @@ __must_check int __media_pipeline_start(struct media_pad *origin,if (link->sink != pad && link->source != pad)continue ; +/* Skip late-validated links not connected to origin. */ + bool skip_validation =Move
skip_validationdeclaration at beginning of the block.
I'd think it's fine to declare it here, too, but I can move it a few lines up as well.
Quoted 17 lines
Regards,
Mirela
Quoted 12 lines
drivers/media/mc/mc-entity.c +6
-1+ link->flags &MEDIA_LNK_FL_VALIDATE_LATE && + (link->sink == origin || + link->source == origin); + ret =__media_pipeline_validate_one (origin, pipe, origin, link, - &has_enabled_link); + &has_enabled_link, + skip_validation);if (ret) goto error; }
Signature · 3 lines
Regards, Sakari Ailus
Sakari Ailus
maintainerPATCH v2 8/14 media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP
In reply to Sakari AilusThe implementation of MEDIA_IOC_LINK_SETUP currently requires that all flags that are set by the driver are correctly set as the driver expect. This poses a problem for adding new flags as programs could not work with links that have unknown flags even when the use of these flags wouldn't affect the program.
Ignore the non-settable link flags.
--- drivers/media/mc/mc-entity.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/media/mc/mc-entity.c +5 -5
@@ -1378,7 +1378,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags)int __media_entity_setup_link (struct media_link *link,u32 flags) { -const u32 mask =MEDIA_LNK_FL_ENABLED ; +const u32 settable_flags =MEDIA_LNK_FL_ENABLED ;struct media_device *mdev;struct media_pad *source, *sink;int ret = -EBUSY ;
@@ -1386,10 +1386,6 @@ int __media_entity_setup_link(struct media_link *link, u32 flags)if (link ==NULL )return -EINVAL ; -/* The non-modifiable link flags must not be modified. */ -if ((link->flags & ~mask) != (flags & ~mask)) -return -EINVAL ; -if (link->flags &MEDIA_LNK_FL_IMMUTABLE )return link->flags == flags ?0 : -EINVAL ;
@@ -1403,6 +1399,10 @@ int __media_entity_setup_link(struct media_link *link, u32 flags) (media_pad_is_streaming(source) || media_pad_is_streaming(sink)))return -EBUSY ; +/* Only allow changing user-settable flags. */ + flags &= settable_flags; + flags |= link->flags & ~settable_flags; + mdev = source->graph_obj.mdev;if (mdev->ops && mdev->ops->link_notify) {
Signature · 1 line
2.47.3
Re: [PATCH v2 08/14] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP
Hi Sakari,
Quoted 2 lines · Sakari Ailus
The implementation of
MEDIA_IOC_LINK_SETUPcurrently requires that all flags that are set by the driver are correctly set as the driver expect.
expect->expects
Quoted 36 lines
This poses a problem for adding new flags as programs could not work with links that have unknown flags even when the use of these flags wouldn't affect the program.
Ignore the non-settable link flags.
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/mc/mc-entity.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/media/mc/mc-entity.c +1
-5@@ -1378,7 +1378,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags)int __media_entity_setup_link (struct media_link *link,u32 flags) { -const u32 mask =MEDIA_LNK_FL_ENABLED ; +const u32 settable_flags =MEDIA_LNK_FL_ENABLED ;struct media_device *mdev;struct media_pad *source, *sink;int ret = -EBUSY ;@@ -1386,10 +1386,6 @@ int __media_entity_setup_link(struct media_link *link, u32 flags)if (link ==NULL )return -EINVAL ; -/* The non-modifiable link flags must not be modified. */ -if ((link->flags & ~mask) != (flags & ~mask)) -return -EINVAL ; -if (link->flags &MEDIA_LNK_FL_IMMUTABLE )return link->flags == flags ?0 : -EINVAL ;
drivers/media/mc/mc-entity.c int __media_entity_setup_link(struct media_link *link, u32 flags) · line 1405
Quoted 7 lines
drivers/media/mc/mc-entity.c +4
-0@@ -1403,6 +1399,10 @@ int __media_entity_setup_link(struct media_link *link, u32 flags) (media_pad_is_streaming(source) || media_pad_is_streaming(sink)))return -EBUSY ; +/* Only allow changing user-settable flags. */ + flags &= settable_flags; + flags |= link->flags & ~settable_flags; +
The immutable check now compares before filtering, previously this was after the filtering. Is this change intentional?
Regards,
Mirela
Quoted 6 lines
drivers/media/mc/mc-entity.c +0
-1mdev = source->graph_obj.mdev;if (mdev->ops && mdev->ops->link_notify) { --2.47.3
Sakari Ailus
maintainerRe: [PATCH v2 08/14] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP
Hi Mirela,
Quoted 45 lines · Mirela Rabulea
Hi Sakari,
Quoted 2 lines · Sakari Ailus
The implementation of
MEDIA_IOC_LINK_SETUPcurrently requires that all flags that are set by the driver are correctly set as the driver expect.
expect->expectsQuoted 39 lines
This poses a problem for adding new flags as programs could not work with links that have unknown flags even when the use of these flags wouldn't affect the program.
Ignore the non-settable link flags.
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/mc/mc-entity.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/media/mc/mc-entity.c +1
-5@@ -1378,7 +1378,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags)int __media_entity_setup_link (struct media_link *link,u32 flags) { -const u32 mask =MEDIA_LNK_FL_ENABLED ; +const u32 settable_flags =MEDIA_LNK_FL_ENABLED ;struct media_device *mdev;struct media_pad *source, *sink;int ret = -EBUSY ;@@ -1386,10 +1386,6 @@ int __media_entity_setup_link(struct media_link *link, u32 flags)if (link ==NULL )return -EINVAL ; -/* The non-modifiable link flags must not be modified. */ -if ((link->flags & ~mask) != (flags & ~mask)) -return -EINVAL ; -if (link->flags &MEDIA_LNK_FL_IMMUTABLE )return link->flags == flags ?0 : -EINVAL ;@@ -1403,6 +1399,10 @@ int __media_entity_setup_link(struct media_link *link, u32 flags) (media_pad_is_streaming(source) || media_pad_is_streaming(sink)))return -EBUSY ;
Quoted 7 lines
drivers/media/mc/mc-entity.c int __media_entity_setup_link(struct media_link *link, u32 flags) · line 1405
Quoted 4 lines
drivers/media/mc/mc-entity.c +4
-0+/* Only allow changing user-settable flags. */ + flags &= settable_flags; + flags |= link->flags & ~settable_flags; +The immutable check now compares before filtering, previously this was after the filtering. Is this change intentional?
Indeed; this patch looked different earlier and I forgot to move the condition back to where it was. I'll do that for v3.
Signature · 3 lines
Regards, Sakari Ailus
Sakari Ailus
maintainerPATCH v2 9/14 media: Document enable_streams and disable_streams behaviour
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 | 7 +++++++ 1 file changed, 7 insertions(+)
include/media/v4l2-subdev.h +7 -0
@@ -814,6 +814,10 @@ struct v4l2_subdev_state {* V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask * argument. * +* Starting the requested streams may require starting additional +* streams. Streams that are started together due to hardware are called a +* stream group. +* * @disable_streams: Disable the streams defined in streams_mask on the given * source pad. Subdevs that implement this operation must use the active * state management provided by the subdev core (enabled through a call to
@@ -823,6 +827,9 @@ struct v4l2_subdev_state {* Drivers that support only a single stream without setting the * V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask * argument. +* +* A stream group is disabled when one or more streams in the stream +* group are disabled. */ struct v4l2_subdev_pad_ops { int (*enum_mbus_code)(struct v4l2_subdev *sd,
Signature · 1 line
2.47.3
Re: [PATCH v2 09/14] media: Document enable_streams and disable_streams behaviour
Hi Sakari,
In the subject, perhaps use improve documentation...as some documentation already exists. Other than that,
Regards,
Mirela
Quoted 38 lines · Sakari Ailus
Document that
enable_streamsmay start additional streams anddisable_streamsmay not disable requested streams if other related streams are still enabled.Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Jacopo Mondi <[email protected]>--- include/media/v4l2-subdev.h | 7 +++++++ 1 file changed, 7 insertions(+)include/media/v4l2-subdev.h +7
-1@@ -814,6 +814,10 @@ struct v4l2_subdev_state {* V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask * argument. * +* Starting the requested streams may require starting additional +* streams. Streams that are started together due to hardware are called a +* stream group. +* * @disable_streams: Disable the streams defined in streams_mask on the given * source pad. Subdevs that implement this operation must use the active * state management provided by the subdev core (enabled through a call to @@ -823,6 +827,9 @@ struct v4l2_subdev_state {* Drivers that support only a single stream without setting the * V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask * argument. +* +* A stream group is disabled when one or more streams in the stream +* group are disabled. */ struct v4l2_subdev_pad_ops { int (*enum_mbus_code)(struct v4l2_subdev *sd, --2.47.3
Sakari Ailus
maintainerRe: [PATCH v2 09/14] media: Document enable_streams and disable_streams behaviour
Hi Mirela,
Quoted 6 lines · Mirela Rabulea
Hi Sakari,
In the subject, perhaps use improve documentation...as some documentation already exists. Other than that,
Reviewed-by Mirela Rabulea <[email protected]>
Thanks.
I think this needs to be documented elsewhere, too. Generally there's little documentation on things like this so far.
Signature · 1 line
Sakari Ailus
Sakari Ailus
maintainerRe: [PATCH v2 09/14] media: Document enable_streams and disable_streams behaviour
In reply to Mirela RabuleaHi Mirela,
Quoted 4 lines · Mirela Rabulea
Hi Sakari,
In the subject, perhaps use improve documentation...as some documentation already exists. Other than that,
I'll use "Improve enable_streams and disable_streams documentation".
Quoted 2 lines
Reviewed-by Mirela Rabulea <[email protected]>
Thanks!
Signature · 3 lines
Regards, Sakari Ailus
Sakari Ailus
maintainerPATCH v2 10/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.client_caps &V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH )) fi->which =V4L2_SUBDEV_FORMAT_ACTIVE ;
@@ -651,7 +651,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,struct v4l2_subdev_fh *subdev_fh =to_v4l2_subdev_fh (vfh);bool ro_subdev =test_bit (V4L2_FL_SUBDEV_RO_DEVNODE , &vdev->flags);bool streams_subdev = sd->flags &V4L2_SUBDEV_FL_STREAMS ; -bool client_supports_streams = subdev_fh->client_caps & +bool client_supports_streams = subdev_fh->ci.client_caps &V4L2_SUBDEV_CLIENT_CAP_STREAMS ;int rval;
@@ -1124,7 +1124,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,case VIDIOC_SUBDEV_G_CLIENT_CAP : {struct v4l2_subdev_client_capability *client_cap = arg; - client_cap->capabilities = subdev_fh->client_caps; + client_cap->capabilities = subdev_fh->ci.client_caps;return 0 ; }
@@ -1144,7 +1144,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, client_cap->capabilities &= (V4L2_SUBDEV_CLIENT_CAP_STREAMS |V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH ); - subdev_fh->client_caps = client_cap->capabilities; + subdev_fh->ci.client_caps = client_cap->capabilities;return 0 ; }
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 +* @client_caps: bitmask of ``V4L2_SUBDEV_CLIENT_CAP_*`` +*/ +struct v4l2_subdev_client_info { +u64 client_caps; +}; +/** * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations *
@@ -1129,14 +1137,14 @@ struct v4l2_subdev {* @vfh: pointer to &struct v4l2_fh * @state: pointer to &struct v4l2_subdev_state * @owner: module pointer to the owner of this file handle -* @client_caps: bitmask of ``V4L2_SUBDEV_CLIENT_CAP_*`` +* @ci: sub-device client info related to this file handle */ struct v4l2_subdev_fh {struct v4l2_fh vfh;struct module *owner;#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API )struct v4l2_subdev_state *state; -u64 client_caps; +struct v4l2_subdev_client_info ci;#endif };
Signature · 1 line
2.47.3
Re: [PATCH v2 10/14] media: v4l2-subdev: Move subdev client capabilities into a new struct
Quoted 10 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.Signed-off-by Sakari Ailus <[email protected]>
Quoted 84 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.client_caps &V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH )) fi->which =V4L2_SUBDEV_FORMAT_ACTIVE ;@@ -651,7 +651,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,struct v4l2_subdev_fh *subdev_fh =to_v4l2_subdev_fh (vfh);bool ro_subdev =test_bit (V4L2_FL_SUBDEV_RO_DEVNODE , &vdev->flags);bool streams_subdev = sd->flags &V4L2_SUBDEV_FL_STREAMS ; -bool client_supports_streams = subdev_fh->client_caps & +bool client_supports_streams = subdev_fh->ci.client_caps &V4L2_SUBDEV_CLIENT_CAP_STREAMS ;int rval;@@ -1124,7 +1124,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,case VIDIOC_SUBDEV_G_CLIENT_CAP : {struct v4l2_subdev_client_capability *client_cap = arg; - client_cap->capabilities = subdev_fh->client_caps; + client_cap->capabilities = subdev_fh->ci.client_caps;return 0 ; }@@ -1144,7 +1144,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, client_cap->capabilities &= (V4L2_SUBDEV_CLIENT_CAP_STREAMS |V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH ); - subdev_fh->client_caps = client_cap->capabilities; + subdev_fh->ci.client_caps = client_cap->capabilities;return 0 ; }include/media/v4l2-subdev.h +10
-3@@ -734,6 +734,14 @@ struct v4l2_subdev_state {struct v4l2_subdev_stream_configs stream_configs; }; +/** +* struct v4l2_subdev_client_info - Sub-device client information +* @client_caps: bitmask of ``V4L2_SUBDEV_CLIENT_CAP_*`` +*/ +struct v4l2_subdev_client_info { +u64 client_caps; +}; +/** * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations * @@ -1129,14 +1137,14 @@ struct v4l2_subdev {* @vfh: pointer to &struct v4l2_fh * @state: pointer to &struct v4l2_subdev_state * @owner: module pointer to the owner of this file handle -* @client_caps: bitmask of ``V4L2_SUBDEV_CLIENT_CAP_*`` +* @ci: sub-device client info related to this file handle */ struct v4l2_subdev_fh {struct v4l2_fh vfh;struct module *owner;#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API )struct v4l2_subdev_state *state; -u64 client_caps; +struct v4l2_subdev_client_info ci;#endif }; --2.47.3
Sakari Ailus
maintainerPATCH v2 11/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/v4l2-core/v4l2-subdev.c | 63 ++++++++++++++++++--------- include/media/v4l2-subdev.h | 9 +++- 2 files changed, 51 insertions(+), 21 deletions(-)
drivers/media/v4l2-core/v4l2-subdev.c +43 -20
@@ -245,19 +245,21 @@ static inline int check_format(struct v4l2_subdev *sd, }static int call_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {return check_format (sd, state, format) ? : - sd->ops->pad->get_fmt (sd, state, format); + sd->ops->pad->get_fmt (sd, ci, state, format); }static int call_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {return check_format (sd, state, format) ? : - sd->ops->pad->set_fmt (sd, state, format); + sd->ops->pad->set_fmt (sd, ci, state, format); } static int call_enum_mbus_code(struct v4l2_subdev *sd,
@@ -308,19 +310,21 @@ static inline int check_selection(struct v4l2_subdev *sd, }static int call_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {return check_selection (sd, state, sel) ? : - sd->ops->pad->get_selection (sd, state, sel); + sd->ops->pad->get_selection (sd, ci, state, sel); }static int call_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {return check_selection (sd, state, sel) ? : - sd->ops->pad->set_selection (sd, state, sel); + sd->ops->pad->set_selection (sd, ci, state, sel); } static inline int check_frame_interval(struct v4l2_subdev *sd,
@@ -523,6 +527,21 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)v4l2_subdev_unlock_state (state); \ return ret; \ } +#define DEFINE_STATE_WRAPPER_CI (f, arg_type) \ + static int call_##f##_state(struct v4l2_subdev *sd, \ + const struct v4l2_subdev_client_info *ci, \ + struct v4l2_subdev_state *_state, \ + arg_type *arg) \ + { \ + struct v4l2_subdev_state *state = _state; \ + int ret; \ + if (!_state) \ + state = v4l2_subdev_lock_and_get_active_state(sd); \ + ret = call_##f(sd, ci, state, arg); \ + if (!_state && state) \ + v4l2_subdev_unlock_state(state); \ + return ret; \ + }#else /* CONFIG_MEDIA_CONTROLLER */
@@ -536,13 +555,13 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)#endif /* CONFIG_MEDIA_CONTROLLER */ -DEFINE_STATE_WRAPPER(get_fmt, struct v4l2_subdev_format); -DEFINE_STATE_WRAPPER(set_fmt, struct v4l2_subdev_format); +DEFINE_STATE_WRAPPER_CI(get_fmt, struct v4l2_subdev_format); +DEFINE_STATE_WRAPPER_CI(set_fmt, struct v4l2_subdev_format); DEFINE_STATE_WRAPPER(enum_mbus_code, struct v4l2_subdev_mbus_code_enum); DEFINE_STATE_WRAPPER(enum_frame_size, struct v4l2_subdev_frame_size_enum); DEFINE_STATE_WRAPPER(enum_frame_interval, struct v4l2_subdev_frame_interval_enum); -DEFINE_STATE_WRAPPER(get_selection, struct v4l2_subdev_selection); -DEFINE_STATE_WRAPPER(set_selection, struct v4l2_subdev_selection); +DEFINE_STATE_WRAPPER_CI(get_selection, struct v4l2_subdev_selection); +DEFINE_STATE_WRAPPER_CI(set_selection, struct v4l2_subdev_selection);static const struct v4l2_subdev_pad_ops v4l2_subdev_call_pad_wrappers = { .get_fmt = call_get_fmt_state,
@@ -804,7 +823,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,memset (format->reserved,0 ,sizeof (format->reserved));memset (format->format.reserved,0 ,sizeof (format->format.reserved)); -return v4l2_subdev_call (sd, pad, get_fmt, state, format); +return v4l2_subdev_call (sd, pad, get_fmt, &subdev_fh->ci, state, + format); }case VIDIOC_SUBDEV_S_FMT : {
@@ -818,7 +838,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,memset (format->reserved,0 ,sizeof (format->reserved));memset (format->format.reserved,0 ,sizeof (format->format.reserved)); -return v4l2_subdev_call (sd, pad, set_fmt, state, format); +return v4l2_subdev_call (sd, pad, set_fmt, &subdev_fh->ci, state, + format); }case VIDIOC_SUBDEV_G_CROP : {
@@ -835,8 +856,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel.stream = crop->stream; sel.target =V4L2_SEL_TGT_CROP ; - rval =v4l2_subdev_call ( - sd, pad, get_selection, state, &sel); + rval =v4l2_subdev_call (sd, pad, get_selection, &subdev_fh->ci, + state, &sel); crop->rect = sel.r;
@@ -861,8 +882,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel.target =V4L2_SEL_TGT_CROP ; sel.r = crop->rect; - rval =v4l2_subdev_call ( - sd, pad, set_selection, state, &sel); + rval =v4l2_subdev_call (sd, pad, set_selection, &subdev_fh->ci, + state, &sel); crop->rect = sel.r;
@@ -932,8 +953,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel->stream =0 ;memset (sel->reserved,0 ,sizeof (sel->reserved)); -return v4l2_subdev_call ( - sd, pad, get_selection, state, sel); +return v4l2_subdev_call (sd, pad, get_selection, &subdev_fh->ci, + state, sel); }case VIDIOC_SUBDEV_S_SELECTION : {
@@ -946,8 +967,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel->stream =0 ;memset (sel->reserved,0 ,sizeof (sel->reserved)); -return v4l2_subdev_call ( - sd, pad, set_selection, state, sel); +return v4l2_subdev_call (sd, pad, set_selection, &subdev_fh->ci, + state, sel); }case VIDIOC_G_EDID : {
@@ -1348,7 +1369,7 @@ v4l2_subdev_link_validate_get_format(struct media_pad *pad, u32 stream,else state =v4l2_subdev_lock_and_get_active_state (sd); - ret =v4l2_subdev_call (sd, pad, get_fmt, state, fmt); + ret =v4l2_subdev_call (sd, pad, get_fmt,NULL , state, fmt);if (!states_locked && state)v4l2_subdev_unlock_state (state);
@@ -1931,7 +1952,9 @@ v4l2_subdev_init_stream_configs(struct v4l2_subdev_stream_configs *stream_configreturn 0 ; } -int v4l2_subdev_get_fmt (struct v4l2_subdev *sd,struct v4l2_subdev_state *state, +int v4l2_subdev_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci, +struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {struct v4l2_mbus_framefmt *fmt;
include/media/v4l2-subdev.h +8 -1
@@ -850,15 +850,19 @@ struct v4l2_subdev_pad_ops {struct v4l2_subdev_state *state, struct v4l2_subdev_frame_interval_enum *fie);int (*get_fmt)(struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format);int (*set_fmt)(struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format);int (*get_selection)(struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel);int (*set_selection)(struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel); int (*get_frame_interval)(struct v4l2_subdev *sd,
@@ -1461,6 +1465,7 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state,* @sd: subdevice * @state: subdevice state * @format: pointer to &struct v4l2_subdev_format +* @ci: pointer to sub-device client information, including client capabilities * * Fill @format->format field based on the information in the @format struct. *
@@ -1470,7 +1475,9 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state,* * Returns 0 on success, error value otherwise. */ -int v4l2_subdev_get_fmt (struct v4l2_subdev *sd,struct v4l2_subdev_state *state, +int v4l2_subdev_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci, +struct v4l2_subdev_state *state,struct v4l2_subdev_format *format);/**
Signature · 1 line
2.47.3
Re: [PATCH v2 11/14] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops
Hi Sakari,
I get build errors after applying this patch, like:
drivers/media/i2c/imx219.c:1004:20: error: initialization of ‘int (*)(struct v4l2_subdev *, const struct v4l2_subdev_client_info *, struct v4l2_subdev_state *, struct v4l2_subdev_format *)’ from incompatible pointer type ‘int (*)(struct v4l2_subdev *, struct v4l2_subdev_state *, struct v4l2_subdev_format *)’ [-Wincompatible-pointer-types] 1004 | .set_fmt = imx219_set_pad_format,
I'm not sure if it is fixed later, but after I apply all 14 patches, I still get some build errors (I'm building for ARM64).
See also one other issue below.
Quoted 86 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]>--- drivers/media/v4l2-core/v4l2-subdev.c | 63 ++++++++++++++++++--------- include/media/v4l2-subdev.h | 9 +++- 2 files changed, 51 insertions(+), 21 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +23
-4@@ -245,19 +245,21 @@ static inline int check_format(struct v4l2_subdev *sd, }static int call_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {return check_format (sd, state, format) ? : - sd->ops->pad->get_fmt (sd, state, format); + sd->ops->pad->get_fmt (sd, ci, state, format); }static int call_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {return check_format (sd, state, format) ? : - sd->ops->pad->set_fmt (sd, state, format); + sd->ops->pad->set_fmt (sd, ci, state, format); } static int call_enum_mbus_code(struct v4l2_subdev *sd,@@ -308,19 +310,21 @@ static inline int check_selection(struct v4l2_subdev *sd, }static int call_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {return check_selection (sd, state, sel) ? : - sd->ops->pad->get_selection (sd, state, sel); + sd->ops->pad->get_selection (sd, ci, state, sel); }static int call_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {return check_selection (sd, state, sel) ? : - sd->ops->pad->set_selection (sd, state, sel); + sd->ops->pad->set_selection (sd, ci, state, sel); } static inline int check_frame_interval(struct v4l2_subdev *sd,@@ -523,6 +527,21 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)v4l2_subdev_unlock_state (state); \ return ret; \ } +#define DEFINE_STATE_WRAPPER_CI (f, arg_type) \ + static int call_##f##_state(struct v4l2_subdev *sd, \ + const struct v4l2_subdev_client_info *ci, \ + struct v4l2_subdev_state *_state, \ + arg_type *arg) \ + { \ + struct v4l2_subdev_state *state = _state; \ + int ret; \ + if (!_state) \ + state = v4l2_subdev_lock_and_get_active_state(sd); \ + ret = call_##f(sd, ci, state, arg); \ + if (!_state && state) \ + v4l2_subdev_unlock_state(state); \ + return ret; \ + }#else /* CONFIG_MEDIA_CONTROLLER */
drivers/media/v4l2-core/v4l2-subdev.c static int call_s_stream(struct v4l2_subdev *sd, int enable) · line 558
Quoted 6 lines
drivers/media/v4l2-core/v4l2-subdev.c +1
-2@@ -536,13 +555,13 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)#endif /* CONFIG_MEDIA_CONTROLLER */ -DEFINE_STATE_WRAPPER(get_fmt, struct v4l2_subdev_format); -DEFINE_STATE_WRAPPER(set_fmt, struct v4l2_subdev_format); +DEFINE_STATE_WRAPPER_CI(get_fmt, struct v4l2_subdev_format);
DEFINE_STATE_WRAPPER_CI is not defined when CONFIG_MEDIA_CONTROLLER is not defined
Regards,
Mirela
Quoted 141 lines
drivers/media/v4l2-core/v4l2-subdev.c +19
-14+DEFINE_STATE_WRAPPER_CI(set_fmt, struct v4l2_subdev_format); DEFINE_STATE_WRAPPER(enum_mbus_code, struct v4l2_subdev_mbus_code_enum); DEFINE_STATE_WRAPPER(enum_frame_size, struct v4l2_subdev_frame_size_enum); DEFINE_STATE_WRAPPER(enum_frame_interval, struct v4l2_subdev_frame_interval_enum); -DEFINE_STATE_WRAPPER(get_selection, struct v4l2_subdev_selection); -DEFINE_STATE_WRAPPER(set_selection, struct v4l2_subdev_selection); +DEFINE_STATE_WRAPPER_CI(get_selection, struct v4l2_subdev_selection); +DEFINE_STATE_WRAPPER_CI(set_selection, struct v4l2_subdev_selection);static const struct v4l2_subdev_pad_ops v4l2_subdev_call_pad_wrappers = { .get_fmt = call_get_fmt_state,@@ -804,7 +823,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,memset (format->reserved,0 ,sizeof (format->reserved));memset (format->format.reserved,0 ,sizeof (format->format.reserved)); -return v4l2_subdev_call (sd, pad, get_fmt, state, format); +return v4l2_subdev_call (sd, pad, get_fmt, &subdev_fh->ci, state, + format); }case VIDIOC_SUBDEV_S_FMT : {@@ -818,7 +838,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,memset (format->reserved,0 ,sizeof (format->reserved));memset (format->format.reserved,0 ,sizeof (format->format.reserved)); -return v4l2_subdev_call (sd, pad, set_fmt, state, format); +return v4l2_subdev_call (sd, pad, set_fmt, &subdev_fh->ci, state, + format); }case VIDIOC_SUBDEV_G_CROP : {@@ -835,8 +856,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel.stream = crop->stream; sel.target =V4L2_SEL_TGT_CROP ; - rval =v4l2_subdev_call ( - sd, pad, get_selection, state, &sel); + rval =v4l2_subdev_call (sd, pad, get_selection, &subdev_fh->ci, + state, &sel); crop->rect = sel.r;@@ -861,8 +882,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel.target =V4L2_SEL_TGT_CROP ; sel.r = crop->rect; - rval =v4l2_subdev_call ( - sd, pad, set_selection, state, &sel); + rval =v4l2_subdev_call (sd, pad, set_selection, &subdev_fh->ci, + state, &sel); crop->rect = sel.r;@@ -932,8 +953,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel->stream =0 ;memset (sel->reserved,0 ,sizeof (sel->reserved)); -return v4l2_subdev_call ( - sd, pad, get_selection, state, sel); +return v4l2_subdev_call (sd, pad, get_selection, &subdev_fh->ci, + state, sel); }case VIDIOC_SUBDEV_S_SELECTION : {@@ -946,8 +967,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, sel->stream =0 ;memset (sel->reserved,0 ,sizeof (sel->reserved)); -return v4l2_subdev_call ( - sd, pad, set_selection, state, sel); +return v4l2_subdev_call (sd, pad, set_selection, &subdev_fh->ci, + state, sel); }case VIDIOC_G_EDID : {@@ -1348,7 +1369,7 @@ v4l2_subdev_link_validate_get_format(struct media_pad *pad, u32 stream,else state =v4l2_subdev_lock_and_get_active_state (sd); - ret =v4l2_subdev_call (sd, pad, get_fmt, state, fmt); + ret =v4l2_subdev_call (sd, pad, get_fmt,NULL , state, fmt);if (!states_locked && state)v4l2_subdev_unlock_state (state);@@ -1931,7 +1952,9 @@ v4l2_subdev_init_stream_configs(struct v4l2_subdev_stream_configs *stream_configreturn 0 ; } -int v4l2_subdev_get_fmt (struct v4l2_subdev *sd,struct v4l2_subdev_state *state, +int v4l2_subdev_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci, +struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {struct v4l2_mbus_framefmt *fmt;include/media/v4l2-subdev.h +8
-2@@ -850,15 +850,19 @@ struct v4l2_subdev_pad_ops {struct v4l2_subdev_state *state, struct v4l2_subdev_frame_interval_enum *fie);int (*get_fmt)(struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format);int (*set_fmt)(struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format);int (*get_selection)(struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel);int (*set_selection)(struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel); int (*get_frame_interval)(struct v4l2_subdev *sd,@@ -1461,6 +1465,7 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state,* @sd: subdevice * @state: subdevice state * @format: pointer to &struct v4l2_subdev_format +* @ci: pointer to sub-device client information, including client capabilities * * Fill @format->format field based on the information in the @format struct. * @@ -1470,7 +1475,9 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state,* * Returns 0 on success, error value otherwise. */ -int v4l2_subdev_get_fmt (struct v4l2_subdev *sd,struct v4l2_subdev_state *state, +int v4l2_subdev_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci, +struct v4l2_subdev_state *state,struct v4l2_subdev_format *format);/** -- 2.47.3
Sakari Ailus
maintainerRe: [PATCH v2 11/14] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops
Hi Mirela,
Quoted 11 lines · Mirela Rabulea
Hi Sakari,
I get build errors after applying this patch, like:
drivers/media/i2c/imx219.c:1004:20: error: initialization of ‘int (*)(structv4l2_subdev*, const structv4l2_subdev_client_info*, structv4l2_subdev_state*, structv4l2_subdev_format*)’ from incompatible pointer type ‘int (*)(structv4l2_subdev*, structv4l2_subdev_state*, structv4l2_subdev_format*)’ [-Wincompatible-pointer-types]
1004 | .set_fmt =imx219_set_pad_format,
Quoted 2 lines
I'm not sure if it is fixed later, but after I apply all 14 patches, I still get some build errors (I'm building for ARM64).
Yes; I've noticed since posting this version I missed some required changes. I'll address this in v3.
The change here (adding the client info argument) requires merging the last few patches in the set. I've kept the patches separate as there's one generated by Coccinelle entirely.
Quoted 91 lines
See also one other issue below.
Quoted 87 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]>--- drivers/media/v4l2-core/v4l2-subdev.c | 63 ++++++++++++++++++--------- include/media/v4l2-subdev.h | 9 +++- 2 files changed, 51 insertions(+), 21 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +23
-4@@ -245,19 +245,21 @@ static inline int check_format(struct v4l2_subdev *sd, }static int call_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {return check_format (sd, state, format) ? : - sd->ops->pad->get_fmt (sd, state, format); + sd->ops->pad->get_fmt (sd, ci, state, format); }static int call_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {return check_format (sd, state, format) ? : - sd->ops->pad->set_fmt (sd, state, format); + sd->ops->pad->set_fmt (sd, ci, state, format); } static int call_enum_mbus_code(struct v4l2_subdev *sd,@@ -308,19 +310,21 @@ static inline int check_selection(struct v4l2_subdev *sd, }static int call_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {return check_selection (sd, state, sel) ? : - sd->ops->pad->get_selection (sd, state, sel); + sd->ops->pad->get_selection (sd, ci, state, sel); }static int call_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {return check_selection (sd, state, sel) ? : - sd->ops->pad->set_selection (sd, state, sel); + sd->ops->pad->set_selection (sd, ci, state, sel); } static inline int check_frame_interval(struct v4l2_subdev *sd,@@ -523,6 +527,21 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)v4l2_subdev_unlock_state (state); \ return ret; \ } +#define DEFINE_STATE_WRAPPER_CI (f, arg_type) \ + static int call_##f##_state(struct v4l2_subdev *sd, \ + const struct v4l2_subdev_client_info *ci, \ + struct v4l2_subdev_state *_state, \ + arg_type *arg) \ + { \ + struct v4l2_subdev_state *state = _state; \ + int ret; \ + if (!_state) \ + state = v4l2_subdev_lock_and_get_active_state(sd); \ + ret = call_##f(sd, ci, state, arg); \ + if (!_state && state) \ + v4l2_subdev_unlock_state(state); \ + return ret; \ + }#else /* CONFIG_MEDIA_CONTROLLER */ @@ -536,13 +555,13 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)
Quoted 8 lines
drivers/media/v4l2-core/v4l2-subdev.c static int call_s_stream(struct v4l2_subdev *sd, int enable) · line 558
Quoted 5 lines
drivers/media/v4l2-core/v4l2-subdev.c +1
-2#endif /* CONFIG_MEDIA_CONTROLLER */ -DEFINE_STATE_WRAPPER(get_fmt, struct v4l2_subdev_format); -DEFINE_STATE_WRAPPER(set_fmt, struct v4l2_subdev_format); +DEFINE_STATE_WRAPPER_CI(get_fmt, struct v4l2_subdev_format);
DEFINE_STATE_WRAPPER_CIis not defined whenCONFIG_MEDIA_CONTROLLERis not defined
I'll address that for v3.
Signature · 3 lines
Regards, Sakari Ailus
Sakari Ailus
maintainerPATCH v2 12/14 media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state
In reply to Sakari AilusAdd v4l2_subdev_call_ci_active_state(), to call sub-device pad ops that take struct v4l2_subdev_client_info pointer as an argument.
--- include/media/v4l2-subdev.h | 49 ++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-)
include/media/v4l2-subdev.h +38 -11
@@ -1912,6 +1912,22 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; __result; \ }) +#define v4l2_subdev_call_waive_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
@@ -1930,17 +1946,28 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers;* active state, lock it before calling the op and unlock it after the call. */ #define v4l2_subdev_call_state_active(sd, o, f, args...) \ - ({ \ - int __result; \ - struct v4l2_subdev_state *state; \ - state = v4l2_subdev_get_unlocked_active_state(sd); \ - if (state) \ - v4l2_subdev_lock_state(state); \ - __result = v4l2_subdev_call(sd, o, f, state, ##args); \ - if (state) \ - v4l2_subdev_unlock_state(state); \ - __result; \ - }) + __v4l2_subdev_call_state_active(v4l2_subdev_call_waive_fourth, \ + sd, o, f, ##args) + +/** +* v4l2_subdev_call_ci_state_active - call an operation of a v4l2_subdev which +* takes state as a parameter, passing the +* subdev its active state. +* +* @sd: pointer to the &struct v4l2_subdev +* @o: name of the element at &struct v4l2_subdev_ops that contains @f. +* Each element there groups a set of callbacks functions. +* @f: callback function to be called. +* The callback functions are defined in groups, according to +* each element at &struct v4l2_subdev_ops. +* @args: arguments for @f. +* +* This macro is just as v4l2_subdev_call_state_active(), with the exception +* that it passes NULL as the client info to sub-device ops that need it +* (currently pad ops get_fmt, set_fmt, get_selection and set_selection). +*/ +#define v4l2_subdev_call_ci_state_active(sd, o, f, args...) \ + __v4l2_subdev_call_state_active(v4l2_subdev_call, sd, o, f, ##args)/** * v4l2_subdev_call_state_try - call an operation of a v4l2_subdev which
Signature · 1 line
2.47.3
Re: [PATCH v2 12/14] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state
Hi Sakari,
Quoted 13 lines · Sakari Ailus
Add
v4l2_subdev_call_ci_active_state(), to call sub-device pad ops that take structv4l2_subdev_client_infopointer as an argument.Signed-off-by Sakari Ailus <[email protected]>--- include/media/v4l2-subdev.h | 49 ++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-)include/media/v4l2-subdev.h +0
-0
include/media/v4l2-subdev.h extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; · line 1915
Quoted 4 lines
include/media/v4l2-subdev.h +1
-0@@ -1912,6 +1912,22 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; __result; \ }) +#define v4l2_subdev_call_waive_fourth(first, second, third, fourth, rest...) \
waive is not very suggestive, maybe use drop instead?
Regards,
Mirela
Quoted 61 lines
include/media/v4l2-subdev.h +37
-12+ 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 @@ -1930,17 +1946,28 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers;* active state, lock it before calling the op and unlock it after the call. */ #define v4l2_subdev_call_state_active(sd, o, f, args...) \ - ({ \ - int __result; \ - struct v4l2_subdev_state *state; \ - state = v4l2_subdev_get_unlocked_active_state(sd); \ - if (state) \ - v4l2_subdev_lock_state(state); \ - __result = v4l2_subdev_call(sd, o, f, state, ##args); \ - if (state) \ - v4l2_subdev_unlock_state(state); \ - __result; \ - }) + __v4l2_subdev_call_state_active(v4l2_subdev_call_waive_fourth, \ + sd, o, f, ##args) + +/** +* v4l2_subdev_call_ci_state_active - call an operation of a v4l2_subdev which +* takes state as a parameter, passing the +* subdev its active state. +* +* @sd: pointer to the &struct v4l2_subdev +* @o: name of the element at &struct v4l2_subdev_ops that contains @f. +* Each element there groups a set of callbacks functions. +* @f: callback function to be called. +* The callback functions are defined in groups, according to +* each element at &struct v4l2_subdev_ops. +* @args: arguments for @f. +* +* This macro is just as v4l2_subdev_call_state_active(), with the exception +* that it passes NULL as the client info to sub-device ops that need it +* (currently pad ops get_fmt, set_fmt, get_selection and set_selection). +*/ +#define v4l2_subdev_call_ci_state_active(sd, o, f, args...) \ + __v4l2_subdev_call_state_active(v4l2_subdev_call, sd, o, f, ##args)/** * v4l2_subdev_call_state_try - call an operation of a v4l2_subdev which -- 2.47.3
Sakari Ailus
maintainerRe: [PATCH v2 12/14] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state
Hi Mirela,
Quoted 19 lines · Mirela Rabulea
Hi Sakari,
Quoted 16 lines · Sakari Ailus
Add
v4l2_subdev_call_ci_active_state(), to call sub-device pad ops that take structv4l2_subdev_client_infopointer as an argument.Signed-off-by Sakari Ailus <[email protected]>--- include/media/v4l2-subdev.h | 49 ++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-)include/media/v4l2-subdev.h +0
-0@@ -1912,6 +1912,22 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; __result; \ })
Quoted 3 lines
include/media/v4l2-subdev.h extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers; · line 1915
Quoted 1 line
include/media/v4l2-subdev.h +1
-0+#define v4l2_subdev_call_waive_fourth(first, second, third, fourth, rest...) \waive is not very suggestive, maybe use drop instead?
I'll use that for v3.
Signature · 1 line
Sakari Ailus
Sakari Ailus
maintainerPATCH v2 13/14 media: v4l2-subdev: Perform client info changes to i2c drivers
In reply to Sakari AilusPerform client info argument related changes to two i2c drivers (s5k5baf and tc358743). These changes are not done by Coccinelle scripts in the following patch and will be squashed to the previous patch eventually.
--- drivers/media/i2c/s5k5baf.c | 1 + drivers/media/i2c/tc358743.c | 2 +- drivers/media/pci/intel/ipu6/ipu6-isys-subdev.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/media/i2c/s5k5baf.c +1 -0
@@ -1463,6 +1463,7 @@ static bool s5k5baf_cmp_rect(const struct v4l2_rect *r1, }static int s5k5baf_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/tc358743.c +1 -1
@@ -1822,7 +1822,7 @@ static int tc358743_set_fmt(struct v4l2_subdev *sd,struct tc358743_state *state =to_state (sd);u32 code = format->format.code;/* is overwritten by get_fmt */ -int ret =tc358743_get_fmt (sd, sd_state, format); +int ret =tc358743_get_fmt (sd, ci, sd_state, format);if (code ==MEDIA_BUS_FMT_RGB888_1X24 || code ==MEDIA_BUS_FMT_UYVY8_1X16 )
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,
Signature · 1 line
2.47.3
Sakari Ailus
maintainerPATCH v2 14/14 media: v4l2-subdev: Add struct v4l2_subdev_client_info argument to pad ops
In reply to Sakari AilusAdd const struct v4l2_subdev_client_info argument to the sub-device pad ops get_fmt, set_fmt, get_selection and set_selection. This patch has been entirely generated using Coccinelle and will be squashed to the previous patch before merging.
--- drivers/media/i2c/adv7170.c | 2 ++ drivers/media/i2c/adv7175.c | 2 ++ drivers/media/i2c/adv7180.c | 4 ++- drivers/media/i2c/adv7183.c | 4 ++- drivers/media/i2c/adv748x/adv748x-afe.c | 4 ++- drivers/media/i2c/adv748x/adv748x-csi2.c | 3 ++- drivers/media/i2c/adv748x/adv748x-hdmi.c | 4 ++- drivers/media/i2c/adv7511-v4l2.c | 2 ++ drivers/media/i2c/adv7604.c | 3 +++ drivers/media/i2c/adv7842.c | 4 ++- drivers/media/i2c/ak881x.c | 2 ++ drivers/media/i2c/alvium-csi2.c | 3 +++ drivers/media/i2c/ar0521.c | 2 ++ drivers/media/i2c/ccs/ccs-core.c | 15 ++++++++--- drivers/media/i2c/cx25840/cx25840-core.c | 1 + drivers/media/i2c/ds90ub913.c | 3 ++- drivers/media/i2c/ds90ub953.c | 3 ++- drivers/media/i2c/ds90ub960.c | 3 ++- drivers/media/i2c/et8ek8/et8ek8_driver.c | 2 ++ drivers/media/i2c/gc0308.c | 1 + drivers/media/i2c/gc0310.c | 1 + drivers/media/i2c/gc05a2.c | 4 ++- drivers/media/i2c/gc08a3.c | 4 ++- drivers/media/i2c/gc2145.c | 2 ++ drivers/media/i2c/hi556.c | 3 +++ drivers/media/i2c/hi846.c | 3 +++ drivers/media/i2c/hi847.c | 2 ++ drivers/media/i2c/imx111.c | 1 + drivers/media/i2c/imx208.c | 2 ++ drivers/media/i2c/imx214.c | 4 ++- drivers/media/i2c/imx219.c | 4 ++- drivers/media/i2c/imx258.c | 3 +++ drivers/media/i2c/imx274.c | 4 +++ drivers/media/i2c/imx283.c | 2 ++ drivers/media/i2c/imx290.c | 4 ++- drivers/media/i2c/imx296.c | 7 +++-- drivers/media/i2c/imx319.c | 2 ++ drivers/media/i2c/imx334.c | 4 ++- drivers/media/i2c/imx335.c | 4 ++- drivers/media/i2c/imx355.c | 2 ++ drivers/media/i2c/imx412.c | 4 ++- drivers/media/i2c/imx415.c | 4 ++- drivers/media/i2c/isl7998x.c | 2 ++ drivers/media/i2c/lt6911uxe.c | 5 ++-- drivers/media/i2c/max9286.c | 3 ++- drivers/media/i2c/max96714.c | 3 ++- drivers/media/i2c/max96717.c | 3 ++- drivers/media/i2c/ml86v7667.c | 1 + drivers/media/i2c/mt9m001.c | 6 ++++- drivers/media/i2c/mt9m111.c | 4 +++ drivers/media/i2c/mt9m114.c | 6 +++++ drivers/media/i2c/mt9p031.c | 4 +++ drivers/media/i2c/mt9t112.c | 4 +++ drivers/media/i2c/mt9v011.c | 1 + drivers/media/i2c/mt9v032.c | 4 +++ drivers/media/i2c/mt9v111.c | 2 ++ drivers/media/i2c/og01a1b.c | 2 ++ drivers/media/i2c/og0ve1b.c | 3 ++- drivers/media/i2c/os05b10.c | 2 ++ drivers/media/i2c/ov01a10.c | 3 +++ drivers/media/i2c/ov02a10.c | 4 ++- drivers/media/i2c/ov02c10.c | 1 + drivers/media/i2c/ov02e10.c | 2 ++ drivers/media/i2c/ov08d10.c | 2 ++ drivers/media/i2c/ov08x40.c | 2 ++ drivers/media/i2c/ov13858.c | 2 ++ drivers/media/i2c/ov13b10.c | 2 ++ drivers/media/i2c/ov2640.c | 3 +++ drivers/media/i2c/ov2659.c | 2 ++ drivers/media/i2c/ov2680.c | 4 +++ drivers/media/i2c/ov2685.c | 3 +++ drivers/media/i2c/ov2735.c | 4 ++- drivers/media/i2c/ov2740.c | 1 + drivers/media/i2c/ov4689.c | 2 ++ drivers/media/i2c/ov5640.c | 3 +++ drivers/media/i2c/ov5645.c | 4 ++- drivers/media/i2c/ov5647.c | 3 +++ drivers/media/i2c/ov5648.c | 2 ++ drivers/media/i2c/ov5670.c | 3 +++ drivers/media/i2c/ov5675.c | 3 +++ drivers/media/i2c/ov5693.c | 4 +++ drivers/media/i2c/ov5695.c | 2 ++ drivers/media/i2c/ov6211.c | 3 ++- drivers/media/i2c/ov64a40.c | 2 ++ drivers/media/i2c/ov7251.c | 5 +++- drivers/media/i2c/ov7670.c | 2 ++ drivers/media/i2c/ov772x.c | 3 +++ drivers/media/i2c/ov7740.c | 2 ++ drivers/media/i2c/ov8856.c | 2 ++ drivers/media/i2c/ov8858.c | 3 ++- drivers/media/i2c/ov8865.c | 3 +++ drivers/media/i2c/ov9282.c | 5 +++- drivers/media/i2c/ov9640.c | 2 ++ drivers/media/i2c/ov9650.c | 2 ++ drivers/media/i2c/ov9734.c | 2 ++ drivers/media/i2c/rdacm20.c | 1 + drivers/media/i2c/rdacm21.c | 1 + drivers/media/i2c/rj54n1cb0c.c | 4 +++ drivers/media/i2c/s5c73m3/s5c73m3-core.c | 4 +++ drivers/media/i2c/s5k3m5.c | 4 ++- drivers/media/i2c/s5k5baf.c | 3 +++ drivers/media/i2c/s5k6a3.c | 2 ++ drivers/media/i2c/s5kjn1.c | 4 ++- drivers/media/i2c/saa6752hs.c | 2 ++ drivers/media/i2c/saa7115.c | 1 + drivers/media/i2c/saa717x.c | 1 + drivers/media/i2c/st-mipid02.c | 1 + drivers/media/i2c/tc358743.c | 2 ++ drivers/media/i2c/tc358746.c | 3 ++- drivers/media/i2c/tda1997x.c | 2 ++ drivers/media/i2c/thp7312.c | 1 + drivers/media/i2c/tvp514x.c | 2 ++ drivers/media/i2c/tvp5150.c | 3 +++ drivers/media/i2c/tvp7002.c | 4 ++- drivers/media/i2c/tw9900.c | 2 ++ drivers/media/i2c/tw9910.c | 3 +++ drivers/media/i2c/vd55g1.c | 4 ++- drivers/media/i2c/vd56g3.c | 4 ++- drivers/media/i2c/vgxy61.c | 5 +++- drivers/media/pci/cobalt/cobalt-driver.c | 8 +++--- drivers/media/pci/cobalt/cobalt-v4l2.c | 14 +++++----- drivers/media/pci/cx18/cx18-av-core.c | 1 + drivers/media/pci/cx18/cx18-controls.c | 2 +- drivers/media/pci/cx18/cx18-ioctl.c | 2 +- drivers/media/pci/cx23885/cx23885-video.c | 4 +-- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 5 ++-- drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 2 ++ .../media/pci/intel/ipu6/ipu6-isys-subdev.c | 3 ++- drivers/media/pci/intel/ivsc/mei_csi.c | 1 + drivers/media/pci/ivtv/ivtv-controls.c | 2 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +- drivers/media/pci/saa7134/saa7134-empress.c | 6 ++--- .../platform/amlogic/c3/isp/c3-isp-capture.c | 2 +- .../platform/amlogic/c3/isp/c3-isp-core.c | 1 + .../platform/amlogic/c3/isp/c3-isp-resizer.c | 3 +++ .../amlogic/c3/mipi-adapter/c3-mipi-adap.c | 3 ++- .../amlogic/c3/mipi-csi2/c3-mipi-csi2.c | 3 ++- .../platform/arm/mali-c55/mali-c55-capture.c | 2 +- .../platform/arm/mali-c55/mali-c55-isp.c | 5 +++- .../platform/arm/mali-c55/mali-c55-resizer.c | 15 ++++++++--- .../platform/arm/mali-c55/mali-c55-tpg.c | 1 + drivers/media/platform/atmel/atmel-isi.c | 4 +-- .../media/platform/broadcom/bcm2835-unicam.c | 3 ++- drivers/media/platform/cadence/cdns-csi2rx.c | 7 ++--- drivers/media/platform/cadence/cdns-csi2tx.c | 7 +++-- drivers/media/platform/intel/pxa_camera.c | 6 ++--- drivers/media/platform/marvell/mcam-core.c | 4 +-- .../platform/microchip/microchip-csi2dc.c | 2 ++ .../platform/microchip/microchip-isc-base.c | 1 + .../platform/microchip/microchip-isc-scaler.c | 3 +++ drivers/media/platform/nxp/imx-mipi-csis.c | 5 ++-- drivers/media/platform/nxp/imx7-media-csi.c | 3 ++- .../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 3 ++- .../platform/nxp/imx8-isi/imx8-isi-pipe.c | 3 +++ drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 3 ++- .../media/platform/qcom/camss/camss-csid.c | 4 ++- .../media/platform/qcom/camss/camss-csiphy.c | 4 ++- .../media/platform/qcom/camss/camss-ispif.c | 4 ++- drivers/media/platform/qcom/camss/camss-vfe.c | 17 +++++++----- .../media/platform/qcom/camss/camss-video.c | 2 +- .../media/platform/raspberrypi/rp1-cfe/csi2.c | 1 + .../platform/raspberrypi/rp1-cfe/pisp-fe.c | 3 ++- drivers/media/platform/renesas/rcar-csi2.c | 3 ++- .../media/platform/renesas/rcar-isp/csisp.c | 3 ++- .../platform/renesas/rcar-vin/rcar-v4l2.c | 2 +- drivers/media/platform/renesas/renesas-ceu.c | 7 ++--- .../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 3 ++- .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 3 ++- .../platform/renesas/rzg2l-cru/rzg2l-video.c | 2 +- .../renesas/rzv2h-ivc/rzv2h-ivc-subdev.c | 3 ++- .../media/platform/renesas/vsp1/vsp1_brx.c | 3 +++ .../media/platform/renesas/vsp1/vsp1_clu.c | 1 + .../media/platform/renesas/vsp1/vsp1_drm.c | 26 ++++++++++++------- .../media/platform/renesas/vsp1/vsp1_entity.c | 4 ++- .../media/platform/renesas/vsp1/vsp1_histo.c | 9 +++++-- .../media/platform/renesas/vsp1/vsp1_hsit.c | 1 + .../media/platform/renesas/vsp1/vsp1_iif.c | 1 + .../media/platform/renesas/vsp1/vsp1_lif.c | 1 + .../media/platform/renesas/vsp1/vsp1_lut.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 | 3 +++ .../media/platform/renesas/vsp1/vsp1_video.c | 2 +- .../media/platform/renesas/vsp1/vsp1_vspx.c | 3 ++- .../platform/rockchip/rkcif/rkcif-interface.c | 5 +++- .../platform/rockchip/rkisp1/rkisp1-capture.c | 2 +- .../platform/rockchip/rkisp1/rkisp1-csi.c | 3 ++- .../platform/rockchip/rkisp1/rkisp1-isp.c | 3 +++ .../platform/rockchip/rkisp1/rkisp1-resizer.c | 3 +++ .../samsung/exynos4-is/fimc-capture.c | 13 +++++++--- .../samsung/exynos4-is/fimc-isp-video.c | 5 ++-- .../platform/samsung/exynos4-is/fimc-isp.c | 2 ++ .../platform/samsung/exynos4-is/fimc-lite.c | 8 ++++-- .../platform/samsung/exynos4-is/mipi-csis.c | 2 ++ .../samsung/s3c-camif/camif-capture.c | 7 ++++- .../platform/samsung/s3c-camif/camif-core.c | 4 +-- drivers/media/platform/st/stm32/stm32-csi.c | 1 + drivers/media/platform/st/stm32/stm32-dcmi.c | 6 ++--- .../st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 3 ++- .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 3 +++ .../st/stm32/stm32-dcmipp/dcmipp-input.c | 1 + .../platform/sunxi/sun4i-csi/sun4i_v4l2.c | 2 ++ .../sunxi/sun6i-csi/sun6i_csi_bridge.c | 2 ++ .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 2 ++ .../sun8i_a83t_mipi_csi2.c | 2 ++ .../media/platform/ti/am437x/am437x-vpfe.c | 4 +-- drivers/media/platform/ti/cal/cal-camerarx.c | 3 ++- drivers/media/platform/ti/cal/cal-video.c | 6 ++--- .../media/platform/ti/davinci/vpif_capture.c | 2 +- .../platform/ti/j721e-csi2rx/j721e-csi2rx.c | 2 +- drivers/media/platform/ti/omap3isp/ispccdc.c | 6 ++++- drivers/media/platform/ti/omap3isp/ispccp2.c | 4 ++- drivers/media/platform/ti/omap3isp/ispcsi2.c | 4 ++- .../media/platform/ti/omap3isp/isppreview.c | 6 ++++- .../media/platform/ti/omap3isp/ispresizer.c | 6 ++++- drivers/media/platform/ti/omap3isp/ispvideo.c | 12 ++++----- drivers/media/platform/ti/vpe/vip.c | 7 ++--- drivers/media/platform/via/via-camera.c | 4 +-- drivers/media/platform/video-mux.c | 1 + .../media/platform/xilinx/xilinx-csi2rxss.c | 2 ++ drivers/media/platform/xilinx/xilinx-dma.c | 2 +- drivers/media/platform/xilinx/xilinx-tpg.c | 2 ++ drivers/media/test-drivers/vimc/vimc-common.c | 2 +- .../media/test-drivers/vimc/vimc-debayer.c | 3 ++- drivers/media/test-drivers/vimc/vimc-scaler.c | 3 +++ drivers/media/test-drivers/vimc/vimc-sensor.c | 1 + drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 4 +-- drivers/media/usb/dvb-usb/cxusb-analog.c | 6 +++-- drivers/media/usb/em28xx/em28xx-camera.c | 2 +- drivers/media/usb/go7007/go7007-v4l2.c | 2 +- drivers/media/usb/go7007/s2250-board.c | 1 + drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- .../media/atomisp/i2c/atomisp-gc2235.c | 2 ++ .../media/atomisp/i2c/atomisp-ov2722.c | 2 ++ .../staging/media/atomisp/pci/atomisp_cmd.c | 16 ++++++++---- .../staging/media/atomisp/pci/atomisp_csi2.c | 2 ++ .../media/atomisp/pci/atomisp_subdev.c | 4 +++ .../staging/media/atomisp/pci/atomisp_v4l2.c | 8 +++--- .../media/deprecated/atmel/atmel-isc-base.c | 4 +-- drivers/staging/media/imx/imx-ic-prp.c | 2 ++ drivers/staging/media/imx/imx-ic-prpencvf.c | 2 ++ drivers/staging/media/imx/imx-media-capture.c | 14 ++++++---- drivers/staging/media/imx/imx-media-csi.c | 4 +++ drivers/staging/media/imx/imx-media-utils.c | 2 +- drivers/staging/media/imx/imx-media-vdic.c | 2 ++ drivers/staging/media/imx/imx6-mipi-csi2.c | 2 ++ drivers/staging/media/ipu3/ipu3-v4l2.c | 4 +++ drivers/staging/media/ipu7/ipu7-isys-csi2.c | 2 ++ drivers/staging/media/ipu7/ipu7-isys-subdev.c | 3 ++- .../staging/media/starfive/camss/stf-isp.c | 12 ++++++--- .../staging/media/starfive/camss/stf-video.c | 2 +- .../media/sunxi/sun6i-isp/sun6i_isp_proc.c | 2 ++ drivers/staging/media/tegra-video/csi.c | 2 ++ drivers/staging/media/tegra-video/vi.c | 13 +++++----- 256 files changed, 688 insertions(+), 212 deletions(-)
drivers/media/i2c/adv7170.c +2 -0
@@ -261,6 +261,7 @@ static int adv7170_enum_mbus_code(struct v4l2_subdev *sd, }static int adv7170_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -284,6 +285,7 @@ static int adv7170_get_fmt(struct v4l2_subdev *sd, }static int adv7170_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/adv7175.c +2 -0
@@ -299,6 +299,7 @@ static int adv7175_enum_mbus_code(struct v4l2_subdev *sd, }static int adv7175_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -322,6 +323,7 @@ static int adv7175_get_fmt(struct v4l2_subdev *sd, }static int adv7175_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/adv7180.c +3 -1
@@ -755,6 +755,7 @@ static int adv7180_set_field_mode(struct adv7180_state *state) }static int adv7180_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -771,6 +772,7 @@ static int adv7180_get_pad_format(struct v4l2_subdev *sd, }static int adv7180_set_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -808,7 +810,7 @@ static int adv7180_init_state(struct v4l2_subdev *sd, : V4L2_SUBDEV_FORMAT_ACTIVE, }; -return adv7180_set_pad_format (sd, sd_state, &fmt); +return adv7180_set_pad_format (sd,NULL , sd_state, &fmt); } static int adv7180_get_mbus_config(struct v4l2_subdev *sd,
drivers/media/i2c/adv7183.c +3 -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) {
@@ -446,6 +447,7 @@ static int adv7183_set_fmt(struct v4l2_subdev *sd, }static int adv7183_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -598,7 +600,7 @@ static int adv7183_probe(struct i2c_client *client)adv7183_s_std (sd, decoder->std); fmt.format.width =720 ; fmt.format.height =576 ; -adv7183_set_fmt (sd,NULL , &fmt); +adv7183_set_fmt (sd,NULL ,NULL , &fmt);/* initialize the hardware to the default control values */ ret =v4l2_ctrl_handler_setup (hdl);
drivers/media/i2c/adv748x/adv748x-afe.c +3 -1
@@ -326,6 +326,7 @@ static int adv748x_afe_enum_mbus_code(struct v4l2_subdev *sd, }static int adv748x_afe_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *sdformat) {
@@ -349,6 +350,7 @@ static int adv748x_afe_get_format(struct v4l2_subdev *sd, }static int adv748x_afe_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *sdformat) {
@@ -359,7 +361,7 @@ static int adv748x_afe_set_format(struct v4l2_subdev *sd,return -EINVAL ;if (sdformat->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) -return adv748x_afe_get_format (sd, sd_state, sdformat); +return adv748x_afe_get_format (sd,NULL , sd_state, sdformat); mbusformat =v4l2_subdev_state_get_format (sd_state, sdformat->pad); *mbusformat = sdformat->format;
drivers/media/i2c/adv748x/adv748x-csi2.c +2 -1
@@ -226,6 +226,7 @@ static bool adv748x_csi2_is_fmt_supported(struct adv748x_csi2 *tx, u32 code) }static int adv748x_csi2_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *sdformat) {
@@ -233,7 +234,7 @@ static int adv748x_csi2_set_format(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mbusformat;if (sdformat->pad ==ADV748X_CSI2_SOURCE ) -return v4l2_subdev_get_fmt (sd, sd_state, sdformat); +return v4l2_subdev_get_fmt (sd,NULL , sd_state, sdformat);/* * Make sure the format is supported, if not default it to
drivers/media/i2c/adv748x/adv748x-hdmi.c +3 -1
@@ -418,6 +418,7 @@ static int adv748x_hdmi_enum_mbus_code(struct v4l2_subdev *sd, }static int adv748x_hdmi_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *sdformat) {
@@ -440,6 +441,7 @@ static int adv748x_hdmi_get_format(struct v4l2_subdev *sd, }static int adv748x_hdmi_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *sdformat) {
@@ -449,7 +451,7 @@ static int adv748x_hdmi_set_format(struct v4l2_subdev *sd,return -EINVAL ;if (sdformat->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) -return adv748x_hdmi_get_format (sd, sd_state, sdformat); +return adv748x_hdmi_get_format (sd,NULL , sd_state, sdformat); mbusformat =v4l2_subdev_state_get_format (sd_state, sdformat->pad); *mbusformat = sdformat->format;
drivers/media/i2c/adv7511-v4l2.c +2 -0
@@ -1241,6 +1241,7 @@ static void adv7511_fill_format(struct adv7511_state *state, }static int adv7511_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1273,6 +1274,7 @@ static int adv7511_get_fmt(struct v4l2_subdev *sd, }static int adv7511_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/adv7604.c +3 -0
@@ -1920,6 +1920,7 @@ static void adv76xx_setup_format(struct adv76xx_state *state) }static int adv76xx_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1943,6 +1944,7 @@ static int adv76xx_get_format(struct v4l2_subdev *sd, }static int adv76xx_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -1963,6 +1965,7 @@ static int adv76xx_get_selection(struct v4l2_subdev *sd, }static int adv76xx_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/adv7842.c +3 -1
@@ -2072,6 +2072,7 @@ static void adv7842_setup_format(struct adv7842_state *state) }static int adv7842_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -2110,6 +2111,7 @@ static int adv7842_get_format(struct v4l2_subdev *sd, }static int adv7842_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -2120,7 +2122,7 @@ static int adv7842_set_format(struct v4l2_subdev *sd,return -EINVAL ;if (state->mode ==ADV7842_MODE_SDP ) -return adv7842_get_format (sd, sd_state, format); +return adv7842_get_format (sd,NULL , sd_state, format); info =adv7842_format_info (state, format->format.code);if (info ==NULL )
drivers/media/i2c/ak881x.c +2 -0
@@ -91,6 +91,7 @@ static int ak881x_s_register(struct v4l2_subdev *sd,#endif static int ak881x_fill_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -122,6 +123,7 @@ static int ak881x_enum_mbus_code(struct v4l2_subdev *sd, }static int ak881x_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
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 +2 -0
@@ -437,6 +437,7 @@ static void ar0521_adj_fmt(struct v4l2_mbus_framefmt *fmt) }static int ar0521_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -457,6 +458,7 @@ static int ar0521_get_fmt(struct v4l2_subdev *sd, }static int ar0521_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/ccs/ccs-core.c +11 -4
@@ -2146,6 +2146,7 @@ static u32 ccs_get_mbus_code(struct v4l2_subdev *subdev, unsigned int pad) }static int ccs_get_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -2187,6 +2188,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) {
@@ -2198,7 +2200,7 @@ static int ccs_set_format_source(struct v4l2_subdev *subdev,unsigned int i;int rval; - rval =ccs_get_format (subdev, sd_state, fmt); + rval =ccs_get_format (subdev,NULL , sd_state, fmt);if (rval)return rval;
@@ -2240,6 +2242,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) {
@@ -2250,7 +2253,7 @@ static int ccs_set_format(struct v4l2_subdev *subdev,if (fmt->pad == ssd->source_pad) {int rval; - rval =ccs_set_format_source (subdev, sd_state, fmt); + rval =ccs_set_format_source (subdev,NULL , sd_state, fmt);return rval; }
@@ -2465,6 +2468,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) {
@@ -2534,6 +2538,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) {
@@ -2585,6 +2590,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) {
@@ -2631,6 +2637,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) {
@@ -2653,10 +2660,10 @@ static int ccs_set_selection(struct v4l2_subdev *subdev,switch (sel->target) {case V4L2_SEL_TGT_CROP : - ret =ccs_set_crop (subdev, sd_state, sel); + ret =ccs_set_crop (subdev,NULL , sd_state, sel);break ;case V4L2_SEL_TGT_COMPOSE : - ret =ccs_set_compose (subdev, sd_state, sel); + ret =ccs_set_compose (subdev,NULL , sd_state, sel);break ;default : ret = -EINVAL ;
drivers/media/i2c/cx25840/cx25840-core.c +1 -0
@@ -1746,6 +1746,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 +2 -1
@@ -430,6 +430,7 @@ static int ub913_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, }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) {
@@ -443,7 +444,7 @@ static int ub913_set_fmt(struct v4l2_subdev *sd,/* Source format is fully defined by the sink format, so not settable */ if (format->pad ==UB913_PAD_SOURCE ) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format); finfo =ub913_find_format (format->format.code);if (!finfo) {
drivers/media/i2c/ds90ub953.c +2 -1
@@ -485,6 +485,7 @@ static int ub953_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, }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) {
@@ -497,7 +498,7 @@ static int ub953_set_fmt(struct v4l2_subdev *sd,/* No transcoding, source and sink formats must match. */ if (format->pad ==UB953_PAD_SOURCE ) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format);/* Set sink format */ fmt =v4l2_subdev_state_get_format (state, format->pad, format->stream);
drivers/media/i2c/ds90ub960.c +2 -1
@@ -3985,6 +3985,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) {
@@ -3996,7 +3997,7 @@ static int ub960_set_fmt(struct v4l2_subdev *sd,/* No transcoding, source and sink formats must match. */ if (ub960_pad_is_source (priv, format->pad)) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format);/* * Default to the first format if the requested media bus code isn't
drivers/media/i2c/et8ek8/et8ek8_driver.c +2 -0
@@ -996,6 +996,7 @@ __et8ek8_get_pad_format(struct et8ek8_sensor *sensor, }static int et8ek8_get_pad_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1013,6 +1014,7 @@ static int et8ek8_get_pad_format(struct v4l2_subdev *subdev, }static int et8ek8_set_pad_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
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
@@ -362,6 +362,7 @@ static void gc0310_fill_format(struct v4l2_mbus_framefmt *fmt) }static int gc0310_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
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 +3 -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) {
@@ -1113,6 +1115,7 @@ static int hi556_set_format(struct v4l2_subdev *sd, }static int hi556_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/hi846.c +3 -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) {
@@ -1775,6 +1776,7 @@ static int hi846_set_format(struct v4l2_subdev *sd, }static int hi846_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1840,6 +1842,7 @@ static int hi846_enum_frame_size(struct v4l2_subdev *sd, }static int hi846_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/hi847.c +2 -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) {
@@ -2682,6 +2683,7 @@ static int hi847_set_format(struct v4l2_subdev *sd, }static int hi847_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
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 +2 -0
@@ -560,6 +560,7 @@ static int __imx208_get_pad_format(struct imx208 *imx208, }static int imx208_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -574,6 +575,7 @@ static int imx208_get_pad_format(struct v4l2_subdev *sd, }static int imx208_set_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
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
@@ -829,6 +829,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) {
@@ -949,6 +950,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) {
@@ -991,7 +993,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 +3 -0
@@ -887,6 +887,7 @@ static int __imx258_get_pad_format(struct imx258 *imx258, }static int imx258_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -901,6 +902,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) {
@@ -976,6 +978,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 +4 -0
@@ -1070,6 +1070,7 @@ static int __imx274_change_compose(struct stimx274 *imx274,* Return: 0 on success */ static int imx274_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1092,6 +1093,7 @@ static int imx274_get_fmt(struct v4l2_subdev *sd,* Return: 0 on success */ 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) {
@@ -1125,6 +1127,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) {
@@ -1241,6 +1244,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
@@ -953,6 +953,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) {
@@ -1246,6 +1247,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 +2 -0
@@ -2015,6 +2015,7 @@ static int imx319_do_get_pad_format(struct imx319 *imx319, }static int imx319_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -2030,6 +2031,7 @@ static int imx319_get_pad_format(struct v4l2_subdev *sd,static int imx319_set_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/imx334.c +3 -1
@@ -758,6 +758,7 @@ static void imx334_fill_pad_format(struct imx334 *imx334,* Return: 0 if successful, error code otherwise. */ static int imx334_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -785,6 +786,7 @@ static int imx334_get_pad_format(struct v4l2_subdev *sd,* Return: 0 if successful, error code otherwise. */ 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) {
@@ -837,7 +839,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
@@ -880,6 +880,7 @@ static void imx335_fill_pad_format(struct imx335 *imx335,* Return: 0 if successful, error code otherwise. */ 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) {
@@ -944,7 +945,7 @@ 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); }/**
@@ -956,6 +957,7 @@ static int imx335_init_state(struct v4l2_subdev *sd,* Return: 0 if successful, error code otherwise. */ 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 +2 -0
@@ -1314,6 +1314,7 @@ static int imx355_do_get_pad_format(struct imx355 *imx355, }static int imx355_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1329,6 +1330,7 @@ static int imx355_get_pad_format(struct v4l2_subdev *sd,static int imx355_set_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/imx412.c +3 -1
@@ -710,6 +710,7 @@ static void imx412_fill_pad_format(struct imx412 *imx412,* Return: 0 if successful, error code otherwise. */ static int imx412_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -740,6 +741,7 @@ static int imx412_get_pad_format(struct v4l2_subdev *sd,* Return: 0 if successful, error code otherwise. */ 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) {
@@ -784,7 +786,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/isl7998x.c +2 -0
@@ -997,6 +997,7 @@ static int isl7998x_enum_frame_size(struct v4l2_subdev *sd, }static int isl7998x_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1027,6 +1028,7 @@ static int isl7998x_get_fmt(struct v4l2_subdev *sd, }static int isl7998x_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
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 +2 -1
@@ -910,6 +910,7 @@ static int max9286_enum_mbus_code(struct v4l2_subdev *sd, }static int max9286_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
@@ -922,7 +923,7 @@ static int max9286_set_fmt(struct v4l2_subdev *sd,* from the sinks. */ if (format->pad ==MAX9286_SRC_PAD ) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format);/* Validate the format. */ for (i =0 ; i <ARRAY_SIZE (max9286_formats); ++i) {
drivers/media/i2c/max96714.c +2 -1
@@ -327,6 +327,7 @@ static int max96714_disable_streams(struct v4l2_subdev *sd, }static int max96714_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
@@ -339,7 +340,7 @@ static int max96714_set_fmt(struct v4l2_subdev *sd,/* No transcoding, source and sink formats must match. */ if (format->pad ==MAX96714_PAD_SOURCE ) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format); fmt =v4l2_subdev_state_get_format (state, format->pad, format->stream);if (!fmt)
drivers/media/i2c/max96717.c +2 -1
@@ -414,6 +414,7 @@ static int max96717_set_routing(struct v4l2_subdev *sd, }static int max96717_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
@@ -427,7 +428,7 @@ static int max96717_set_fmt(struct v4l2_subdev *sd,/* No transcoding, source and sink formats must match. */ if (format->pad ==MAX96717_PAD_SOURCE ) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format);/* Set sink format */ fmt =v4l2_subdev_state_get_format (state, format->pad, format->stream);
drivers/media/i2c/ml86v7667.c +1 -0
@@ -200,6 +200,7 @@ static int ml86v7667_enum_mbus_code(struct v4l2_subdev *sd, }static int ml86v7667_fill_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/mt9m001.c +5 -1
@@ -248,6 +248,7 @@ static int mt9m001_s_stream(struct v4l2_subdev *sd, int enable) }static int mt9m001_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -289,6 +290,7 @@ static int mt9m001_set_selection(struct v4l2_subdev *sd, }static int mt9m001_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -314,6 +316,7 @@ static int mt9m001_get_selection(struct v4l2_subdev *sd, }static int mt9m001_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -359,7 +362,7 @@ static int mt9m001_s_fmt(struct v4l2_subdev *sd,int ret;/* No support for scaling so far, just crop. TODO: use skipping */ - ret =mt9m001_set_selection (sd,NULL , &sel); + ret =mt9m001_set_selection (sd,NULL ,NULL , &sel);if (!ret) { mf->width = mt9m001->rect.width; mf->height = mt9m001->rect.height;
@@ -371,6 +374,7 @@ static int mt9m001_s_fmt(struct v4l2_subdev *sd, }static int mt9m001_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/mt9m111.c +4 -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) {
@@ -515,6 +517,7 @@ static int mt9m111_get_selection(struct v4l2_subdev *sd, }static int mt9m111_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -617,6 +620,7 @@ static int mt9m111_set_pixfmt(struct mt9m111 *mt9m111, }static int mt9m111_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/mt9m114.c +6 -0
@@ -1249,6 +1249,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) {
@@ -1276,6 +1277,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) {
@@ -1299,6 +1301,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) {
@@ -1872,6 +1875,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) {
@@ -1918,6 +1922,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) {
@@ -1977,6 +1982,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 +4 -0
@@ -574,6 +574,7 @@ __mt9p031_get_pad_crop(struct mt9p031 *mt9p031, }static int mt9p031_get_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -585,6 +586,7 @@ static int mt9p031_get_format(struct v4l2_subdev *subdev, }static int mt9p031_set_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -623,6 +625,7 @@ static int mt9p031_set_format(struct v4l2_subdev *subdev, }static int mt9p031_get_selection (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -647,6 +650,7 @@ static int mt9p031_get_selection(struct v4l2_subdev *subdev, }static int mt9p031_set_selection (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/mt9t112.c +4 -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) {
@@ -912,6 +914,7 @@ static int mt9t112_set_selection(struct v4l2_subdev *sd, }static int mt9t112_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -953,6 +956,7 @@ static int mt9t112_s_fmt(struct v4l2_subdev *sd, }static int mt9t112_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
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 +4 -0
@@ -468,6 +468,7 @@ static int mt9v032_enum_frame_size(struct v4l2_subdev *subdev, }static int mt9v032_get_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -503,6 +504,7 @@ static unsigned int mt9v032_calc_ratio(unsigned int input, unsigned int output) }static int mt9v032_set_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -547,6 +549,7 @@ static int mt9v032_set_format(struct v4l2_subdev *subdev, }static int mt9v032_get_selection (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -561,6 +564,7 @@ static int mt9v032_get_selection(struct v4l2_subdev *subdev, }static int mt9v032_set_selection (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/mt9v111.c +2 -0
@@ -868,6 +868,7 @@ static int mt9v111_enum_frame_size(struct v4l2_subdev *subdev, }static int mt9v111_get_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -886,6 +887,7 @@ static int mt9v111_get_format(struct v4l2_subdev *subdev, }static int mt9v111_set_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/og01a1b.c +2 -0
@@ -759,6 +759,7 @@ static int og01a1b_set_stream(struct v4l2_subdev *sd, int enable) }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) {
@@ -800,6 +801,7 @@ static int og01a1b_set_format(struct v4l2_subdev *sd, }static int og01a1b_get_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/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 +3 -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) {
@@ -328,6 +329,7 @@ static int ov02a10_set_fmt(struct v4l2_subdev *sd, }static int ov02a10_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -523,7 +525,7 @@ static int ov02a10_init_state(struct v4l2_subdev *sd, } }; -ov02a10_set_fmt (sd, sd_state, &fmt); +ov02a10_set_fmt (sd,NULL , sd_state, &fmt);return 0 ; }
drivers/media/i2c/ov02c10.c +1 -0
@@ -707,6 +707,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 +2 -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) {
@@ -642,6 +643,7 @@ static int ov02e10_set_format(struct v4l2_subdev *sd, }static int ov02e10_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/ov08d10.c +2 -0
@@ -1128,6 +1128,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) {
@@ -1176,6 +1177,7 @@ static int ov08d10_set_format(struct v4l2_subdev *sd, }static int ov08d10_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/ov08x40.c +2 -0
@@ -1829,6 +1829,7 @@ static int ov08x40_do_get_pad_format(struct ov08x40 *ov08x, }static int ov08x40_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1844,6 +1845,7 @@ static int ov08x40_get_pad_format(struct v4l2_subdev *sd,static int ov08x40_set_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/ov13858.c +2 -0
@@ -1330,6 +1330,7 @@ static int ov13858_do_get_pad_format(struct ov13858 *ov13858, }static int ov13858_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1345,6 +1346,7 @@ static int ov13858_get_pad_format(struct v4l2_subdev *sd,static int ov13858_set_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/ov13b10.c +2 -0
@@ -1096,6 +1096,7 @@ static int ov13b10_do_get_pad_format(struct ov13b10 *ov13b, }static int ov13b10_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1111,6 +1112,7 @@ static int ov13b10_get_pad_format(struct v4l2_subdev *sd,static int ov13b10_set_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/ov2640.c +3 -0
@@ -909,6 +909,7 @@ static int ov2640_set_params(struct i2c_client *client, }static int ov2640_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -938,6 +939,7 @@ static int ov2640_get_fmt(struct v4l2_subdev *sd, }static int ov2640_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1028,6 +1030,7 @@ static int ov2640_enum_mbus_code(struct v4l2_subdev *sd, }static int ov2640_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/ov2659.c +2 -0
@@ -1022,6 +1022,7 @@ static int ov2659_enum_frame_sizes(struct v4l2_subdev *sd, }static int ov2659_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1080,6 +1081,7 @@ static void __ov2659_try_frame_size(struct v4l2_mbus_framefmt *mf, }static int ov2659_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/ov2680.c +4 -0
@@ -623,6 +623,7 @@ static int ov2680_enum_mbus_code(struct v4l2_subdev *sd, }static int ov2680_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -640,6 +641,7 @@ static int ov2680_get_fmt(struct v4l2_subdev *sd, }static int ov2680_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -704,6 +706,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd, }static int ov2680_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
@@ -734,6 +737,7 @@ static int ov2680_get_selection(struct v4l2_subdev *sd, }static int ov2680_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/ov2685.c +3 -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) {
@@ -353,6 +354,7 @@ static int ov2685_set_fmt(struct v4l2_subdev *sd, }static int ov2685_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -413,6 +415,7 @@ __ov2685_get_pad_crop(struct ov2685 *ov2685, }static int ov2685_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
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 +3 -0
@@ -2786,6 +2786,7 @@ static int ov5640_try_frame_interval(struct ov5640_dev *sensor, }static int ov5640_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -2948,6 +2949,7 @@ static int ov5640_update_pixel_rate(struct ov5640_dev *sensor) }static int ov5640_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -2994,6 +2996,7 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd, }static int ov5640_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
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 +3 -0
@@ -762,6 +762,7 @@ static int ov5647_enum_frame_size(struct v4l2_subdev *sd, }static int ov5647_get_pad_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -787,6 +788,7 @@ static int ov5647_get_pad_fmt(struct v4l2_subdev *sd, }static int ov5647_set_pad_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -837,6 +839,7 @@ static int ov5647_set_pad_fmt(struct v4l2_subdev *sd, }static int ov5647_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/ov5648.c +2 -0
@@ -2194,6 +2194,7 @@ static void ov5648_mbus_format_fill(struct v4l2_mbus_framefmt *mbus_format, }static int ov5648_get_fmt (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -2215,6 +2216,7 @@ static int ov5648_get_fmt(struct v4l2_subdev *subdev, }static int ov5648_set_fmt (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/ov5670.c +3 -0
@@ -2272,6 +2272,7 @@ static int ov5670_do_get_pad_format(struct ov5670 *ov5670, }static int ov5670_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -2286,6 +2287,7 @@ static int ov5670_get_pad_format(struct v4l2_subdev *sd, }static int ov5670_set_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -2554,6 +2556,7 @@ __ov5670_get_pad_crop(struct ov5670 *sensor, struct v4l2_subdev_state *state, }static int ov5670_get_selection (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/ov5675.c +3 -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) {
@@ -1057,6 +1058,7 @@ static int ov5675_set_format(struct v4l2_subdev *sd, }static int ov5675_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1075,6 +1077,7 @@ static int ov5675_get_format(struct v4l2_subdev *sd, }static int ov5675_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/ov5693.c +4 -0
@@ -796,6 +796,7 @@ __ov5693_get_pad_crop(struct ov5693_device *ov5693, }static int ov5693_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
@@ -807,6 +808,7 @@ static int ov5693_get_fmt(struct v4l2_subdev *sd, }static int ov5693_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
@@ -882,6 +884,7 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd, }static int ov5693_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
@@ -915,6 +918,7 @@ static int ov5693_get_selection(struct v4l2_subdev *sd, }static int ov5693_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/ov5695.c +2 -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) {
@@ -838,6 +839,7 @@ static int ov5695_set_fmt(struct v4l2_subdev *sd, }static int ov5695_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
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 +4 -1
@@ -1150,6 +1150,7 @@ __ov7251_get_pad_format(struct ov7251 *ov7251, }static int ov7251_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1214,6 +1215,7 @@ ov7251_find_mode_by_ival(struct ov7251 *ov7251, struct v4l2_fract *timeperframe) }static int ov7251_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1296,12 +1298,13 @@ static int ov7251_init_state(struct v4l2_subdev *subdev, } }; -ov7251_set_format (subdev, sd_state, &fmt); +ov7251_set_format (subdev,NULL , sd_state, &fmt);return 0 ; }static int ov7251_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/ov7670.c +2 -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) {
@@ -1133,6 +1134,7 @@ static int ov7670_set_fmt(struct v4l2_subdev *sd, }static int ov7670_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/ov772x.c +3 -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) {
@@ -1193,6 +1194,7 @@ static int ov772x_get_selection(struct v4l2_subdev *sd, }static int ov772x_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1212,6 +1214,7 @@ static int ov772x_get_fmt(struct v4l2_subdev *sd, }static int ov772x_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/ov7740.c +2 -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) {
@@ -808,6 +809,7 @@ static int ov7740_set_fmt(struct v4l2_subdev *sd, }static int ov7740_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/ov8856.c +2 -0
@@ -2115,6 +2115,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) {
@@ -2161,6 +2162,7 @@ static int ov8856_set_format(struct v4l2_subdev *sd, }static int ov8856_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
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 +3 -0
@@ -2668,6 +2668,7 @@ static void ov8865_mbus_format_fill(struct v4l2_mbus_framefmt *mbus_format, }static int ov8865_get_fmt (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -2689,6 +2690,7 @@ static int ov8865_get_fmt(struct v4l2_subdev *subdev, }static int ov8865_set_fmt (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -2797,6 +2799,7 @@ __ov8865_get_pad_crop(struct ov8865_sensor *sensor, }static int ov8865_get_selection (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/ov9282.c +4 -1
@@ -963,6 +963,7 @@ static void ov9282_fill_pad_format(struct ov9282 *ov9282,* Return: 0 if successful, error code otherwise. */ static int ov9282_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -994,6 +995,7 @@ static int ov9282_get_pad_format(struct v4l2_subdev *sd,* Return: 0 if successful, error code otherwise. */ 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) {
@@ -1051,7 +1053,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 *
@@ -1070,6 +1072,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 +2 -0
@@ -1181,6 +1181,7 @@ static int ov965x_set_frame_interval(struct v4l2_subdev *sd, }static int ov965x_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1226,6 +1227,7 @@ static void __ov965x_try_frame_size(struct v4l2_mbus_framefmt *mf, }static int ov965x_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/ov9734.c +2 -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) {
@@ -722,6 +723,7 @@ static int ov9734_set_format(struct v4l2_subdev *sd, }static int ov9734_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/rdacm20.c +1 -0
@@ -415,6 +415,7 @@ static int rdacm20_enum_mbus_code(struct v4l2_subdev *sd, }static int rdacm20_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/rdacm21.c +1 -0
@@ -294,6 +294,7 @@ static int rdacm21_enum_mbus_code(struct v4l2_subdev *sd, }static int rdacm21_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/rj54n1cb0c.c +4 -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) {
@@ -603,6 +605,7 @@ static int rj54n1_get_selection(struct v4l2_subdev *sd, }static int rj54n1_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -973,6 +976,7 @@ static int rj54n1_reg_init(struct i2c_client *client) }static int rj54n1_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/s5c73m3/s5c73m3-core.c +4 -0
@@ -995,6 +995,7 @@ static int s5c73m3_oif_get_pad_code(int pad, int index) }static int s5c73m3_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1030,6 +1031,7 @@ static int s5c73m3_get_fmt(struct v4l2_subdev *sd, }static int s5c73m3_oif_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1069,6 +1071,7 @@ static int s5c73m3_oif_get_fmt(struct v4l2_subdev *sd, }static int s5c73m3_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1108,6 +1111,7 @@ static int s5c73m3_set_fmt(struct v4l2_subdev *sd, }static int s5c73m3_oif_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
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
@@ -1276,6 +1276,7 @@ static int s5k5baf_try_isp_format(struct v4l2_mbus_framefmt *mf) }static int s5k5baf_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1307,6 +1308,7 @@ static int s5k5baf_get_fmt(struct v4l2_subdev *sd, }static int s5k5baf_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1370,6 +1372,7 @@ static int s5k5baf_is_bound_target(u32 target) }static int s5k5baf_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/s5k6a3.c +2 -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) {
@@ -149,6 +150,7 @@ static int s5k6a3_set_fmt(struct v4l2_subdev *sd, }static int s5k6a3_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
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 +2 -0
@@ -543,6 +543,7 @@ static int saa6752hs_init(struct v4l2_subdev *sd, u32 leading_null_bytes) }static int saa6752hs_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -563,6 +564,7 @@ static int saa6752hs_get_fmt(struct v4l2_subdev *sd, }static int saa6752hs_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
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/tc358743.c +2 -0
@@ -1797,6 +1797,7 @@ static u32 tc358743_g_colorspace(u32 code) }static int tc358743_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1816,6 +1817,7 @@ static int tc358743_get_fmt(struct v4l2_subdev *sd, }static int tc358743_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/tc358746.c +2 -1
@@ -873,6 +873,7 @@ static int tc358746_enum_mbus_code(struct v4l2_subdev *sd, }static int tc358746_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -881,7 +882,7 @@ static int tc358746_set_fmt(struct v4l2_subdev *sd,/* Source follows the sink */ if (format->pad ==TC358746_SOURCE ) -return v4l2_subdev_get_fmt (sd, sd_state, format); +return v4l2_subdev_get_fmt (sd,NULL , sd_state, format); sink_fmt =v4l2_subdev_state_get_format (sd_state,TC358746_SINK );
drivers/media/i2c/tda1997x.c +2 -0
@@ -1776,6 +1776,7 @@ static void tda1997x_fill_format(struct tda1997x_state *state, }static int tda1997x_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1798,6 +1799,7 @@ static int tda1997x_get_format(struct v4l2_subdev *sd, }static int tda1997x_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
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 +2 -0
@@ -886,6 +886,7 @@ static int tvp514x_enum_mbus_code(struct v4l2_subdev *sd,* Retrieves pad format which is active or tried based on requirement */ static int tvp514x_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -918,6 +919,7 @@ static int tvp514x_get_pad_format(struct v4l2_subdev *sd,* Set pad format for the output pad */ 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 +3 -0
@@ -1045,6 +1045,7 @@ tvp5150_get_pad_crop(struct tvp5150 *decoder, }static int tvp5150_fill_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1104,6 +1105,7 @@ static void tvp5150_set_hw_selection(struct v4l2_subdev *sd, }static int tvp5150_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -1156,6 +1158,7 @@ static int tvp5150_set_selection(struct v4l2_subdev *sd, }static int tvp5150_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/i2c/tvp7002.c +3 -1
@@ -830,6 +830,7 @@ tvp7002_enum_mbus_code(struct v4l2_subdev *sd,*/ static int tvp7002_get_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -854,10 +855,11 @@ tvp7002_get_pad_format(struct v4l2_subdev *sd,*/ static int tvp7002_set_pad_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) { -return tvp7002_get_pad_format (sd, sd_state, fmt); +return tvp7002_get_pad_format (sd,NULL , sd_state, fmt); }/* V4L2 core operation handlers */
drivers/media/i2c/tw9900.c +2 -0
@@ -184,6 +184,7 @@ static void tw9900_fill_fmt(const struct tw9900_mode *mode, }static int tw9900_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -198,6 +199,7 @@ static int tw9900_get_fmt(struct v4l2_subdev *sd, }static int tw9900_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
drivers/media/i2c/tw9910.c +3 -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) {
@@ -741,6 +742,7 @@ static int tw9910_get_selection(struct v4l2_subdev *sd, }static int tw9910_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -792,6 +794,7 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, }static int tw9910_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
drivers/media/i2c/vd55g1.c +3 -1
@@ -1217,6 +1217,7 @@ static int vd55g1_patch(struct vd55g1 *sensor) }static int vd55g1_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -1300,6 +1301,7 @@ static int vd55g1_new_format_change_controls(struct vd55g1 *sensor, }static int vd55g1_set_pad_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *sd_fmt) {
@@ -1365,7 +1367,7 @@ static int vd55g1_init_state(struct v4l2_subdev *sd,vd55g1_get_fmt_code (sensor,VD55G1_MBUS_CODE_DEF ), &fmt.format); -return vd55g1_set_pad_fmt (sd, sd_state, &fmt); +return vd55g1_set_pad_fmt (sd,NULL , sd_state, &fmt); } static int vd55g1_enum_frame_size(struct v4l2_subdev *sd,
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 +4 -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) {
@@ -687,6 +688,7 @@ static int vgxy61_enum_mbus_code(struct v4l2_subdev *sd, }static int vgxy61_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1197,6 +1199,7 @@ static int vgxy61_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, }static int vgxy61_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -1260,7 +1263,7 @@ static int vgxy61_init_state(struct v4l2_subdev *sd,vgxy61_fill_framefmt (sensor, sensor->current_mode, &fmt.format,VGXY61_MEDIA_BUS_FMT_DEF ); -return vgxy61_set_fmt (sd, sd_state, &fmt); +return vgxy61_set_fmt (sd,NULL , sd_state, &fmt); }static int vgxy61_s_ctrl (struct v4l2_ctrl *ctrl)
drivers/media/pci/cobalt/cobalt-driver.c +4 -4
@@ -525,8 +525,8 @@ static int cobalt_subdevs_init(struct cobalt *cobalt) &cobalt_edid);if (err)return err; - err =v4l2_subdev_call (s[i].sd, pad, set_fmt,NULL , - &sd_fmt); + err =v4l2_subdev_call (s[i].sd, pad, set_fmt,NULL ,NULL , + &sd_fmt);if (err)return err;/* Reset channel video module */
@@ -609,8 +609,8 @@ static int cobalt_subdevs_hsma_init(struct cobalt *cobalt)if (err)return err; - err =v4l2_subdev_call (s->sd, pad, set_fmt,NULL , - &sd_fmt); + err =v4l2_subdev_call (s->sd, pad, set_fmt,NULL ,NULL , + &sd_fmt);if (err)return err; cobalt->have_hsma_rx = true;
drivers/media/pci/cobalt/cobalt-v4l2.c +7 -7
@@ -172,7 +172,7 @@ static void cobalt_enable_output(struct cobalt_stream *s) sd_fmt.format.code =MEDIA_BUS_FMT_RGB888_1X24 ;break ; } -v4l2_subdev_call (s->sd, pad, set_fmt,NULL , &sd_fmt); +v4l2_subdev_call (s->sd, pad, set_fmt,NULL ,NULL , &sd_fmt);iowrite32 (0 , &vo->control);/* 1080p60 */
@@ -223,14 +223,14 @@ static void cobalt_enable_input(struct cobalt_stream *s)iowrite32 (M00235_CONTROL_BITMAP_ENABLE_MSK | (1 <<M00235_CONTROL_BITMAP_PACK_FORMAT_OFST ), &packer->control); -v4l2_subdev_call (s->sd, pad, set_fmt,NULL , +v4l2_subdev_call (s->sd, pad, set_fmt,NULL ,NULL , &sd_fmt_yuyv);break ;case V4L2_PIX_FMT_RGB24 :iowrite32 (M00235_CONTROL_BITMAP_ENABLE_MSK | (2 <<M00235_CONTROL_BITMAP_PACK_FORMAT_OFST ), &packer->control); -v4l2_subdev_call (s->sd, pad, set_fmt,NULL , +v4l2_subdev_call (s->sd, pad, set_fmt,NULL ,NULL , &sd_fmt_rgb);break ;case V4L2_PIX_FMT_BGR32 :
@@ -238,7 +238,7 @@ static void cobalt_enable_input(struct cobalt_stream *s)M00235_CONTROL_BITMAP_ENDIAN_FORMAT_MSK | (3 <<M00235_CONTROL_BITMAP_PACK_FORMAT_OFST ), &packer->control); -v4l2_subdev_call (s->sd, pad, set_fmt,NULL , +v4l2_subdev_call (s->sd, pad, set_fmt,NULL ,NULL , &sd_fmt_rgb);break ; }
@@ -716,7 +716,7 @@ static int cobalt_g_fmt_vid_cap(struct file *file, void *priv, .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; -v4l2_subdev_call (s->sd, pad, get_fmt,NULL , &sd_fmt); +v4l2_subdev_call (s->sd, pad, get_fmt,NULL ,NULL , &sd_fmt);v4l2_fill_pix_format (pix, &sd_fmt.format); }
@@ -760,7 +760,7 @@ static int cobalt_try_fmt_vid_cap(struct file *file, void *priv, .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; -v4l2_subdev_call (s->sd, pad, get_fmt,NULL , &sd_fmt); +v4l2_subdev_call (s->sd, pad, get_fmt,NULL ,NULL , &sd_fmt);v4l2_fill_pix_format (pix, &sd_fmt.format); }
@@ -938,7 +938,7 @@ static int cobalt_s_fmt_vid_out(struct file *file, void *priv, s->ycbcr_enc = pix->ycbcr_enc; s->quantization = pix->quantization;v4l2_fill_mbus_format (&sd_fmt.format, pix, code); -v4l2_subdev_call (s->sd, pad, set_fmt,NULL , &sd_fmt); +v4l2_subdev_call (s->sd, pad, set_fmt,NULL ,NULL , &sd_fmt);return 0 ; }
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 +3 -2
@@ -1229,6 +1229,7 @@ static int cio2_subdev_init_state(struct v4l2_subdev *sd, }static int cio2_subdev_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1241,7 +1242,7 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd,* source always propagates from sink */ if (fmt->pad ==CIO2_PAD_SOURCE ) -return v4l2_subdev_get_fmt (sd, sd_state, fmt); +return v4l2_subdev_get_fmt (sd,NULL , sd_state, fmt); fmt->format.code = formats[0 ].mbus_code;
@@ -1287,7 +1288,7 @@ static int cio2_subdev_link_validate_get_format(struct media_pad *pad,memset (fmt,0 ,sizeof (*fmt)); fmt->which =V4L2_SUBDEV_FORMAT_ACTIVE ; fmt->pad = pad->index; -return v4l2_subdev_call (sd, pad, get_fmt,NULL , fmt); +return v4l2_subdev_call (sd, pad, get_fmt,NULL ,NULL , fmt); }return -EINVAL ;
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 +2 -1
@@ -160,6 +160,7 @@ u32 ipu6_isys_convert_bayer_order(u32 code, int x, int y) }int ipu6_isys_subdev_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
@@ -174,7 +175,7 @@ int ipu6_isys_subdev_set_fmt(struct v4l2_subdev *sd,/* No transcoding, source and sink formats must match. */ if ((sd->entity.pads[format->pad].flags &MEDIA_PAD_FL_SOURCE ) && sd->entity.num_pads >1 ) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format); format->format.width =clamp (format->format.width,IPU6_ISYS_MIN_WIDTH ,IPU6_ISYS_MAX_WIDTH );
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
@@ -591,7 +591,7 @@ static int ivtv_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f format.format.width = fmt->fmt.pix.width; format.format.height = h; format.format.code =MEDIA_BUS_FMT_FIXED ; -v4l2_subdev_call (itv->sd_video, pad, set_fmt,NULL , &format); +v4l2_subdev_call (itv->sd_video, pad, set_fmt,NULL ,NULL , &format);return ivtv_g_fmt_vid_cap (file, fh, fmt); }
drivers/media/pci/saa7134/saa7134-empress.c +3 -3
@@ -103,7 +103,7 @@ static int empress_g_fmt_vid_cap(struct file *file, void *priv, };struct v4l2_mbus_framefmt *mbus_fmt = &fmt.format; -saa_call_all (dev, pad, get_fmt,NULL , &fmt); +saa_call_all (dev, pad, get_fmt,NULL ,NULL , &fmt);v4l2_fill_pix_format (&f->fmt.pix, mbus_fmt); f->fmt.pix.pixelformat =V4L2_PIX_FMT_MPEG ;
@@ -122,7 +122,7 @@ static int empress_s_fmt_vid_cap(struct file *file, void *priv, };v4l2_fill_mbus_format (&format.format, &f->fmt.pix,MEDIA_BUS_FMT_FIXED ); -saa_call_all (dev, pad, set_fmt,NULL , &format); +saa_call_all (dev, pad, set_fmt,NULL ,NULL , &format);v4l2_fill_pix_format (&f->fmt.pix, &format.format); f->fmt.pix.pixelformat =V4L2_PIX_FMT_MPEG ;
@@ -145,7 +145,7 @@ static int empress_try_fmt_vid_cap(struct file *file, void *priv, };v4l2_fill_mbus_format (&format.format, &f->fmt.pix,MEDIA_BUS_FMT_FIXED ); -saa_call_all (dev, pad, set_fmt, &pad_state, &format); +saa_call_all (dev, pad, set_fmt,NULL , &pad_state, &format);v4l2_fill_pix_format (&f->fmt.pix, &format.format); f->fmt.pix.pixelformat =V4L2_PIX_FMT_MPEG ;
drivers/media/platform/amlogic/c3/isp/c3-isp-capture.c +1 -1
@@ -517,7 +517,7 @@ static int c3_isp_cap_link_validate(struct media_link *link) };int ret; - ret =v4l2_subdev_call_state_active (sd, pad, get_fmt, &src_fmt); + ret =v4l2_subdev_call_ci_state_active (sd, pad, get_fmt, &src_fmt);if (ret)return ret;
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 +2 -1
@@ -521,6 +521,7 @@ static int c3_mipi_adap_enum_mbus_code(struct v4l2_subdev *sd, }static int c3_mipi_adap_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
@@ -528,7 +529,7 @@ static int c3_mipi_adap_set_fmt(struct v4l2_subdev *sd,const struct c3_adap_pix_format *pix_format;if (format->pad !=C3_MIPI_ADAP_PAD_SINK ) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format); pix_format =c3_mipi_adap_find_format (format->format.code);if (!pix_format)
drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c +2 -1
@@ -491,6 +491,7 @@ static int c3_mipi_csi_enum_mbus_code(struct v4l2_subdev *sd, }static int c3_mipi_csi_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
@@ -498,7 +499,7 @@ static int c3_mipi_csi_set_fmt(struct v4l2_subdev *sd,unsigned int i;if (format->pad !=C3_MIPI_CSI2_PAD_SINK ) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format); fmt =v4l2_subdev_state_get_format (state, format->pad);
drivers/media/platform/arm/mali-c55/mali-c55-capture.c +1 -1
@@ -291,7 +291,7 @@ static int mali_c55_link_validate(struct media_link *link) };int ret; - ret =v4l2_subdev_call (sd, pad, get_fmt,NULL , &sd_fmt); + ret =v4l2_subdev_call (sd, pad, get_fmt,NULL ,NULL , &sd_fmt);if (ret)return ret;
drivers/media/platform/arm/mali-c55/mali-c55-isp.c +4 -1
@@ -230,6 +230,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) {
@@ -244,7 +245,7 @@ static int mali_c55_isp_set_fmt(struct v4l2_subdev *sd,* format. */ if (format->pad !=MALI_C55_ISP_PAD_SINK_VIDEO ) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format); sink_fmt =v4l2_subdev_state_get_format (state,MALI_C55_ISP_PAD_SINK_VIDEO );
@@ -292,6 +293,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) {
@@ -305,6 +307,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,NULL , state, format); -return mali_c55_rsz_set_source_fmt (sd, state, format); +return mali_c55_rsz_set_source_fmt (sd,NULL , state, format); }static int mali_c55_rsz_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
@@ -850,6 +854,7 @@ static int mali_c55_rsz_get_selection(struct v4l2_subdev *sd, }static int mali_c55_rsz_set_crop (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
@@ -908,6 +913,7 @@ static int mali_c55_rsz_set_crop(struct v4l2_subdev *sd, }static int mali_c55_rsz_set_compose (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
@@ -956,6 +962,7 @@ static int mali_c55_rsz_set_compose(struct v4l2_subdev *sd, }static int mali_c55_rsz_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
@@ -963,10 +970,10 @@ static int mali_c55_rsz_set_selection(struct v4l2_subdev *sd,return -EINVAL ;if (sel->target ==V4L2_SEL_TGT_CROP ) -return mali_c55_rsz_set_crop (sd, state, sel); +return mali_c55_rsz_set_crop (sd,NULL , state, sel);if (sel->target ==V4L2_SEL_TGT_COMPOSE ) -return mali_c55_rsz_set_compose (sd, state, sel); +return mali_c55_rsz_set_compose (sd,NULL , state, sel);return -EINVAL ; }
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 +2 -1
@@ -1331,6 +1331,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) {
@@ -1346,7 +1347,7 @@ static int unicam_subdev_set_format(struct v4l2_subdev *sd,/* No transcoding, source and sink formats must match. */ if (unicam_sd_pad_is_source (format->pad)) -return v4l2_subdev_get_fmt (sd, state, format); +return v4l2_subdev_get_fmt (sd,NULL , state, format);/* * Allowed formats for the stream on the sink pad depend on what source
drivers/media/platform/cadence/cdns-csi2rx.c +4 -3
@@ -276,7 +276,7 @@ static int csi2rx_configure_ext_dphy(struct csi2rx_priv *csi2rx)s64 link_freq;int ret; - ret =v4l2_subdev_call_state_active (&csi2rx->subdev, pad, get_fmt, + ret =v4l2_subdev_call_ci_state_active (&csi2rx->subdev, pad, get_fmt, &sd_fmt);if (ret <0 )return ret;
@@ -532,6 +532,7 @@ static int csi2rx_enum_mbus_code(struct v4l2_subdev *subdev, }static int csi2rx_set_fmt (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *format) {
@@ -540,7 +541,7 @@ static int csi2rx_set_fmt(struct v4l2_subdev *subdev,/* No transcoding, source and sink formats must match. */ if (format->pad !=CSI2RX_PAD_SINK ) -return v4l2_subdev_get_fmt (subdev, state, format); +return v4l2_subdev_get_fmt (subdev,NULL , state, format);if (!csi2rx_get_fmt_by_code (format->format.code)) format->format.code = formats[0 ].code;
@@ -577,7 +578,7 @@ static int csi2rx_init_state(struct v4l2_subdev *subdev, }, }; -return csi2rx_set_fmt (subdev, state, &format); +return csi2rx_set_fmt (subdev,NULL , state, &format); } int cdns_csi2rx_negotiate_ppc(struct v4l2_subdev *subdev, unsigned int pad,
drivers/media/platform/cadence/cdns-csi2tx.c +5 -2
@@ -170,6 +170,7 @@ static int csi2tx_enum_mbus_code(struct v4l2_subdev *subdev,static struct v4l2_mbus_framefmt *__csi2tx_get_pad_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -182,6 +183,7 @@ __csi2tx_get_pad_format(struct v4l2_subdev *subdev, }static int csi2tx_get_pad_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -191,7 +193,7 @@ static int csi2tx_get_pad_format(struct v4l2_subdev *subdev,if (fmt->pad ==CSI2TX_PAD_SOURCE )return -EINVAL ; - format =__csi2tx_get_pad_format (subdev, sd_state, fmt); + format =__csi2tx_get_pad_format (subdev,NULL , sd_state, fmt);if (!format)return -EINVAL ;
@@ -201,6 +203,7 @@ static int csi2tx_get_pad_format(struct v4l2_subdev *subdev, }static int csi2tx_set_pad_format (struct v4l2_subdev *subdev, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -214,7 +217,7 @@ static int csi2tx_set_pad_format(struct v4l2_subdev *subdev,if (!csi2tx_get_fmt_from_mbus (fmt->format.code)) src_format = &fmt_default; - dst_format =__csi2tx_get_pad_format (subdev, sd_state, fmt); + dst_format =__csi2tx_get_pad_format (subdev,NULL , sd_state, fmt);if (!dst_format)return -EINVAL ;
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 +2 -0
@@ -225,6 +225,7 @@ static int csi2dc_enum_mbus_code(struct v4l2_subdev *csi2dc_sd, }static int csi2dc_get_fmt (struct v4l2_subdev *csi2dc_sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -245,6 +246,7 @@ static int csi2dc_get_fmt(struct v4l2_subdev *csi2dc_sd, }static int csi2dc_set_fmt (struct v4l2_subdev *csi2dc_sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *req_fmt) {
drivers/media/platform/microchip/microchip-isc-base.c +1 -0
@@ -916,6 +916,7 @@ static int isc_link_validate(struct media_link *link)/* Get current format from subdev */ ret =v4l2_subdev_call (isc->current_subdev->sd, pad, get_fmt,NULL , +NULL , &format);if (ret)return ret;
drivers/media/platform/microchip/microchip-isc-scaler.c +3 -0
@@ -26,6 +26,7 @@ static void isc_scaler_prepare_fmt(struct v4l2_mbus_framefmt *framefmt) };static int isc_scaler_get_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *format) {
@@ -46,6 +47,7 @@ static int isc_scaler_get_fmt(struct v4l2_subdev *sd, }static int isc_scaler_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *req_fmt) {
@@ -124,6 +126,7 @@ static int isc_scaler_enum_mbus_code(struct v4l2_subdev *sd, }static int isc_scaler_g_sel (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
drivers/media/platform/nxp/imx-mipi-csis.c +3 -2
@@ -1103,6 +1103,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) {
@@ -1115,7 +1116,7 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd,* modified. */ if (sdformat->pad ==CSIS_PAD_SOURCE ) -return v4l2_subdev_get_fmt (sd, state, sdformat); +return v4l2_subdev_get_fmt (sd,NULL , state, sdformat);if (sdformat->pad !=CSIS_PAD_SINK )return -EINVAL ;
@@ -1224,7 +1225,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 +2 -1
@@ -1412,7 +1412,7 @@ static int imx7_csi_video_validate_fmt(struct imx7_csi *csi)int ret;/* Retrieve the media bus format on the source subdev. */ - ret =v4l2_subdev_call_state_active (&csi->sd, pad, get_fmt, &fmt_src); + ret =v4l2_subdev_call_ci_state_active (&csi->sd, pad, get_fmt, &fmt_src);if (ret)return ret;
@@ -1890,6 +1890,7 @@ static void imx7_csi_try_fmt(struct v4l2_subdev *sd, }static int imx7_csi_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *sdformat) {
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c +2 -1
@@ -248,6 +248,7 @@ static int mxc_isi_crossbar_enum_mbus_code(struct v4l2_subdev *sd, }static int mxc_isi_crossbar_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *fmt) {
@@ -264,7 +265,7 @@ static int mxc_isi_crossbar_set_fmt(struct v4l2_subdev *sd,* can't be modified. */ if (fmt->pad >= xbar->num_sinks) -return v4l2_subdev_get_fmt (sd, state, fmt); +return v4l2_subdev_get_fmt (sd,NULL , state, fmt);/* Validate the requested format. */ if (!mxc_isi_bus_format_by_code (fmt->format.code,MXC_ISI_PIPE_PAD_SINK ))
drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c +3 -0
@@ -448,6 +448,7 @@ static int mxc_isi_pipe_enum_mbus_code(struct v4l2_subdev *sd, }static int mxc_isi_pipe_set_fmt (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_format *fmt) {
@@ -543,6 +544,7 @@ static int mxc_isi_pipe_set_fmt(struct v4l2_subdev *sd, }static int mxc_isi_pipe_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
@@ -602,6 +604,7 @@ static int mxc_isi_pipe_get_selection(struct v4l2_subdev *sd, }static int mxc_isi_pipe_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *state,struct v4l2_subdev_selection *sel) {
drivers/media/platform/nxp/imx8mq-mipi-csi2.c +2 -1
@@ -621,6 +621,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) {
@@ -632,7 +633,7 @@ static int imx8mq_mipi_csi_set_fmt(struct v4l2_subdev *sd,* modified. */ if (sdformat->pad ==MIPI_CSI2_PAD_SOURCE ) -return v4l2_subdev_get_fmt (sd, sd_state, sdformat); +return v4l2_subdev_get_fmt (sd,NULL , sd_state, sdformat);if (sdformat->pad !=MIPI_CSI2_PAD_SINK )return -EINVAL ;
drivers/media/platform/qcom/camss/camss-csid.c +3 -1
@@ -961,6 +961,7 @@ static int csid_enum_frame_size(struct v4l2_subdev *sd,* Return -EINVAL or zero on success */ static int csid_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -985,6 +986,7 @@ static int csid_get_format(struct v4l2_subdev *sd,* Return -EINVAL or zero on success */ static int csid_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1034,7 +1036,7 @@ static int csid_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) } }; -return csid_set_format (sd, fh ? fh->state :NULL , &format); +return csid_set_format (sd,NULL , fh ? fh->state :NULL , &format); }/*
drivers/media/platform/qcom/camss/camss-csiphy.c +3 -1
@@ -479,6 +479,7 @@ static int csiphy_enum_frame_size(struct v4l2_subdev *sd,* Return -EINVAL or zero on success */ static int csiphy_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -503,6 +504,7 @@ static int csiphy_get_format(struct v4l2_subdev *sd,* Return -EINVAL or zero on success */ static int csiphy_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -555,7 +557,7 @@ static int csiphy_init_formats(struct v4l2_subdev *sd, } }; -return csiphy_set_format (sd, fh ? fh->state :NULL , &format); +return csiphy_set_format (sd,NULL , fh ? fh->state :NULL , &format); } static bool csiphy_match_clock_name(const char *clock_name, const char *format,
drivers/media/platform/qcom/camss/camss-ispif.c +3 -1
@@ -1013,6 +1013,7 @@ static int ispif_enum_frame_size(struct v4l2_subdev *sd,* Return -EINVAL or zero on success */ static int ispif_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1037,6 +1038,7 @@ static int ispif_get_format(struct v4l2_subdev *sd,* Return -EINVAL or zero on success */ static int ispif_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1085,7 +1087,7 @@ static int ispif_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) } }; -return ispif_set_format (sd, fh ? fh->state :NULL , &format); +return ispif_set_format (sd,NULL , fh ? fh->state :NULL , &format); }/*
drivers/media/platform/qcom/camss/camss-vfe.c +11 -6
@@ -1545,6 +1545,7 @@ static int vfe_enum_frame_size(struct v4l2_subdev *sd,* Return -EINVAL or zero on success */ static int vfe_get_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1561,6 +1562,7 @@ static int vfe_get_format(struct v4l2_subdev *sd, }static int vfe_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel);
@@ -1573,6 +1575,7 @@ static int vfe_set_selection(struct v4l2_subdev *sd,* Return -EINVAL or zero on success */ static int vfe_set_format (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_format *fmt) {
@@ -1607,7 +1610,7 @@ static int vfe_set_format(struct v4l2_subdev *sd, sel.target =V4L2_SEL_TGT_COMPOSE ; sel.r.width = fmt->format.width; sel.r.height = fmt->format.height; - ret =vfe_set_selection (sd, sd_state, &sel); + ret =vfe_set_selection (sd,NULL , sd_state, &sel);if (ret <0 )return ret; }
@@ -1624,6 +1627,7 @@ static int vfe_set_format(struct v4l2_subdev *sd,* Return -EINVAL or zero on success */ static int vfe_get_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -1640,7 +1644,7 @@ static int vfe_get_selection(struct v4l2_subdev *sd,case V4L2_SEL_TGT_COMPOSE_BOUNDS : fmt.pad = sel->pad; fmt.which = sel->which; - ret =vfe_get_format (sd, sd_state, &fmt); + ret =vfe_get_format (sd,NULL , sd_state, &fmt);if (ret <0 )return ret;
@@ -1694,6 +1698,7 @@ static int vfe_get_selection(struct v4l2_subdev *sd,* Return -EINVAL or zero on success */ static int vfe_set_selection (struct v4l2_subdev *sd, +const struct v4l2_subdev_client_info *ci,struct v4l2_subdev_state *sd_state,struct v4l2_subdev_selection *sel) {
@@ -1720,7 +1725,7 @@ static int vfe_set_selection(struct v4l2_subdev *sd, crop.pad =MSM_VFE_PAD_SRC ; crop.target =V4L2_SEL_TGT_CROP ; crop.r = *rect; - ret =vfe_set_selection (sd, sd_state, &crop); + ret =vfe_set_selection (sd,NULL , sd_state, &crop); }else if (sel->target ==V4L2_SEL_TGT_CROP && sel->pad ==MSM_VFE_PAD_SRC ) {struct v4l2_subdev_format fmt = {0 };
@@ -1735,13 +1740,13 @@ static int vfe_set_selection(struct v4l2_subdev *sd,/* Reset source pad format width and height */ fmt.which = sel->which; fmt.pad =MSM_VFE_PAD_SRC ; - ret =vfe_get_format (sd, sd_state, &fmt); + ret =vfe_get_format (sd,NULL , sd_state, &fmt);if (ret <0 )return ret; fmt.format.width = rect->width; fmt.format.height = rect->height; - ret =vfe_set_format (sd, sd_state, &fmt); + ret =vfe_set_format (sd,NULL , sd_state, &fmt); }else { ret = -EINVAL ; }
@@ -1771,7 +1776,7 @@ static int vfe_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) } }; -return vfe_set_format (sd, fh ? fh->state :NULL , &format); +return vfe_set_format (sd,NULL , fh ? fh->state :NULL , &format); }/*
drivers/media/platform/qcom/camss/camss-video.c +1 -1
@@ -96,7 +96,7 @@ static int video_get_subdev_format(struct camss_video *video, fmt.pad = pad; - ret =v4l2_subdev_call (subdev, pad, get_fmt,NULL , &fmt); + ret =v4l2_subdev_call (subdev, pad, get_fmt,NULL ,NULL , &fmt);if (ret)return ret;
drivers/media/platform/raspberrypi/rp1-cfe/csi2.c +1 -0
@@ -404,6 +404,7 @@ static int csi2_init_state(struct v4l2_subdev *sd, }
Lines of this file are not shown. View the raw message.
drivers/media/platform/raspberrypi/rp1-cfe/pisp-fe.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/rcar-csi2.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/rcar-isp/csisp.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/renesas-ceu.c +4 -3
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-subdev.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_brx.c +3 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_clu.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_drm.c +16 -10
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_entity.c +3 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_histo.c +7 -2
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_hsit.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_iif.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_lif.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_lut.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_rwpf.c +3 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_sru.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_uds.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_uif.c +3 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_video.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/renesas/vsp1/vsp1_vspx.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/rockchip/rkcif/rkcif-interface.c +4 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c +3 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c +3 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/samsung/exynos4-is/fimc-capture.c +10 -3
Lines of this file are not shown. View the raw message.
drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c +3 -2
Lines of this file are not shown. View the raw message.
drivers/media/platform/samsung/exynos4-is/fimc-isp.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/samsung/exynos4-is/fimc-lite.c +6 -2
Lines of this file are not shown. View the raw message.
drivers/media/platform/samsung/exynos4-is/mipi-csis.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/samsung/s3c-camif/camif-capture.c +6 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/samsung/s3c-camif/camif-core.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/media/platform/st/stm32/stm32-csi.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/st/stm32/stm32-dcmi.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c +3 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c +1 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/am437x/am437x-vpfe.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/cal/cal-camerarx.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/cal/cal-video.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/davinci/vpif_capture.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispccdc.c +5 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispccp2.c +3 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispcsi2.c +3 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/isppreview.c +5 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispresizer.c +5 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispvideo.c +6 -6
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 +2 -0
Lines of this file are not shown. View the raw message.
drivers/media/platform/xilinx/xilinx-dma.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/xilinx/xilinx-tpg.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/media/test-drivers/vimc/vimc-common.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/test-drivers/vimc/vimc-debayer.c +2 -1
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/staging/media/atomisp/i2c/atomisp-gc2235.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +2 -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 +2 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/atomisp/pci/atomisp_subdev.c +4 -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/deprecated/atmel/atmel-isc-base.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-ic-prpencvf.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-media-capture.c +9 -5
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-media-csi.c +4 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-media-utils.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-media-vdic.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx6-mipi-csi2.c +2 -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 +2 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/starfive/camss/stf-isp.c +8 -4
Lines of this file are not shown. View the raw message.
drivers/staging/media/starfive/camss/stf-video.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c +2 -0
Lines of this file are not shown. View the raw message.
drivers/staging/media/tegra-video/csi.c +2 -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.
Jacopo Mondi
maintainerHi Sakari
Quoted 10 lines · Sakari Ailus
Hi folks,
This smallish set contains patches that prepare for merging the metadata series.
There are simple cleanups but also two noteworthy changes: the addition of the
VALIDATE_LATEmedia link flag and the addition of the new structv4l2_subdev_client_infostruct to theget_fmt,set_fmt,get_selectionandset_selectionpad operation arguments.
Quoted 7 lines
The
VALIDATE_LATEallows using thelink_validatecallback as the way to validate the links connected to the sink pads of video nodes on pipelines with multiple capture video nodes. Without this flag, the entire pipeline will be validated at the time of the first streamon, with the V4L2 pixel (or other) format set on the other capture video nodes at the time, requiring all formats to be set before starting streaming anywhere. But this does generally not match with what the userspace would do, hence the
What would userspace do instead ?
Is there a use case for formats not being known at pipeline start time ?
Is the userspace expected to enable all links with the VALIDATE_LATE flags ?
for_each_video_node() {
set_format()
clear_validate_late();
vidioc_streamon()
}As I understand it, the use case is solely delay setting the format on the video device and its sink pads ?
Quoted 9 lines
new flag. The patches in the upcoming metadata series version adds the support for the flag to the IPU6 driver.
Secondly, the new struct
v4l2_subdev_client_infoenables passing around file handler specific client capability information, which is used to differentiate UAPI between existing users and those that are aware of the new common raw sensor model. This is effectively required if we want to add support for the new model to existing raw sensor drivers: the new model is in a direct conflict with how things worked before the model.
Can you elaborate a little on why a per-ioctl flag is required ? Doesn't this open the door to possible mixups ?
I fail to see what the advantage is over per-subdev_fh client capabilities.
Quoted 6 lines
There still needs to be a single driver internal state, the different UAPIs simply offer a different view to that state. In-kernel users that do not deal with capabilities just use NULL when calling these ops. This also means that whatever client capabilities are being used, there may not be a change to inter-driver interfaces such as
get_fmt()when dealing with external pads.
Do we expect drivers that still use in-kernel operation calls to be ported to use streams ?
I'll review the rest of the series in the meantime.
Thanks
j
Quoted 472 lines
I'm leaving the last Coccinelle-generated patch out this time as it's more than 200 kiB. The patch can be found here <URL:<https://git.linuxtv.org/sailus/media_tree.git/log/?h=metadata-pre>. Patches 11--14 will be squashed together before merging.
The Coccinelle spatch used to generate the 14th patch is below, as is a Perl script to generate another Coccinelle patch doing the rest of the job:
caps.cocci
------------------8<----------------------
@ fmt @
identifier a1, a2, a3;
identifier fn;@@
fn(struct
v4l2_subdev*a1,
+ const structv4l2_subdev_client_info*ci,
structv4l2_subdev_state*a2, structv4l2_subdev_format*a3) {...}@ sel @
identifier a1, a2, a3;
identifier fn2;@@
fn2(struct
v4l2_subdev*a1,
+ const structv4l2_subdev_client_info*ci,
structv4l2_subdev_state*a2, structv4l2_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 -wmy @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 v2:
- 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: imx219: Rename "PIXEL_ARRAY" as "CROP"
media: v4l2-subdev: Allow accessing routes with STREAMS client
capability
media: Documentation: ImproveLINK_FREQdocumentation
media: Documentation: Improve pixel rate calculation documentation
media: v4l2-subdev: Refactor returning routes
media: mc: Separate single link validation into a new function
media: mc: AddMEDIA_LNK_FL_VALIDATE_LATE
media: mc: Don't care about unsettable flags inMEDIA_IOC_LINK_SETUP
media: Documentenable_streamsanddisable_streamsbehaviour
media: v4l2-subdev: Move subdev client capabilities into a new struct
media: v4l2-subdev: Add structv4l2_subdev_client_infopointer to pad
ops
media: v4l2-subdev: Addv4l2_subdev_call_ci_active_state
media: v4l2-subdev: Perform client info changes to i2c drivers
media: v4l2-subdev: Add structv4l2_subdev_client_infoargument to pad
opsDocumentation/driver-api/media/tx-rx.rst | 9 +- .../media/mediactl/media-ioc-setup-link.rst | 4 + .../media/mediactl/media-types.rst | 5 + .../media/v4l/ext-ctrls-image-process.rst | 4 +- drivers/media/i2c/adv7170.c | 2 + drivers/media/i2c/adv7175.c | 2 + drivers/media/i2c/adv7180.c | 4 +- drivers/media/i2c/adv7183.c | 4 +- drivers/media/i2c/adv748x/adv748x-afe.c | 4 +- drivers/media/i2c/adv748x/adv748x-csi2.c | 3 +- drivers/media/i2c/adv748x/adv748x-hdmi.c | 4 +- drivers/media/i2c/adv7511-v4l2.c | 2 + drivers/media/i2c/adv7604.c | 3 + drivers/media/i2c/adv7842.c | 4 +- drivers/media/i2c/ak881x.c | 2 + drivers/media/i2c/alvium-csi2.c | 3 + drivers/media/i2c/ar0521.c | 2 + drivers/media/i2c/ccs/ccs-core.c | 15 +- drivers/media/i2c/cx25840/cx25840-core.c | 1 + drivers/media/i2c/ds90ub913.c | 3 +- drivers/media/i2c/ds90ub953.c | 3 +- drivers/media/i2c/ds90ub960.c | 3 +- drivers/media/i2c/et8ek8/et8ek8_driver.c | 2 + drivers/media/i2c/gc0308.c | 1 + drivers/media/i2c/gc0310.c | 1 + drivers/media/i2c/gc05a2.c | 4 +- drivers/media/i2c/gc08a3.c | 4 +- drivers/media/i2c/gc2145.c | 2 + drivers/media/i2c/hi556.c | 3 + drivers/media/i2c/hi846.c | 3 + drivers/media/i2c/hi847.c | 2 + drivers/media/i2c/imx111.c | 1 + drivers/media/i2c/imx208.c | 2 + drivers/media/i2c/imx214.c | 4 +- drivers/media/i2c/imx219.c | 32 ++-- drivers/media/i2c/imx258.c | 3 + drivers/media/i2c/imx274.c | 4 + drivers/media/i2c/imx283.c | 2 + drivers/media/i2c/imx290.c | 4 +- drivers/media/i2c/imx296.c | 7 +- drivers/media/i2c/imx319.c | 2 + drivers/media/i2c/imx334.c | 4 +- drivers/media/i2c/imx335.c | 4 +- drivers/media/i2c/imx355.c | 2 + drivers/media/i2c/imx412.c | 4 +- drivers/media/i2c/imx415.c | 4 +- drivers/media/i2c/isl7998x.c | 2 + drivers/media/i2c/lt6911uxe.c | 5 +- drivers/media/i2c/max9286.c | 3 +- drivers/media/i2c/max96714.c | 3 +- drivers/media/i2c/max96717.c | 3 +- drivers/media/i2c/ml86v7667.c | 1 + drivers/media/i2c/mt9m001.c | 6 +- drivers/media/i2c/mt9m111.c | 4 + drivers/media/i2c/mt9m114.c | 6 + drivers/media/i2c/mt9p031.c | 4 + drivers/media/i2c/mt9t112.c | 4 + drivers/media/i2c/mt9v011.c | 1 + drivers/media/i2c/mt9v032.c | 4 + drivers/media/i2c/mt9v111.c | 2 + drivers/media/i2c/og01a1b.c | 2 + drivers/media/i2c/og0ve1b.c | 3 +- drivers/media/i2c/os05b10.c | 2 + drivers/media/i2c/ov01a10.c | 3 + drivers/media/i2c/ov02a10.c | 4 +- drivers/media/i2c/ov02c10.c | 1 + drivers/media/i2c/ov02e10.c | 2 + drivers/media/i2c/ov08d10.c | 2 + drivers/media/i2c/ov08x40.c | 2 + drivers/media/i2c/ov13858.c | 2 + drivers/media/i2c/ov13b10.c | 2 + drivers/media/i2c/ov2640.c | 3 + drivers/media/i2c/ov2659.c | 2 + drivers/media/i2c/ov2680.c | 4 + drivers/media/i2c/ov2685.c | 3 + drivers/media/i2c/ov2735.c | 4 +- drivers/media/i2c/ov2740.c | 1 + drivers/media/i2c/ov4689.c | 2 + drivers/media/i2c/ov5640.c | 3 + drivers/media/i2c/ov5645.c | 4 +- drivers/media/i2c/ov5647.c | 3 + drivers/media/i2c/ov5648.c | 2 + drivers/media/i2c/ov5670.c | 3 + drivers/media/i2c/ov5675.c | 3 + drivers/media/i2c/ov5693.c | 4 + drivers/media/i2c/ov5695.c | 2 + drivers/media/i2c/ov6211.c | 3 +- drivers/media/i2c/ov64a40.c | 2 + drivers/media/i2c/ov7251.c | 5 +- drivers/media/i2c/ov7670.c | 2 + drivers/media/i2c/ov772x.c | 3 + drivers/media/i2c/ov7740.c | 2 + drivers/media/i2c/ov8856.c | 2 + drivers/media/i2c/ov8858.c | 3 +- drivers/media/i2c/ov8865.c | 3 + drivers/media/i2c/ov9282.c | 5 +- drivers/media/i2c/ov9640.c | 2 + drivers/media/i2c/ov9650.c | 2 + drivers/media/i2c/ov9734.c | 2 + drivers/media/i2c/rdacm20.c | 1 + drivers/media/i2c/rdacm21.c | 1 + drivers/media/i2c/rj54n1cb0c.c | 4 + drivers/media/i2c/s5c73m3/s5c73m3-core.c | 4 + drivers/media/i2c/s5k3m5.c | 4 +- drivers/media/i2c/s5k5baf.c | 4 + drivers/media/i2c/s5k6a3.c | 2 + drivers/media/i2c/s5kjn1.c | 4 +- drivers/media/i2c/saa6752hs.c | 2 + drivers/media/i2c/saa7115.c | 1 + drivers/media/i2c/saa717x.c | 1 + drivers/media/i2c/st-mipid02.c | 1 + drivers/media/i2c/tc358743.c | 4 +- drivers/media/i2c/tc358746.c | 3 +- drivers/media/i2c/tda1997x.c | 2 + drivers/media/i2c/thp7312.c | 1 + drivers/media/i2c/tvp514x.c | 2 + drivers/media/i2c/tvp5150.c | 3 + drivers/media/i2c/tvp7002.c | 4 +- drivers/media/i2c/tw9900.c | 2 + drivers/media/i2c/tw9910.c | 3 + drivers/media/i2c/vd55g1.c | 4 +- drivers/media/i2c/vd56g3.c | 4 +- drivers/media/i2c/vgxy61.c | 5 +- drivers/media/mc/mc-entity.c | 144 +++++++++++++----- drivers/media/pci/cobalt/cobalt-driver.c | 8 +- drivers/media/pci/cobalt/cobalt-v4l2.c | 14 +- drivers/media/pci/cx18/cx18-av-core.c | 1 + drivers/media/pci/cx18/cx18-controls.c | 2 +- drivers/media/pci/cx18/cx18-ioctl.c | 2 +- drivers/media/pci/cx23885/cx23885-video.c | 4 +- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 5 +- drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 2 + .../media/pci/intel/ipu6/ipu6-isys-subdev.c | 3 +- .../media/pci/intel/ipu6/ipu6-isys-subdev.h | 1 + drivers/media/pci/intel/ivsc/mei_csi.c | 1 + drivers/media/pci/ivtv/ivtv-controls.c | 2 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +- drivers/media/pci/saa7134/saa7134-empress.c | 6 +- .../platform/amlogic/c3/isp/c3-isp-capture.c | 2 +- .../platform/amlogic/c3/isp/c3-isp-core.c | 1 + .../platform/amlogic/c3/isp/c3-isp-resizer.c | 3 + .../amlogic/c3/mipi-adapter/c3-mipi-adap.c | 3 +- .../amlogic/c3/mipi-csi2/c3-mipi-csi2.c | 3 +- .../platform/arm/mali-c55/mali-c55-capture.c | 2 +- .../platform/arm/mali-c55/mali-c55-isp.c | 5 +- .../platform/arm/mali-c55/mali-c55-resizer.c | 15 +- .../platform/arm/mali-c55/mali-c55-tpg.c | 1 + drivers/media/platform/atmel/atmel-isi.c | 4 +- .../media/platform/broadcom/bcm2835-unicam.c | 3 +- drivers/media/platform/cadence/cdns-csi2rx.c | 7 +- drivers/media/platform/cadence/cdns-csi2tx.c | 7 +- drivers/media/platform/intel/pxa_camera.c | 6 +- drivers/media/platform/marvell/mcam-core.c | 4 +- .../platform/microchip/microchip-csi2dc.c | 2 + .../platform/microchip/microchip-isc-base.c | 1 + .../platform/microchip/microchip-isc-scaler.c | 3 + drivers/media/platform/nxp/imx-mipi-csis.c | 5 +- drivers/media/platform/nxp/imx7-media-csi.c | 3 +- .../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 3 +- .../platform/nxp/imx8-isi/imx8-isi-pipe.c | 3 + drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 3 +- .../media/platform/qcom/camss/camss-csid.c | 4 +- .../media/platform/qcom/camss/camss-csiphy.c | 4 +- .../media/platform/qcom/camss/camss-ispif.c | 4 +- drivers/media/platform/qcom/camss/camss-vfe.c | 17 ++- .../media/platform/qcom/camss/camss-video.c | 2 +- .../media/platform/raspberrypi/rp1-cfe/csi2.c | 1 + .../platform/raspberrypi/rp1-cfe/pisp-fe.c | 3 +- drivers/media/platform/renesas/rcar-csi2.c | 3 +- .../media/platform/renesas/rcar-isp/csisp.c | 3 +- .../platform/renesas/rcar-vin/rcar-v4l2.c | 2 +- drivers/media/platform/renesas/renesas-ceu.c | 7 +- .../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 3 +- .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 3 +- .../platform/renesas/rzg2l-cru/rzg2l-video.c | 2 +- .../renesas/rzv2h-ivc/rzv2h-ivc-subdev.c | 3 +- .../media/platform/renesas/vsp1/vsp1_brx.c | 3 + .../media/platform/renesas/vsp1/vsp1_clu.c | 1 + .../media/platform/renesas/vsp1/vsp1_drm.c | 26 ++-- .../media/platform/renesas/vsp1/vsp1_entity.c | 4 +- .../media/platform/renesas/vsp1/vsp1_histo.c | 9 +- .../media/platform/renesas/vsp1/vsp1_hsit.c | 1 + .../media/platform/renesas/vsp1/vsp1_iif.c | 1 + .../media/platform/renesas/vsp1/vsp1_lif.c | 1 + .../media/platform/renesas/vsp1/vsp1_lut.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 | 3 + .../media/platform/renesas/vsp1/vsp1_video.c | 2 +- .../media/platform/renesas/vsp1/vsp1_vspx.c | 3 +- .../platform/rockchip/rkcif/rkcif-interface.c | 5 +- .../platform/rockchip/rkisp1/rkisp1-capture.c | 2 +- .../platform/rockchip/rkisp1/rkisp1-csi.c | 3 +- .../platform/rockchip/rkisp1/rkisp1-isp.c | 3 + .../platform/rockchip/rkisp1/rkisp1-resizer.c | 3 + .../samsung/exynos4-is/fimc-capture.c | 13 +- .../samsung/exynos4-is/fimc-isp-video.c | 5 +- .../platform/samsung/exynos4-is/fimc-isp.c | 2 + .../platform/samsung/exynos4-is/fimc-lite.c | 8 +- .../platform/samsung/exynos4-is/mipi-csis.c | 2 + .../samsung/s3c-camif/camif-capture.c | 7 +- .../platform/samsung/s3c-camif/camif-core.c | 4 +- drivers/media/platform/st/stm32/stm32-csi.c | 1 + drivers/media/platform/st/stm32/stm32-dcmi.c | 6 +- .../st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 3 +- .../st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 3 + .../st/stm32/stm32-dcmipp/dcmipp-input.c | 1 + .../platform/sunxi/sun4i-csi/sun4i_v4l2.c | 2 + .../sunxi/sun6i-csi/sun6i_csi_bridge.c | 2 + .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 2 + .../sun8i_a83t_mipi_csi2.c | 2 + .../media/platform/ti/am437x/am437x-vpfe.c | 4 +- drivers/media/platform/ti/cal/cal-camerarx.c | 3 +- drivers/media/platform/ti/cal/cal-video.c | 6 +- .../media/platform/ti/davinci/vpif_capture.c | 2 +- .../platform/ti/j721e-csi2rx/j721e-csi2rx.c | 2 +- drivers/media/platform/ti/omap3isp/ispccdc.c | 6 +- drivers/media/platform/ti/omap3isp/ispccp2.c | 4 +- drivers/media/platform/ti/omap3isp/ispcsi2.c | 4 +- .../media/platform/ti/omap3isp/isppreview.c | 6 +- .../media/platform/ti/omap3isp/ispresizer.c | 6 +- drivers/media/platform/ti/omap3isp/ispvideo.c | 12 +- drivers/media/platform/ti/vpe/vip.c | 7 +- drivers/media/platform/via/via-camera.c | 4 +- drivers/media/platform/video-mux.c | 1 + .../media/platform/xilinx/xilinx-csi2rxss.c | 2 + drivers/media/platform/xilinx/xilinx-dma.c | 2 +- drivers/media/platform/xilinx/xilinx-tpg.c | 2 + drivers/media/test-drivers/vimc/vimc-common.c | 2 +- .../media/test-drivers/vimc/vimc-debayer.c | 3 +- drivers/media/test-drivers/vimc/vimc-scaler.c | 3 + drivers/media/test-drivers/vimc/vimc-sensor.c | 1 + drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 4 +- drivers/media/usb/dvb-usb/cxusb-analog.c | 6 +- drivers/media/usb/em28xx/em28xx-camera.c | 2 +- drivers/media/usb/go7007/go7007-v4l2.c | 2 +- drivers/media/usb/go7007/s2250-board.c | 1 + drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- drivers/media/v4l2-core/v4l2-subdev.c | 117 +++++++++----- .../media/atomisp/i2c/atomisp-gc2235.c | 2 + .../media/atomisp/i2c/atomisp-ov2722.c | 2 + .../staging/media/atomisp/pci/atomisp_cmd.c | 16 +- .../staging/media/atomisp/pci/atomisp_csi2.c | 2 + .../media/atomisp/pci/atomisp_subdev.c | 4 + .../staging/media/atomisp/pci/atomisp_v4l2.c | 8 +- .../media/deprecated/atmel/atmel-isc-base.c | 4 +- drivers/staging/media/imx/imx-ic-prp.c | 2 + drivers/staging/media/imx/imx-ic-prpencvf.c | 2 + drivers/staging/media/imx/imx-media-capture.c | 14 +- drivers/staging/media/imx/imx-media-csi.c | 4 + drivers/staging/media/imx/imx-media-utils.c | 2 +- drivers/staging/media/imx/imx-media-vdic.c | 2 + drivers/staging/media/imx/imx6-mipi-csi2.c | 2 + drivers/staging/media/ipu3/ipu3-v4l2.c | 4 + drivers/staging/media/ipu7/ipu7-isys-csi2.c | 2 + drivers/staging/media/ipu7/ipu7-isys-subdev.c | 3 +- .../staging/media/starfive/camss/stf-isp.c | 12 +- .../staging/media/starfive/camss/stf-video.c | 2 +- .../media/sunxi/sun6i-isp/sun6i_isp_proc.c | 2 + drivers/staging/media/tegra-video/csi.c | 2 + drivers/staging/media/tegra-video/vi.c | 13 +- include/media/v4l2-subdev.h | 77 ++++++++-- include/uapi/linux/media.h | 1 + 265 files changed, 969 insertions(+), 324 deletions(-)--
2.47.3
Sakari Ailus
maintainerHi Jacopo,
Thank you for reviewing this!
Quoted 21 lines · Jacopo Mondi
Hi Sakari
Quoted 10 lines · Sakari Ailus
Hi folks,
This smallish set contains patches that prepare for merging the metadata series.
There are simple cleanups but also two noteworthy changes: the addition of the
VALIDATE_LATEmedia link flag and the addition of the new structv4l2_subdev_client_infostruct to theget_fmt,set_fmt,get_selectionandset_selectionpad operation arguments.Quoted 7 lines
The
VALIDATE_LATEallows using thelink_validatecallback as the way to validate the links connected to the sink pads of video nodes on pipelines with multiple capture video nodes. Without this flag, the entire pipeline will be validated at the time of the first streamon, with the V4L2 pixel (or other) format set on the other capture video nodes at the time, requiring all formats to be set before starting streaming anywhere. But this does generally not match with what the userspace would do, hence the
Quoted 3 lines
What would userspace do instead ?
Is there a use case for formats not being known at pipeline start time ?
Yes. Try capturing from two video nodes with e.g. yavta.
I recall the vsp driver does link validation as part of the streamon operation without involving the link_validate callback for this reason.
Quoted 3 lines
Is the userspace expected to enable all links with the
VALIDATE_LATEflags ?
It's not supposed to be a user-settable flag. The purpose is really to allow the framework to do the job it's supposed to.
Quoted 9 lines
for_each_video_node() { set_format() clear_validate_late(); vidioc_streamon() }As I understand it, the use case is solely delay setting the format on the video device and its sink pads ?
Correct.
Quoted 11 lines
Quoted 10 lines
new flag. The patches in the upcoming metadata series version adds the support for the flag to the IPU6 driver.
Secondly, the new struct
v4l2_subdev_client_infoenables passing around file handler specific client capability information, which is used to differentiate UAPI between existing users and those that are aware of the new common raw sensor model. This is effectively required if we want to add support for the new model to existing raw sensor drivers: the new model is in a direct conflict with how things worked before the model.
Quoted 5 lines
Can you elaborate a little on why a per-ioctl flag is required ? Doesn't this open the door to possible mixups ?
I fail to see what the advantage is over per-subdev_fh client capabilities.
It's a per-file handle flag, but the sub-device IOCTL handlers currently don't take the file handle (or information related to it) as an argument. Therefore this needs to be added to the relevant ops -- it could also be all pad ops; it would be possible to avoid adding new functions that take client_info pointer and work on the active state (see the third-last patch).
Quoted 10 lines
Quoted 7 lines
There still needs to be a single driver internal state, the different UAPIs simply offer a different view to that state. In-kernel users that do not deal with capabilities just use NULL when calling these ops. This also means that whatever client capabilities are being used, there may not be a change to inter-driver interfaces such as
get_fmt()when dealing with external pads.Do we expect drivers that still use in-kernel operation calls to be ported to use streams ?
Those that benefit from it can be ported. But interoperability is good between those that use streams than those that don't so there's no hurry.
Quoted 2 lines
I'll review the rest of the series in the meantime.
Thank you. I'm down to ~ 80 patches once these are merged.
Signature · 3 lines
Kind regards, Sakari Ailus
Jacopo Mondi
maintainerHi Sakari
Quoted 26 lines · Sakari Ailus
Hi Jacopo,
Thank you for reviewing this!
Quoted 21 lines · Jacopo Mondi
Hi Sakari
Quoted 17 lines · Sakari Ailus
Hi folks,
This smallish set contains patches that prepare for merging the metadata series.
There are simple cleanups but also two noteworthy changes: the addition of the
VALIDATE_LATEmedia link flag and the addition of the new structv4l2_subdev_client_infostruct to theget_fmt,set_fmt,get_selectionandset_selectionpad operation arguments.The
VALIDATE_LATEallows using thelink_validatecallback as the way to validate the links connected to the sink pads of video nodes on pipelines with multiple capture video nodes. Without this flag, the entire pipeline will be validated at the time of the first streamon, with the V4L2 pixel (or other) format set on the other capture video nodes at the time, requiring all formats to be set before starting streaming anywhere. But this does generally not match with what the userspace would do, hence the
Quoted 6 lines
Quoted 3 lines
What would userspace do instead ?
Is there a use case for formats not being known at pipeline start time ?
Yes. Try capturing from two video nodes with e.g. yavta.
maybe yavta is not the right tool to handle streaming on a complex platform, or should at least be modified to delay start stream after all formats are set up.
Anyway..
Quoted 10 lines
I recall the vsp driver does link validation as part of the streamon operation without involving the
link_validatecallback for this reason.Quoted 3 lines
Is the userspace expected to enable all links with the
VALIDATE_LATEflags ?It's not supposed to be a user-settable flag. The purpose is really to allow the framework to do the job it's supposed to.
This doesn't explain me nothing.
The only documentation patch for this in
[PATCH v2 07/14] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE
just reports:
+The ``VALIDATE_LATE`` flag is used to signal that the validation of the link may +be delayed until actual hardware operation even if the rest of the pipeline +would be validated at an earlier point of time.
in Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst
Have I missed any other part of the documentation maybe ?
How are drivers supposed to use it ? Create links to multiplexed subdevs with this flag ?
Again, if the problem is a userspace tool not setting up all formats before calling s_stream, a driver flag to accommodate it doesn't seem right.
Quoted 7 lines
Quoted 7 lines
for_each_video_node() { set_format() clear_validate_late(); vidioc_streamon() }
Quoted 5 lines
Quoted 2 lines
As I understand it, the use case is solely delay setting the format on the video device and its sink pads ?
Correct.
Still not sure why we should allow that.
I'll ask-again:
Is there a use case for formats not being known at pipeline start time ?
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
new flag. The patches in the upcoming metadata series version adds the support for the flag to the IPU6 driver.
Secondly, the new struct
v4l2_subdev_client_infoenables passing around file handler specific client capability information, which is used to differentiate UAPI between existing users and those that are aware of the new common raw sensor model. This is effectively required if we want to add support for the new model to existing raw sensor drivers: the new model is in a direct conflict with how things worked before the model.
Quoted 8 lines
Quoted 5 lines
Can you elaborate a little on why a per-ioctl flag is required ? Doesn't this open the door to possible mixups ?
I fail to see what the advantage is over per-subdev_fh client capabilities.
It's a per-file handle flag, but the sub-device IOCTL handlers currently don't take the file handle (or information related to it) as an argument.
Could you elaborate on the reason why the flag should be an operation argument an not a per-file handle setting ?
Quoted 16 lines
Therefore this needs to be added to the relevant ops -- it could also be all pad ops; it would be possible to avoid adding new functions that take
client_infopointer and work on the active state (see the third-last patch).Quoted 10 lines
Quoted 7 lines
There still needs to be a single driver internal state, the different UAPIs simply offer a different view to that state. In-kernel users that do not deal with capabilities just use NULL when calling these ops. This also means that whatever client capabilities are being used, there may not be a change to inter-driver interfaces such as
get_fmt()when dealing with external pads.Do we expect drivers that still use in-kernel operation calls to be ported to use streams ?
Quoted 8 lines
Those that benefit from it can be ported. But interoperability is good between those that use streams than those that don't so there's no hurry.
Quoted 2 lines
I'll review the rest of the series in the meantime.
Thank you. I'm down to ~ 80 patches once these are merged.
I really hoped we could have landed the 66 patch series to start building on it
Quoted 4 lines
--
Kind regards,Sakari Ailus
Sakari Ailus
maintainerHi Jacopo,
Quoted 66 lines · Jacopo Mondi
Hi Sakari
Quoted 26 lines · Sakari Ailus
Hi Jacopo,
Thank you for reviewing this!
Quoted 21 lines · Jacopo Mondi
Hi Sakari
Quoted 17 lines · Sakari Ailus
Hi folks,
This smallish set contains patches that prepare for merging the metadata series.
There are simple cleanups but also two noteworthy changes: the addition of the
VALIDATE_LATEmedia link flag and the addition of the new structv4l2_subdev_client_infostruct to theget_fmt,set_fmt,get_selectionandset_selectionpad operation arguments.The
VALIDATE_LATEallows using thelink_validatecallback as the way to validate the links connected to the sink pads of video nodes on pipelines with multiple capture video nodes. Without this flag, the entire pipeline will be validated at the time of the first streamon, with the V4L2 pixel (or other) format set on the other capture video nodes at the time, requiring all formats to be set before starting streaming anywhere. But this does generally not match with what the userspace would do, hence theQuoted 6 lines
Quoted 3 lines
What would userspace do instead ?
Is there a use case for formats not being known at pipeline start time ?
Yes. Try capturing from two video nodes with e.g. yavta.
maybe yavta is not the right tool to handle streaming on a complex platform, or should at least be modified to delay start stream after all formats are set up.
Anyway..
Quoted 10 lines
I recall the vsp driver does link validation as part of the streamon operation without involving the
link_validatecallback for this reason.Quoted 3 lines
Is the userspace expected to enable all links with the
VALIDATE_LATEflags ?It's not supposed to be a user-settable flag. The purpose is really to allow the framework to do the job it's supposed to.
This doesn't explain me nothing.
The only documentation patch for this in
[PATCH v2 07/14] media: mc: AddMEDIA_LNK_FL_VALIDATE_LATEjust reports:
(quoted diff) +3
-0+The ``VALIDATE_LATE`` flag is used to signal that the validation of the link may +be delayed until actual hardware operation even if the rest of the pipeline +would be validated at an earlier point of time.in
Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rst
Quoted 8 lines
Have I missed any other part of the documentation maybe ?
How are drivers supposed to use it ? Create links to multiplexed subdevs with this flag ?
Again, if the problem is a userspace tool not setting up all formats before calling
s_stream, a driver flag to accommodate it doesn't seem right.
As I noted earlier, today drivers implement link validation without using the callback. With the flag some of the job can be done by the framework and also the userspace will be aware of the arrangement.
I'd think all drivers supporting multiple streams should use the flag on video nodes.
I'll improve this for v3 to describe this flag is driver-set.
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
for_each_video_node() { set_format() clear_validate_late(); vidioc_streamon() }As I understand it, the use case is solely delay setting the format on the video device and its sink pads ?
Quoted 8 lines
Quoted 2 lines
Correct.
Still not sure why we should allow that.
I'll ask-again:
Is there a use case for formats not being known at pipeline start time ?
Existing user space and general clumsiness in having to set the format beforehand, especially with test programs, when there is no technical need to do so.
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 11 lines
new flag. The patches in the upcoming metadata series version adds the support for the flag to the IPU6 driver.
Secondly, the new struct
v4l2_subdev_client_infoenables passing around file handler specific client capability information, which is used to differentiate UAPI between existing users and those that are aware of the new common raw sensor model. This is effectively required if we want to add support for the new model to existing raw sensor drivers: the new model is in a direct conflict with how things worked before the model.Can you elaborate a little on why a per-ioctl flag is required ? Doesn't this open the door to possible mixups ?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I fail to see what the advantage is over per-subdev_fh client capabilities.
It's a per-file handle flag, but the sub-device IOCTL handlers currently don't take the file handle (or information related to it) as an argument.
Could you elaborate on the reason why the flag should be an operation argument an not a per-file handle setting ?
It is a per-file handle flag.
Quoted 21 lines
Quoted 21 lines
Therefore this needs to be added to the relevant ops -- it could also be all pad ops; it would be possible to avoid adding new functions that take
client_infopointer and work on the active state (see the third-last patch).Quoted 10 lines
Quoted 7 lines
There still needs to be a single driver internal state, the different UAPIs simply offer a different view to that state. In-kernel users that do not deal with capabilities just use NULL when calling these ops. This also means that whatever client capabilities are being used, there may not be a change to inter-driver interfaces such as
get_fmt()when dealing with external pads.Do we expect drivers that still use in-kernel operation calls to be ported to use streams ?
Those that benefit from it can be ported. But interoperability is good between those that use streams than those that don't so there's no hurry.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
I'll review the rest of the series in the meantime.
Thank you. I'm down to ~ 80 patches once these are merged.
I really hoped we could have landed the 66 patch series to start building on it
I'm also for merging it as soon as possible but it needs to be complete before that. There were missing bits in the previous version, in particular related to the common raw sensor model, for which I'm adding support to the imx219 driver.
I also understand Laurent would like to see libcamera to support it before merging it to the kernel and I don't really disagree with that.
Signature · 3 lines
Kind regards, Sakari Ailus
Jacopo Mondi
maintainerHi Sakari
Quoted 103 lines · Sakari Ailus
Hi Jacopo,
Quoted 66 lines · Jacopo Mondi
Hi Sakari
Quoted 26 lines · Sakari Ailus
Hi Jacopo,
Thank you for reviewing this!
Quoted 21 lines · Jacopo Mondi
Hi Sakari
Quoted 17 lines · Sakari Ailus
Hi folks,
This smallish set contains patches that prepare for merging the metadata series.
There are simple cleanups but also two noteworthy changes: the addition of the
VALIDATE_LATEmedia link flag and the addition of the new structv4l2_subdev_client_infostruct to theget_fmt,set_fmt,get_selectionandset_selectionpad operation arguments.The
VALIDATE_LATEallows using thelink_validatecallback as the way to validate the links connected to the sink pads of video nodes on pipelines with multiple capture video nodes. Without this flag, the entire pipeline will be validated at the time of the first streamon, with the V4L2 pixel (or other) format set on the other capture video nodes at the time, requiring all formats to be set before starting streaming anywhere. But this does generally not match with what the userspace would do, hence theQuoted 6 lines
Quoted 3 lines
What would userspace do instead ?
Is there a use case for formats not being known at pipeline start time ?
Yes. Try capturing from two video nodes with e.g. yavta.
maybe yavta is not the right tool to handle streaming on a complex platform, or should at least be modified to delay start stream after all formats are set up.
Anyway..
Quoted 10 lines
I recall the vsp driver does link validation as part of the streamon operation without involving the
link_validatecallback for this reason.Quoted 3 lines
Is the userspace expected to enable all links with the
VALIDATE_LATEflags ?It's not supposed to be a user-settable flag. The purpose is really to allow the framework to do the job it's supposed to.
This doesn't explain me nothing.
The only documentation patch for this in
[PATCH v2 07/14] media: mc: AddMEDIA_LNK_FL_VALIDATE_LATEjust reports:
(quoted diff) +3
-0+The ``VALIDATE_LATE`` flag is used to signal that the validation of the link may +be delayed until actual hardware operation even if the rest of the pipeline +would be validated at an earlier point of time.in
Documentation/userspace-api/media/mediactl/media-ioc-setup-link.rstQuoted 8 lines
Have I missed any other part of the documentation maybe ?
How are drivers supposed to use it ? Create links to multiplexed subdevs with this flag ?
Again, if the problem is a userspace tool not setting up all formats before calling
s_stream, a driver flag to accommodate it doesn't seem right.As I noted earlier, today drivers implement link validation without using the callback. With the flag some of the job can be done by the framework and also the userspace will be aware of the arrangement.
I'd think all drivers supporting multiple streams should use the flag on video nodes.
I'll improve this for v3 to describe this flag is driver-set.
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
for_each_video_node() { set_format() clear_validate_late(); vidioc_streamon() }Quoted 5 lines
Quoted 2 lines
As I understand it, the use case is solely delay setting the format on the video device and its sink pads ?
Correct.
Still not sure why we should allow that.
Quoted 8 lines
Quoted 3 lines
I'll ask-again:
Is there a use case for formats not being known at pipeline start time ?
Existing user space and general clumsiness in having to set the format beforehand, especially with test programs, when there is no technical need to do so.
I'm still not 100% on board with this, sorry.
If the flag is meant to be set by drivers on all media links that connect them to a multiplexed source, then the framework could as well do that by inspecting the number of streams on the source subdev ?
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 11 lines
new flag. The patches in the upcoming metadata series version adds the support for the flag to the IPU6 driver.
Secondly, the new struct
v4l2_subdev_client_infoenables passing around file handler specific client capability information, which is used to differentiate UAPI between existing users and those that are aware of the new common raw sensor model. This is effectively required if we want to add support for the new model to existing raw sensor drivers: the new model is in a direct conflict with how things worked before the model.Can you elaborate a little on why a per-ioctl flag is required ? Doesn't this open the door to possible mixups ?
I fail to see what the advantage is over per-subdev_fh client capabilities.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
It's a per-file handle flag, but the sub-device IOCTL handlers currently don't take the file handle (or information related to it) as an argument.
Could you elaborate on the reason why the flag should be an operation argument an not a per-file handle setting ?
It is a per-file handle flag.
I initially thought this was a setting coming from userspace on a per-ioctl base, which made no sense to me.
Now that I've groked
[PATCH v2 11/14] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops
I understand the intention is to pass to the ioctl handlers the subdev capabilities.
However
We have a state passed to every ioctl operation already, and states are associated to the file handles already.
Wouldn't it be easier to copy the caps flag to the state before calling the ioctl handler instead of adding a new argument to all ioctl handlers in the subsystem ?
Are there reasons I've missed why you consider this not possible ?
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Therefore this needs to be added to the relevant ops -- it could also be all pad ops; it would be possible to avoid adding new functions that take
client_infopointer and work on the active state (see the third-last patch).
Ah, exactly.
What did you prevent you from doing this ?
Quoted 24 lines
Quoted 16 lines
Quoted 16 lines
Quoted 11 lines
Quoted 8 lines
There still needs to be a single driver internal state, the different UAPIs simply offer a different view to that state. In-kernel users that do not deal with capabilities just use NULL when calling these ops. This also means that whatever client capabilities are being used, there may not be a change to inter-driver interfaces such as
get_fmt()when dealing with external pads.Do we expect drivers that still use in-kernel operation calls to be ported to use streams ?
Those that benefit from it can be ported. But interoperability is good between those that use streams than those that don't so there's no hurry.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
I'll review the rest of the series in the meantime.
Thank you. I'm down to ~ 80 patches once these are merged.
I really hoped we could have landed the 66 patch series to start building on it
Quoted 8 lines
I'm also for merging it as soon as possible but it needs to be complete before that. There were missing bits in the previous version, in particular related to the common raw sensor model, for which I'm adding support to the imx219 driver.
I also understand Laurent would like to see libcamera to support it before merging it to the kernel and I don't really disagree with that.
libcamera has added support for it 2 (or maybe 3) years ago. For a version of this API that is now outdated, and now we suffer from the fact we need a different flag to signal STREAM capabilities to userspace otherwise libcamera will break on new platforms implementing the model right.
So we would need to 'freeze' this version somehow without merging it, give libcamera time to implement support properly and merge both implementations together ??
Quoted 4 lines
--
Kind regards,Sakari Ailus