Unify sub-device state access functions
Subsystems (95)
Sakari Ailus
maintainercover Unify sub-device state access functions
Hi folks,
This set unifies historical and stream-aware sub-device state access functions into one set of functions called v4l2_subdev_get_{format,crop,compose}. No functional change is intended.
This happened after Tomi suggested adding a num_pads field to struct v4l2_subdev_state.
I'd like to merge these somewhat soon, assuming there's a rough consensus on them, as this is a fairly hot set, touching 136 files.
Sakari Ailus (6):
media: v4l: subdev: Store the number of pads in sub-device state
media: v4l: subdev: Also return pads array information on stream
functions
media: v4l: subdev: Rename sub-device state information access
functions
media: v4l: subdev: v4l2_subdev_get_format always returns format now
media: v4l: subdev: Switch to stream-aware state functions
media: v4l: subdev: Remove stream-unaware sub-device state access
drivers/media/i2c/adv7180.c | 4 +- drivers/media/i2c/adv748x/adv748x-afe.c | 6 +- drivers/media/i2c/adv748x/adv748x-csi2.c | 2 +- drivers/media/i2c/adv748x/adv748x-hdmi.c | 6 +- drivers/media/i2c/adv7511-v4l2.c | 4 +- drivers/media/i2c/adv7604.c | 4 +- drivers/media/i2c/adv7842.c | 4 +- drivers/media/i2c/ar0521.c | 5 +- drivers/media/i2c/ccs/ccs-core.c | 21 ++-- drivers/media/i2c/et8ek8/et8ek8_driver.c | 3 +- drivers/media/i2c/hi556.c | 12 +- drivers/media/i2c/hi846.c | 11 +- drivers/media/i2c/hi847.c | 8 +- drivers/media/i2c/imx208.c | 8 +- drivers/media/i2c/imx214.c | 4 +- drivers/media/i2c/imx219.c | 12 +- drivers/media/i2c/imx258.c | 8 +- drivers/media/i2c/imx290.c | 8 +- drivers/media/i2c/imx296.c | 18 +-- drivers/media/i2c/imx319.c | 7 +- drivers/media/i2c/imx334.c | 4 +- drivers/media/i2c/imx335.c | 4 +- drivers/media/i2c/imx355.c | 7 +- drivers/media/i2c/imx412.c | 4 +- drivers/media/i2c/imx415.c | 6 +- drivers/media/i2c/isl7998x.c | 6 +- drivers/media/i2c/max9286.c | 4 +- drivers/media/i2c/mt9m001.c | 4 +- drivers/media/i2c/mt9m111.c | 4 +- drivers/media/i2c/mt9m114.c | 58 +++++----- drivers/media/i2c/mt9p031.c | 6 +- drivers/media/i2c/mt9v032.c | 10 +- drivers/media/i2c/mt9v111.c | 2 +- drivers/media/i2c/og01a1b.c | 9 +- drivers/media/i2c/ov01a10.c | 2 +- drivers/media/i2c/ov02a10.c | 5 +- drivers/media/i2c/ov08d10.c | 8 +- drivers/media/i2c/ov08x40.c | 7 +- drivers/media/i2c/ov13858.c | 10 +- drivers/media/i2c/ov13b10.c | 10 +- drivers/media/i2c/ov2640.c | 4 +- drivers/media/i2c/ov2659.c | 6 +- drivers/media/i2c/ov2680.c | 6 +- drivers/media/i2c/ov2685.c | 4 +- drivers/media/i2c/ov2740.c | 4 +- drivers/media/i2c/ov4689.c | 2 +- drivers/media/i2c/ov5640.c | 9 +- drivers/media/i2c/ov5645.c | 4 +- drivers/media/i2c/ov5647.c | 12 +- drivers/media/i2c/ov5648.c | 6 +- drivers/media/i2c/ov5670.c | 12 +- drivers/media/i2c/ov5675.c | 8 +- drivers/media/i2c/ov5693.c | 4 +- drivers/media/i2c/ov5695.c | 7 +- drivers/media/i2c/ov7251.c | 4 +- drivers/media/i2c/ov7670.c | 7 +- drivers/media/i2c/ov7740.c | 7 +- drivers/media/i2c/ov8856.c | 8 +- drivers/media/i2c/ov8858.c | 6 +- drivers/media/i2c/ov8865.c | 8 +- drivers/media/i2c/ov9282.c | 6 +- drivers/media/i2c/ov9650.c | 7 +- drivers/media/i2c/ov9734.c | 8 +- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 35 +++--- drivers/media/i2c/s5k5baf.c | 30 +++-- drivers/media/i2c/s5k6a3.c | 8 +- drivers/media/i2c/st-mipid02.c | 11 +- drivers/media/i2c/st-vgxy61.c | 5 +- drivers/media/i2c/tc358746.c | 12 +- drivers/media/i2c/tda1997x.c | 6 +- drivers/media/i2c/tvp5150.c | 2 +- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 9 +- drivers/media/pci/intel/ivsc/mei_csi.c | 4 +- drivers/media/platform/cadence/cdns-csi2rx.c | 4 +- drivers/media/platform/cadence/cdns-csi2tx.c | 3 +- .../platform/microchip/microchip-csi2dc.c | 15 ++- .../platform/microchip/microchip-isc-scaler.c | 17 +-- drivers/media/platform/nxp/imx-mipi-csis.c | 10 +- drivers/media/platform/nxp/imx7-media-csi.c | 15 ++- .../platform/nxp/imx8-isi/imx8-isi-pipe.c | 18 +-- .../platform/nxp/imx8-isi/imx8-isi-video.c | 2 +- drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 12 +- .../media/platform/qcom/camss/camss-csid.c | 3 +- .../media/platform/qcom/camss/camss-csiphy.c | 3 +- .../media/platform/qcom/camss/camss-ispif.c | 3 +- drivers/media/platform/qcom/camss/camss-vfe.c | 9 +- drivers/media/platform/renesas/rcar-isp.c | 4 +- .../platform/renesas/rcar-vin/rcar-csi2.c | 4 +- .../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 6 +- .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 6 +- .../media/platform/renesas/vsp1/vsp1_brx.c | 2 +- .../media/platform/renesas/vsp1/vsp1_entity.c | 8 +- .../media/platform/renesas/vsp1/vsp1_rwpf.c | 3 +- .../platform/rockchip/rkisp1/rkisp1-csi.c | 16 ++- .../platform/rockchip/rkisp1/rkisp1-isp.c | 103 ++++++++--------- .../platform/rockchip/rkisp1/rkisp1-resizer.c | 53 ++++----- .../samsung/exynos4-is/fimc-capture.c | 12 +- .../platform/samsung/exynos4-is/fimc-isp.c | 23 ++-- .../platform/samsung/exynos4-is/fimc-lite.c | 17 ++- .../platform/samsung/exynos4-is/mipi-csis.c | 3 +- .../samsung/s3c-camif/camif-capture.c | 8 +- .../platform/sunxi/sun4i-csi/sun4i_v4l2.c | 8 +- .../sunxi/sun6i-csi/sun6i_csi_bridge.c | 7 +- .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 7 +- .../sun8i_a83t_mipi_csi2.c | 7 +- drivers/media/platform/ti/cal/cal-camerarx.c | 13 +-- drivers/media/platform/ti/cal/cal-video.c | 2 +- drivers/media/platform/ti/omap3isp/ispccdc.c | 6 +- drivers/media/platform/ti/omap3isp/ispccp2.c | 3 +- drivers/media/platform/ti/omap3isp/ispcsi2.c | 3 +- .../media/platform/ti/omap3isp/isppreview.c | 6 +- .../media/platform/ti/omap3isp/ispresizer.c | 5 +- drivers/media/platform/video-mux.c | 18 +-- .../media/platform/xilinx/xilinx-csi2rxss.c | 5 +- drivers/media/platform/xilinx/xilinx-tpg.c | 9 +- drivers/media/platform/xilinx/xilinx-vip.c | 4 +- .../media/test-drivers/vimc/vimc-debayer.c | 10 +- drivers/media/test-drivers/vimc/vimc-scaler.c | 9 +- drivers/media/test-drivers/vimc/vimc-sensor.c | 6 +- drivers/media/v4l2-core/v4l2-subdev.c | 73 ++++++++---- .../media/atomisp/i2c/atomisp-gc0310.c | 2 +- .../staging/media/atomisp/pci/atomisp_csi2.c | 3 +- .../media/atomisp/pci/atomisp_subdev.c | 6 +- drivers/staging/media/imx/imx-ic-prp.c | 2 +- drivers/staging/media/imx/imx-ic-prpencvf.c | 2 +- drivers/staging/media/imx/imx-media-csi.c | 8 +- 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 | 14 +-- drivers/staging/media/omap4iss/iss_csi2.c | 3 +- drivers/staging/media/omap4iss/iss_ipipe.c | 3 +- drivers/staging/media/omap4iss/iss_ipipeif.c | 3 +- drivers/staging/media/omap4iss/iss_resizer.c | 3 +- .../media/sunxi/sun6i-isp/sun6i_isp_proc.c | 7 +- include/media/v4l2-subdev.h | 107 +++--------------- 136 files changed, 597 insertions(+), 751 deletions(-)
Signature · 1 line
2.39.2
Sakari Ailus
maintainerPATCH 1/6 media: v4l: subdev: Store the number of pads in sub-device state
Store the number of pads in the sub-device state. This will be needed to validate pad when retrieving information for non-stream-aware users.
--- drivers/media/v4l2-core/v4l2-subdev.c | 2 ++ include/media/v4l2-subdev.h | 2 ++ 2 files changed, 4 insertions(+)
drivers/media/v4l2-core/v4l2-subdev.c +2 -0
@@ -1441,6 +1441,8 @@ __v4l2_subdev_state_alloc(struct v4l2_subdev *sd, const char *lock_name,else state->lock = &state->_lock; + state->num_pads = sd->entity.num_pads; +/* Drivers that support streams do not need the legacy pad config */ if (!(sd->flags &V4L2_SUBDEV_FL_STREAMS ) && sd->entity.num_pads) { state->pads = kvcalloc(sd->entity.num_pads,
include/media/v4l2-subdev.h +2 -0
@@ -756,6 +756,7 @@ struct v4l2_subdev_krouting {* * @_lock: default for 'lock' * @lock: mutex for the state. May be replaced by the user. +* @num_pads: the number of entries in the pads array * @pads: &struct v4l2_subdev_pad_config array * @routing: routing table for the subdev * @stream_configs: stream configurations (only for V4L2_SUBDEV_FL_STREAMS)
@@ -768,6 +769,7 @@ struct v4l2_subdev_state {/* lock for the struct v4l2_subdev_state fields */ struct mutex _lock;struct mutex *lock; +unsigned int num_pads;struct v4l2_subdev_pad_config *pads;struct v4l2_subdev_krouting routing;struct v4l2_subdev_stream_configs stream_configs;
Signature · 1 line
2.39.2
Laurent Pinchart
maintainerRe: [PATCH 1/6] media: v4l: subdev: Store the number of pads in sub-device state
Hi Sakari,
Thank you for the patch.
Quoted 2 lines · Sakari Ailus
Store the number of pads in the sub-device state. This will be needed to validate pad when retrieving information for non-stream-aware users.
I'd rather store a pointer to the subdev. You can get the number of pads from there.
Quoted 39 lines
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/v4l2-core/v4l2-subdev.c | 2 ++ include/media/v4l2-subdev.h | 2 ++ 2 files changed, 4 insertions(+)drivers/media/v4l2-core/v4l2-subdev.c +2
-0@@ -1441,6 +1441,8 @@ __v4l2_subdev_state_alloc(struct v4l2_subdev *sd, const char *lock_name,else state->lock = &state->_lock; + state->num_pads = sd->entity.num_pads; +/* Drivers that support streams do not need the legacy pad config */ if (!(sd->flags &V4L2_SUBDEV_FL_STREAMS ) && sd->entity.num_pads) { state->pads = kvcalloc(sd->entity.num_pads,include/media/v4l2-subdev.h +2
-0@@ -756,6 +756,7 @@ struct v4l2_subdev_krouting {* * @_lock: default for 'lock' * @lock: mutex for the state. May be replaced by the user. +* @num_pads: the number of entries in the pads array * @pads: &struct v4l2_subdev_pad_config array * @routing: routing table for the subdev * @stream_configs: stream configurations (only for V4L2_SUBDEV_FL_STREAMS) @@ -768,6 +769,7 @@ struct v4l2_subdev_state {/* lock for the struct v4l2_subdev_state fields */ struct mutex _lock;struct mutex *lock; +unsigned int num_pads;struct v4l2_subdev_pad_config *pads;struct v4l2_subdev_krouting routing;struct v4l2_subdev_stream_configs stream_configs;
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH 1/6] media: v4l: subdev: Store the number of pads in sub-device state
Hi Laurent,
Thanks for the review.
Quoted 10 lines · Laurent Pinchart
Hi Sakari,
Thank you for the patch.
Quoted 2 lines · Sakari Ailus
Store the number of pads in the sub-device state. This will be needed to validate pad when retrieving information for non-stream-aware users.
I'd rather store a pointer to the subdev. You can get the number of pads from there.
The value is initialised after the array is allocated so this won't change.
I don't have a strong opinion either way. It's still more efficient to store just the value.
Signature · 3 lines
Regards, Sakari Ailus
Laurent Pinchart
maintainerRe: [PATCH 1/6] media: v4l: subdev: Store the number of pads in sub-device state
Quoted 5 lines · Sakari Ailus
Quoted 4 lines · Laurent Pinchart
Quoted 2 lines · Sakari Ailus
Store the number of pads in the sub-device state. This will be needed to validate pad when retrieving information for non-stream-aware users.
Quoted 7 lines
Quoted 2 lines
I'd rather store a pointer to the subdev. You can get the number of pads from there.
The value is initialised after the array is allocated so this won't change.
I don't have a strong opinion either way. It's still more efficient to store just the value.
Slightly so, but I don't think it will matter in practice. I believe we'll have more needs to access the subdev from the state in the future, which is why I'd rather store the pointer already.
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH 1/6] media: v4l: subdev: Store the number of pads in sub-device state
Quoted 9 lines · Laurent Pinchart
Quoted 8 lines · Sakari Ailus
Quoted 6 lines · Laurent Pinchart
Quoted 2 lines · Sakari Ailus
Store the number of pads in the sub-device state. This will be needed to validate pad when retrieving information for non-stream-aware users.
I'd rather store a pointer to the subdev. You can get the number of pads from there.
Quoted 8 lines
Quoted 4 lines
The value is initialised after the array is allocated so this won't change.
I don't have a strong opinion either way. It's still more efficient to store just the value.
Slightly so, but I don't think it will matter in practice. I believe we'll have more needs to access the subdev from the state in the future, which is why I'd rather store the pointer already.
Fair enough, I'll make it a sub-device pointer.
Signature · 1 line
Sakari Ailus
Re: [PATCH 1/6] media: v4l: subdev: Store the number of pads in sub-device state
Quoted 12 lines · Sakari Ailus
Quoted 11 lines · Laurent Pinchart
Quoted 10 lines · Sakari Ailus
Quoted 6 lines · Laurent Pinchart
Quoted 2 lines · Sakari Ailus
Store the number of pads in the sub-device state. This will be needed to validate pad when retrieving information for non-stream-aware users.
I'd rather store a pointer to the subdev. You can get the number of pads from there.
The value is initialised after the array is allocated so this won't change.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
I don't have a strong opinion either way. It's still more efficient to store just the value.
Slightly so, but I don't think it will matter in practice. I believe we'll have more needs to access the subdev from the state in the future, which is why I'd rather store the pointer already.
Fair enough, I'll make it a sub-device pointer.
I have to say like the num_pads more here. We have a pointer to the pads array in the struct v4l2_subdev_state, and it'd be logical to also have the number of elements in that array in struct v4l2_subdev_state.
Tomi
Laurent Pinchart
maintainerRe: [PATCH 1/6] media: v4l: subdev: Store the number of pads in sub-device state
Quoted 20 lines · Tomi Valkeinen
Quoted 19 lines · Sakari Ailus
Quoted 17 lines · Laurent Pinchart
Quoted 5 lines · Sakari Ailus
Quoted 4 lines · Laurent Pinchart
Quoted 2 lines · Sakari Ailus
Store the number of pads in the sub-device state. This will be needed to validate pad when retrieving information for non-stream-aware users.
Quoted 7 lines
Quoted 2 lines
I'd rather store a pointer to the subdev. You can get the number of pads from there.
The value is initialised after the array is allocated so this won't change.
I don't have a strong opinion either way. It's still more efficient to store just the value.
Slightly so, but I don't think it will matter in practice. I believe we'll have more needs to access the subdev from the state in the future, which is why I'd rather store the pointer already.
Quoted 5 lines
Quoted 1 line
Fair enough, I'll make it a sub-device pointer.
I have to say like the
num_padsmore here. We have a pointer to the pads array in the structv4l2_subdev_state, and it'd be logical to also have the number of elements in that array in structv4l2_subdev_state.
Yes, but we'll likely need access to the subdev in the future, and it would then duplicate the information.
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerPATCH 2/6 media: v4l: subdev: Also return pads array information on stream functions
In reply to Sakari AilusThere are two sets of functions that return information from sub-device state, one for stream-unaware users and another for stream-aware users. Add support for stream-aware functions to return format, crop and compose information from pad-based array that are functionally equivalent to the old, stream-unaware ones.
Also check state is non-NULL, in order to guard against old drivers potentially calling this with NULL state for active formats or selection rectangles.
--- drivers/media/v4l2-core/v4l2-subdev.c | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
drivers/media/v4l2-core/v4l2-subdev.c +39 -0
@@ -1684,6 +1684,19 @@ v4l2_subdev_state_get_stream_format(struct v4l2_subdev_state *state,struct v4l2_subdev_stream_configs *stream_configs;unsigned int i; +if (WARN_ON (!state)) +return NULL ; + +if (state->pads) { +if (stream) +return NULL ; + +if (WARN_ON (pad >= state->num_pads)) + pad =0 ; + +return &state->pads[pad].try_fmt; + } +lockdep_assert_held (state->lock); stream_configs = &state->stream_configs;
@@ -1705,6 +1718,19 @@ v4l2_subdev_state_get_stream_crop(struct v4l2_subdev_state *state,struct v4l2_subdev_stream_configs *stream_configs;unsigned int i; +if (WARN_ON (!state)) +return NULL ; + +if (state->pads) { +if (stream) +return NULL ; + +if (WARN_ON (pad >= state->num_pads)) + pad =0 ; + +return &state->pads[pad].try_crop; + } +lockdep_assert_held (state->lock); stream_configs = &state->stream_configs;
@@ -1726,6 +1752,19 @@ v4l2_subdev_state_get_stream_compose(struct v4l2_subdev_state *state,struct v4l2_subdev_stream_configs *stream_configs;unsigned int i; +if (WARN_ON (!state)) +return NULL ; + +if (state->pads) { +if (stream) +return NULL ; + +if (WARN_ON (pad >= state->num_pads)) + pad =0 ; + +return &state->pads[pad].try_compose; + } +lockdep_assert_held (state->lock); stream_configs = &state->stream_configs;
Signature · 1 line
2.39.2
Laurent Pinchart
maintainerRe: [PATCH 2/6] media: v4l: subdev: Also return pads array information on stream functions
Hi Sakari,
Thank you for the patch.
Quoted 9 lines · Sakari Ailus
There are two sets of functions that return information from sub-device state, one for stream-unaware users and another for stream-aware users. Add support for stream-aware functions to return format, crop and compose information from pad-based array that are functionally equivalent to the old, stream-unaware ones.
Also check state is non-NULL, in order to guard against old drivers potentially calling this with NULL state for active formats or selection rectangles.
I'm not too keen on this I'm afraid :-( I think it gets confusing for drivers that are not stream-aware to have to call a function that takes a stream number. I don't see a problem with keeping two different sets of functions, one for stream-aware drivers, and one for other drivers.
Quoted 69 lines
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/v4l2-core/v4l2-subdev.c | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)drivers/media/v4l2-core/v4l2-subdev.c +39
-0@@ -1684,6 +1684,19 @@ v4l2_subdev_state_get_stream_format(struct v4l2_subdev_state *state,struct v4l2_subdev_stream_configs *stream_configs;unsigned int i; +if (WARN_ON (!state)) +return NULL ; + +if (state->pads) { +if (stream) +return NULL ; + +if (WARN_ON (pad >= state->num_pads)) + pad =0 ; + +return &state->pads[pad].try_fmt; + } +lockdep_assert_held (state->lock); stream_configs = &state->stream_configs;@@ -1705,6 +1718,19 @@ v4l2_subdev_state_get_stream_crop(struct v4l2_subdev_state *state,struct v4l2_subdev_stream_configs *stream_configs;unsigned int i; +if (WARN_ON (!state)) +return NULL ; + +if (state->pads) { +if (stream) +return NULL ; + +if (WARN_ON (pad >= state->num_pads)) + pad =0 ; + +return &state->pads[pad].try_crop; + } +lockdep_assert_held (state->lock); stream_configs = &state->stream_configs;@@ -1726,6 +1752,19 @@ v4l2_subdev_state_get_stream_compose(struct v4l2_subdev_state *state,struct v4l2_subdev_stream_configs *stream_configs;unsigned int i; +if (WARN_ON (!state)) +return NULL ; + +if (state->pads) { +if (stream) +return NULL ; + +if (WARN_ON (pad >= state->num_pads)) + pad =0 ; + +return &state->pads[pad].try_compose; + } +lockdep_assert_held (state->lock); stream_configs = &state->stream_configs;
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH 2/6] media: v4l: subdev: Also return pads array information on stream functions
Hi Laurent,
Quoted 11 lines · Laurent Pinchart
Hi Sakari,
Thank you for the patch.
Quoted 6 lines · Sakari Ailus
There are two sets of functions that return information from sub-device state, one for stream-unaware users and another for stream-aware users. Add support for stream-aware functions to return format, crop and compose information from pad-based array that are functionally equivalent to the old, stream-unaware ones.
Quoted 8 lines
Quoted 3 lines
Also check state is non-NULL, in order to guard against old drivers potentially calling this with NULL state for active formats or selection rectangles.
I'm not too keen on this I'm afraid :-( I think it gets confusing for drivers that are not stream-aware to have to call a function that takes a stream number. I don't see a problem with keeping two different sets of functions, one for stream-aware drivers, and one for other drivers.
This becomes a nuisance in drivers such as CCS that work with sub-devices some of which have streams and others which don't. I don't see why we should have two sets of functions to access the same information, even though it's stored differently.
I can add a wrapper using C11 _Generic to make the stream number go away.
Signature · 3 lines
Regards, Sakari Ailus
Laurent Pinchart
maintainerRe: [PATCH 2/6] media: v4l: subdev: Also return pads array information on stream functions
Hi Sakari,
Quoted 17 lines · Sakari Ailus
Quoted 7 lines · Laurent Pinchart
Quoted 6 lines · Sakari Ailus
There are two sets of functions that return information from sub-device state, one for stream-unaware users and another for stream-aware users. Add support for stream-aware functions to return format, crop and compose information from pad-based array that are functionally equivalent to the old, stream-unaware ones.
Quoted 8 lines
Quoted 3 lines
Also check state is non-NULL, in order to guard against old drivers potentially calling this with NULL state for active formats or selection rectangles.
I'm not too keen on this I'm afraid :-( I think it gets confusing for drivers that are not stream-aware to have to call a function that takes a stream number. I don't see a problem with keeping two different sets of functions, one for stream-aware drivers, and one for other drivers.
Quoted 6 lines
This becomes a nuisance in drivers such as CCS that work with sub-devices some of which have streams and others which don't. I don't see why we should have two sets of functions to access the same information, even though it's stored differently.
I can add a wrapper using C11
_Genericto make the stream number go away.
That could possibly be interesting.
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH 2/6] media: v4l: subdev: Also return pads array information on stream functions
Quoted 20 lines · Laurent Pinchart
Hi Sakari,
Quoted 17 lines · Sakari Ailus
Quoted 15 lines · Laurent Pinchart
Quoted 9 lines · Sakari Ailus
There are two sets of functions that return information from sub-device state, one for stream-unaware users and another for stream-aware users. Add support for stream-aware functions to return format, crop and compose information from pad-based array that are functionally equivalent to the old, stream-unaware ones.
Also check state is non-NULL, in order to guard against old drivers potentially calling this with NULL state for active formats or selection rectangles.
I'm not too keen on this I'm afraid :-( I think it gets confusing for drivers that are not stream-aware to have to call a function that takes a stream number. I don't see a problem with keeping two different sets of functions, one for stream-aware drivers, and one for other drivers.
Quoted 8 lines
Quoted 6 lines
This becomes a nuisance in drivers such as CCS that work with sub-devices some of which have streams and others which don't. I don't see why we should have two sets of functions to access the same information, even though it's stored differently.
I can add a wrapper using C11
_Genericto make the stream number go away.That could possibly be interesting.
I'll add this for v2.
Signature · 1 line
Sakari Ailus
Sakari Ailus
maintainerRe: [PATCH 2/6] media: v4l: subdev: Also return pads array information on stream functions
Quoted 26 lines · Sakari Ailus
Quoted 25 lines · Laurent Pinchart
Hi Sakari,
Quoted 22 lines · Sakari Ailus
Quoted 7 lines · Laurent Pinchart
Quoted 6 lines · Sakari Ailus
There are two sets of functions that return information from sub-device state, one for stream-unaware users and another for stream-aware users. Add support for stream-aware functions to return format, crop and compose information from pad-based array that are functionally equivalent to the old, stream-unaware ones.
Quoted 8 lines
Quoted 3 lines
Also check state is non-NULL, in order to guard against old drivers potentially calling this with NULL state for active formats or selection rectangles.
I'm not too keen on this I'm afraid :-( I think it gets confusing for drivers that are not stream-aware to have to call a function that takes a stream number. I don't see a problem with keeping two different sets of functions, one for stream-aware drivers, and one for other drivers.
This becomes a nuisance in drivers such as CCS that work with sub-devices some of which have streams and others which don't. I don't see why we should have two sets of functions to access the same information, even though it's stored differently.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
I can add a wrapper using C11
_Genericto make the stream number go away.That could possibly be interesting.
I'll add this for v2.
C11 _Generic() isn't up to the task as it only deals with argument types. On the other hand, variadic arguments supports this. It'll look like:
#define v4l2_subdev_get_crop(state, pad, ...) \ __v4l2_subdev_get_crop_ ## __VA_OPT__(stream) \ (state, pad __VA_OPT__(,) __VA_ARGS__) #define __v4l2_subdev_get_crop_(state, pad) \ __v4l2_subdev_get_crop(state, pad, 0) #define __v4l2_subdev_get_crop_stream(state, pad, stream) \ __v4l2_subdev_get_crop(state, pad, stream) struct v4l2_rect * __v4l2_subdev_get_crop(struct v4l2_subdev_state *state, unsigned int pad, u32 stream);
Which I'd say is tolerable, given the result is a single function to access format, crop and compose information in the sub-device state.
Any thoughts on this?
Signature · 1 line
Sakari Ailus
Laurent Pinchart
maintainerRe: [PATCH 2/6] media: v4l: subdev: Also return pads array information on stream functions
Quoted 45 lines · Sakari Ailus
Quoted 24 lines · Sakari Ailus
Quoted 23 lines · Laurent Pinchart
Quoted 22 lines · Sakari Ailus
Quoted 7 lines · Laurent Pinchart
Quoted 6 lines · Sakari Ailus
There are two sets of functions that return information from sub-device state, one for stream-unaware users and another for stream-aware users. Add support for stream-aware functions to return format, crop and compose information from pad-based array that are functionally equivalent to the old, stream-unaware ones.
Quoted 8 lines
Quoted 3 lines
Also check state is non-NULL, in order to guard against old drivers potentially calling this with NULL state for active formats or selection rectangles.
I'm not too keen on this I'm afraid :-( I think it gets confusing for drivers that are not stream-aware to have to call a function that takes a stream number. I don't see a problem with keeping two different sets of functions, one for stream-aware drivers, and one for other drivers.
This becomes a nuisance in drivers such as CCS that work with sub-devices some of which have streams and others which don't. I don't see why we should have two sets of functions to access the same information, even though it's stored differently.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
I can add a wrapper using C11
_Genericto make the stream number go away.That could possibly be interesting.
I'll add this for v2.
C11
_Generic()isn't up to the task as it only deals with argument types. On the other hand, variadic arguments supports this. It'll look like:#define v4l2_subdev_get_crop(state, pad, ...) \ __v4l2_subdev_get_crop_ ## __VA_OPT__(stream) \ (state, pad __VA_OPT__(,) __VA_ARGS__) #define __v4l2_subdev_get_crop_(state, pad) \ __v4l2_subdev_get_crop(state, pad, 0) #define __v4l2_subdev_get_crop_stream(state, pad, stream) \ __v4l2_subdev_get_crop(state, pad, stream) struct v4l2_rect * __v4l2_subdev_get_crop(struct v4l2_subdev_state *state, unsigned int pad, u32 stream);
Quoted 4 lines
Which I'd say is tolerable, given the result is a single function to access format, crop and compose information in the sub-device state.
Any thoughts on this?
With s/v4l2_subdev_get_crop/v4l2_subdev_state_get_crop/ I'm OK with this.
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerPATCH 3/6 media: v4l: subdev: Rename sub-device state information access functions
In reply to Sakari AilusRename the sub-devices state information access functions, removing "_state" and "_stream" from them. This makes them shorter and so more convenient to use. No other functions will be needed to access this information.
--- drivers/media/v4l2-core/v4l2-subdev.c | 27 +++++++++++++------------- include/media/v4l2-subdev.h | 28 ++++++++++++++------------- 2 files changed, 28 insertions(+), 27 deletions(-)
drivers/media/v4l2-core/v4l2-subdev.c +13 -14
@@ -177,7 +177,7 @@ static int check_state(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, {if (sd->flags &V4L2_SUBDEV_FL_STREAMS ) {#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API ) -if (!v4l2_subdev_state_get_stream_format (state, pad, stream)) +if (!v4l2_subdev_get_format (state, pad, stream))return -EINVAL ;return 0 ;#else
@@ -1581,8 +1581,8 @@ int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state,struct v4l2_mbus_framefmt *fmt;if (sd->flags &V4L2_SUBDEV_FL_STREAMS ) - fmt =v4l2_subdev_state_get_stream_format (state, format->pad, - format->stream); + fmt =v4l2_subdev_get_format (state, format->pad, + format->stream);else if (format->pad < sd->entity.num_pads && format->stream ==0 ) fmt =v4l2_subdev_get_pad_format (sd, state, format->pad);else
@@ -1678,8 +1678,8 @@ int v4l2_subdev_set_routing_with_fmt(struct v4l2_subdev *sd,EXPORT_SYMBOL_GPL (v4l2_subdev_set_routing_with_fmt);struct v4l2_mbus_framefmt * -v4l2_subdev_state_get_stream_format (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream) +v4l2_subdev_get_format (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream) {struct v4l2_subdev_stream_configs *stream_configs;unsigned int i;
@@ -1709,11 +1709,11 @@ v4l2_subdev_state_get_stream_format(struct v4l2_subdev_state *state,return NULL ; } -EXPORT_SYMBOL_GPL (v4l2_subdev_state_get_stream_format); +EXPORT_SYMBOL_GPL (v4l2_subdev_get_format);struct v4l2_rect * -v4l2_subdev_state_get_stream_crop (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream) +v4l2_subdev_get_crop (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream) {struct v4l2_subdev_stream_configs *stream_configs;unsigned int i;
@@ -1743,11 +1743,11 @@ v4l2_subdev_state_get_stream_crop(struct v4l2_subdev_state *state,return NULL ; } -EXPORT_SYMBOL_GPL (v4l2_subdev_state_get_stream_crop); +EXPORT_SYMBOL_GPL (v4l2_subdev_get_crop);struct v4l2_rect * -v4l2_subdev_state_get_stream_compose (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream) +v4l2_subdev_get_compose (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream) {struct v4l2_subdev_stream_configs *stream_configs;unsigned int i;
@@ -1777,7 +1777,7 @@ v4l2_subdev_state_get_stream_compose(struct v4l2_subdev_state *state,return NULL ; } -EXPORT_SYMBOL_GPL (v4l2_subdev_state_get_stream_compose); +EXPORT_SYMBOL_GPL (v4l2_subdev_get_compose); int v4l2_subdev_routing_find_opposite_end(const struct v4l2_subdev_krouting *routing, u32 pad, u32 stream, u32 *other_pad,
@@ -1823,8 +1823,7 @@ v4l2_subdev_state_get_opposite_stream_format(struct v4l2_subdev_state *state,if (ret)return NULL ; -return v4l2_subdev_state_get_stream_format (state, other_pad, - other_stream); +return v4l2_subdev_get_format (state, other_pad, other_stream); }EXPORT_SYMBOL_GPL (v4l2_subdev_state_get_opposite_stream_format);
include/media/v4l2-subdev.h +15 -13
@@ -1542,7 +1542,7 @@ int v4l2_subdev_set_routing_with_fmt(struct v4l2_subdev *sd, const struct v4l2_mbus_framefmt *fmt);/** -* v4l2_subdev_state_get_stream_format() - Get pointer to a stream format +* v4l2_subdev_get_format() - Get pointer to a stream format * @state: subdevice state * @pad: pad id * @stream: stream id
@@ -1550,14 +1550,15 @@ int v4l2_subdev_set_routing_with_fmt(struct v4l2_subdev *sd,* This returns a pointer to &struct v4l2_mbus_framefmt for the given pad + * stream in the subdev state. * -* If the state does not contain the given pad + stream, NULL is returned. +* For stream-unaware drivers the format for the corresponding pad is returned. +* If the pad does not exist, NULL is returned. */ struct v4l2_mbus_framefmt * -v4l2_subdev_state_get_stream_format (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream); +v4l2_subdev_get_format (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream);/** -* v4l2_subdev_state_get_stream_crop() - Get pointer to a stream crop rectangle +* v4l2_subdev_get_crop() - Get pointer to a stream crop rectangle * @state: subdevice state * @pad: pad id * @stream: stream id
@@ -1565,15 +1566,15 @@ v4l2_subdev_state_get_stream_format(struct v4l2_subdev_state *state,* This returns a pointer to crop rectangle for the given pad + stream in the * subdev state. * -* If the state does not contain the given pad + stream, NULL is returned. +* For stream-unaware drivers the crop rectangle for the corresponding pad is +* returned. If the pad does not exist, NULL is returned. */ struct v4l2_rect * -v4l2_subdev_state_get_stream_crop (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream); +v4l2_subdev_get_crop (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream);/** -* v4l2_subdev_state_get_stream_compose() - Get pointer to a stream compose -* rectangle +* v4l2_subdev_get_compose() - Get pointer to a stream compose rectangle * @state: subdevice state * @pad: pad id * @stream: stream id
@@ -1581,11 +1582,12 @@ v4l2_subdev_state_get_stream_crop(struct v4l2_subdev_state *state,* This returns a pointer to compose rectangle for the given pad + stream in the * subdev state. * -* If the state does not contain the given pad + stream, NULL is returned. +* For stream-unaware drivers the compose rectangle for the corresponding pad is +* returned. If the pad does not exist, NULL is returned. */ struct v4l2_rect * -v4l2_subdev_state_get_stream_compose (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream); +v4l2_subdev_get_compose (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream);/** * v4l2_subdev_routing_find_opposite_end() - Find the opposite stream
Signature · 1 line
2.39.2
Laurent Pinchart
maintainerRe: [PATCH 3/6] media: v4l: subdev: Rename sub-device state information access functions
Hi Sakari,
Thank you for the patch.
Quoted 4 lines · Sakari Ailus
Rename the sub-devices state information access functions, removing "
_state" and "_stream" from them. This makes them shorter and so more convenient to use. No other functions will be needed to access this information.
The new names are too generic, and thus confusing. For instance, v4l2_subdev_get_format() is way too close to v4l2_subdev_get_fmt(). I'm fine dropping "_stream", but I would like to keep "_state".
Quoted 160 lines
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/v4l2-core/v4l2-subdev.c | 27 +++++++++++++------------- include/media/v4l2-subdev.h | 28 ++++++++++++++------------- 2 files changed, 28 insertions(+), 27 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +13
-14@@ -177,7 +177,7 @@ static int check_state(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, {if (sd->flags &V4L2_SUBDEV_FL_STREAMS ) {#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API ) -if (!v4l2_subdev_state_get_stream_format (state, pad, stream)) +if (!v4l2_subdev_get_format (state, pad, stream))return -EINVAL ;return 0 ;#else @@ -1581,8 +1581,8 @@ int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state,struct v4l2_mbus_framefmt *fmt;if (sd->flags &V4L2_SUBDEV_FL_STREAMS ) - fmt =v4l2_subdev_state_get_stream_format (state, format->pad, - format->stream); + fmt =v4l2_subdev_get_format (state, format->pad, + format->stream);else if (format->pad < sd->entity.num_pads && format->stream ==0 ) fmt =v4l2_subdev_get_pad_format (sd, state, format->pad);else @@ -1678,8 +1678,8 @@ int v4l2_subdev_set_routing_with_fmt(struct v4l2_subdev *sd,EXPORT_SYMBOL_GPL (v4l2_subdev_set_routing_with_fmt);struct v4l2_mbus_framefmt * -v4l2_subdev_state_get_stream_format (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream) +v4l2_subdev_get_format (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream) {struct v4l2_subdev_stream_configs *stream_configs;unsigned int i;@@ -1709,11 +1709,11 @@ v4l2_subdev_state_get_stream_format(struct v4l2_subdev_state *state,return NULL ; } -EXPORT_SYMBOL_GPL (v4l2_subdev_state_get_stream_format); +EXPORT_SYMBOL_GPL (v4l2_subdev_get_format);struct v4l2_rect * -v4l2_subdev_state_get_stream_crop (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream) +v4l2_subdev_get_crop (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream) {struct v4l2_subdev_stream_configs *stream_configs;unsigned int i;@@ -1743,11 +1743,11 @@ v4l2_subdev_state_get_stream_crop(struct v4l2_subdev_state *state,return NULL ; } -EXPORT_SYMBOL_GPL (v4l2_subdev_state_get_stream_crop); +EXPORT_SYMBOL_GPL (v4l2_subdev_get_crop);struct v4l2_rect * -v4l2_subdev_state_get_stream_compose (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream) +v4l2_subdev_get_compose (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream) {struct v4l2_subdev_stream_configs *stream_configs;unsigned int i;@@ -1777,7 +1777,7 @@ v4l2_subdev_state_get_stream_compose(struct v4l2_subdev_state *state,return NULL ; } -EXPORT_SYMBOL_GPL (v4l2_subdev_state_get_stream_compose); +EXPORT_SYMBOL_GPL (v4l2_subdev_get_compose); int v4l2_subdev_routing_find_opposite_end(const struct v4l2_subdev_krouting *routing, u32 pad, u32 stream, u32 *other_pad,@@ -1823,8 +1823,7 @@ v4l2_subdev_state_get_opposite_stream_format(struct v4l2_subdev_state *state,if (ret)return NULL ; -return v4l2_subdev_state_get_stream_format (state, other_pad, - other_stream); +return v4l2_subdev_get_format (state, other_pad, other_stream); }EXPORT_SYMBOL_GPL (v4l2_subdev_state_get_opposite_stream_format);include/media/v4l2-subdev.h +15
-13@@ -1542,7 +1542,7 @@ int v4l2_subdev_set_routing_with_fmt(struct v4l2_subdev *sd, const struct v4l2_mbus_framefmt *fmt);/** -* v4l2_subdev_state_get_stream_format() - Get pointer to a stream format +* v4l2_subdev_get_format() - Get pointer to a stream format * @state: subdevice state * @pad: pad id * @stream: stream id @@ -1550,14 +1550,15 @@ int v4l2_subdev_set_routing_with_fmt(struct v4l2_subdev *sd,* This returns a pointer to &struct v4l2_mbus_framefmt for the given pad + * stream in the subdev state. * -* If the state does not contain the given pad + stream, NULL is returned. +* For stream-unaware drivers the format for the corresponding pad is returned. +* If the pad does not exist, NULL is returned. */ struct v4l2_mbus_framefmt * -v4l2_subdev_state_get_stream_format (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream); +v4l2_subdev_get_format (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream);/** -* v4l2_subdev_state_get_stream_crop() - Get pointer to a stream crop rectangle +* v4l2_subdev_get_crop() - Get pointer to a stream crop rectangle * @state: subdevice state * @pad: pad id * @stream: stream id @@ -1565,15 +1566,15 @@ v4l2_subdev_state_get_stream_format(struct v4l2_subdev_state *state,* This returns a pointer to crop rectangle for the given pad + stream in the * subdev state. * -* If the state does not contain the given pad + stream, NULL is returned. +* For stream-unaware drivers the crop rectangle for the corresponding pad is +* returned. If the pad does not exist, NULL is returned. */ struct v4l2_rect * -v4l2_subdev_state_get_stream_crop (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream); +v4l2_subdev_get_crop (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream);/** -* v4l2_subdev_state_get_stream_compose() - Get pointer to a stream compose -* rectangle +* v4l2_subdev_get_compose() - Get pointer to a stream compose rectangle * @state: subdevice state * @pad: pad id * @stream: stream id @@ -1581,11 +1582,12 @@ v4l2_subdev_state_get_stream_crop(struct v4l2_subdev_state *state,* This returns a pointer to compose rectangle for the given pad + stream in the * subdev state. * -* If the state does not contain the given pad + stream, NULL is returned. +* For stream-unaware drivers the compose rectangle for the corresponding pad is +* returned. If the pad does not exist, NULL is returned. */ struct v4l2_rect * -v4l2_subdev_state_get_stream_compose (struct v4l2_subdev_state *state, -unsigned int pad,u32 stream); +v4l2_subdev_get_compose (struct v4l2_subdev_state *state,unsigned int pad, +u32 stream);/** * v4l2_subdev_routing_find_opposite_end() - Find the opposite stream
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH 3/6] media: v4l: subdev: Rename sub-device state information access functions
Hi Laurent,
Quoted 5 lines · Laurent Pinchart
Hi Sakari,
Thank you for the patch.
On Fri, Oct 13, 2023 at 01:44:21PM +0300, Sakari Ailus wrote:
Quoted 9 lines
Quoted 4 lines
Rename the sub-devices state information access functions, removing "
_state" and "_stream" from them. This makes them shorter and so more convenient to use. No other functions will be needed to access this information.The new names are too generic, and thus confusing. For instance,
v4l2_subdev_get_format()is way too close tov4l2_subdev_get_fmt(). I'm fine dropping "_stream", but I would like to keep "_state".
My intention was actually to rename v4l2_subdev_get_fmt() later on: it's used in an ops struct, almost uniquely, so its name can be longer without it being a nuisance. I can include this in the same set.
The reason for using a shorter names such as v4l2_subdev_get_format() is that they're nicer to use in the code. The function names we've added recently are often exceedingly long. There's hardly room for confusion in this case either: these functions will remain as the only interface to access information in sub-device state.
Signature · 3 lines
Regards, Sakari Ailus
Laurent Pinchart
maintainerRe: [PATCH 3/6] media: v4l: subdev: Rename sub-device state information access functions
Quoted 7 lines · Sakari Ailus
Quoted 6 lines · Laurent Pinchart
Quoted 4 lines · Sakari Ailus
Rename the sub-devices state information access functions, removing "
_state" and "_stream" from them. This makes them shorter and so more convenient to use. No other functions will be needed to access this information.
Quoted 8 lines
Quoted 4 lines
The new names are too generic, and thus confusing. For instance,
v4l2_subdev_get_format()is way too close tov4l2_subdev_get_fmt(). I'm fine dropping "_stream", but I would like to keep "_state".My intention was actually to rename
v4l2_subdev_get_fmt()later on: it's used in an ops struct, almost uniquely, so its name can be longer without it being a nuisance. I can include this in the same set.
No objection, as long as the new name is clear.
Quoted 5 lines
The reason for using a shorter names such as
v4l2_subdev_get_format()is that they're nicer to use in the code. The function names we've added recently are often exceedingly long. There's hardly room for confusion in this case either: these functions will remain as the only interface to access information in sub-device state.
I agree that long names are not nice, but too short names end up not being descriptive enough. As these functions operate on a state, I'd like to keep that information in the name to differenciate them from functions operating on the subdev, and use the same state-aware prefix for all similar functions (I expect we'll get more of them). If you can find a good short form for the v4l2_subdev_state_ prefix that we can use through the code base, that would be fine too. And before you ask v4l2_sd_st_ is not good :-)
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH 3/6] media: v4l: subdev: Rename sub-device state information access functions
Quoted 25 lines · Laurent Pinchart
Quoted 7 lines · Sakari Ailus
Quoted 6 lines · Laurent Pinchart
Quoted 4 lines · Sakari Ailus
Rename the sub-devices state information access functions, removing "
_state" and "_stream" from them. This makes them shorter and so more convenient to use. No other functions will be needed to access this information.Quoted 8 lines
Quoted 4 lines
The new names are too generic, and thus confusing. For instance,
v4l2_subdev_get_format()is way too close tov4l2_subdev_get_fmt(). I'm fine dropping "_stream", but I would like to keep "_state".My intention was actually to rename
v4l2_subdev_get_fmt()later on: it's used in an ops struct, almost uniquely, so its name can be longer without it being a nuisance. I can include this in the same set.No objection, as long as the new name is clear.
Quoted 5 lines
The reason for using a shorter names such as
v4l2_subdev_get_format()is that they're nicer to use in the code. The function names we've added recently are often exceedingly long. There's hardly room for confusion in this case either: these functions will remain as the only interface to access information in sub-device state.
Quoted 8 lines
I agree that long names are not nice, but too short names end up not being descriptive enough. As these functions operate on a state, I'd like to keep that information in the name to differenciate them from functions operating on the subdev, and use the same state-aware prefix for all similar functions (I expect we'll get more of them). If you can find a good short form for the
v4l2_subdev_state_prefix that we can use through the code base, that would be fine too. And before you askv4l2_sd_st_is not good :-)
What would you say about v4l2_subdev_state_format() etc.? It's a function to obtain a pointer to the format on a given pad(/stream) and "get" typically isn't a part of the function name in other similar cases.
Signature · 1 line
Sakari Ailus
Laurent Pinchart
maintainerRe: [PATCH 3/6] media: v4l: subdev: Rename sub-device state information access functions
Quoted 35 lines · Sakari Ailus
Quoted 25 lines · Laurent Pinchart
Quoted 7 lines · Sakari Ailus
Quoted 6 lines · Laurent Pinchart
Quoted 4 lines · Sakari Ailus
Rename the sub-devices state information access functions, removing "
_state" and "_stream" from them. This makes them shorter and so more convenient to use. No other functions will be needed to access this information.Quoted 8 lines
Quoted 4 lines
The new names are too generic, and thus confusing. For instance,
v4l2_subdev_get_format()is way too close tov4l2_subdev_get_fmt(). I'm fine dropping "_stream", but I would like to keep "_state".My intention was actually to rename
v4l2_subdev_get_fmt()later on: it's used in an ops struct, almost uniquely, so its name can be longer without it being a nuisance. I can include this in the same set.No objection, as long as the new name is clear.
Quoted 5 lines
The reason for using a shorter names such as
v4l2_subdev_get_format()is that they're nicer to use in the code. The function names we've added recently are often exceedingly long. There's hardly room for confusion in this case either: these functions will remain as the only interface to access information in sub-device state.Quoted 8 lines
I agree that long names are not nice, but too short names end up not being descriptive enough. As these functions operate on a state, I'd like to keep that information in the name to differenciate them from functions operating on the subdev, and use the same state-aware prefix for all similar functions (I expect we'll get more of them). If you can find a good short form for the
v4l2_subdev_state_prefix that we can use through the code base, that would be fine too. And before you askv4l2_sd_st_is not good :-)
Quoted 3 lines
What would you say about
v4l2_subdev_state_format()etc.? It's a function to obtain a pointer to the format on a given pad(/stream) and "get" typically isn't a part of the function name in other similar cases.
I like it better than v4l2_subdev_get_format() for sure, but I think the _get here still looks a bit better. v4l2_subdev_state_get_format() would already be shorter than the existing function name, do we need to shorten it even further ?
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerRe: [PATCH 3/6] media: v4l: subdev: Rename sub-device state information access functions
Quoted 36 lines · Laurent Pinchart
Quoted 35 lines · Sakari Ailus
Quoted 33 lines · Laurent Pinchart
Quoted 7 lines · Sakari Ailus
Quoted 6 lines · Laurent Pinchart
Quoted 4 lines · Sakari Ailus
Rename the sub-devices state information access functions, removing "
_state" and "_stream" from them. This makes them shorter and so more convenient to use. No other functions will be needed to access this information.Quoted 8 lines
Quoted 4 lines
The new names are too generic, and thus confusing. For instance,
v4l2_subdev_get_format()is way too close tov4l2_subdev_get_fmt(). I'm fine dropping "_stream", but I would like to keep "_state".My intention was actually to rename
v4l2_subdev_get_fmt()later on: it's used in an ops struct, almost uniquely, so its name can be longer without it being a nuisance. I can include this in the same set.No objection, as long as the new name is clear.
Quoted 5 lines
The reason for using a shorter names such as
v4l2_subdev_get_format()is that they're nicer to use in the code. The function names we've added recently are often exceedingly long. There's hardly room for confusion in this case either: these functions will remain as the only interface to access information in sub-device state.I agree that long names are not nice, but too short names end up not being descriptive enough. As these functions operate on a state, I'd like to keep that information in the name to differenciate them from functions operating on the subdev, and use the same state-aware prefix for all similar functions (I expect we'll get more of them). If you can find a good short form for the
v4l2_subdev_state_prefix that we can use through the code base, that would be fine too. And before you askv4l2_sd_st_is not good :-)
Quoted 8 lines
Quoted 3 lines
What would you say about
v4l2_subdev_state_format()etc.? It's a function to obtain a pointer to the format on a given pad(/stream) and "get" typically isn't a part of the function name in other similar cases.I like it better than
v4l2_subdev_get_format()for sure, but I think the_gethere still looks a bit better.v4l2_subdev_state_get_format()would already be shorter than the existing function name, do we need to shorten it even further ?
As noted, we don't have "_get" as part of other similar functions. The only reason, as far as I can see, would be to keep it for historical reasons. As we've been changing the APIs otherwise a lot, I don't put much value for that. Having "get" also suggests refcounting is involved.
Therefore I prefer the shorter form.
Signature · 1 line
Sakari Ailus
kernel test robot
build botRe: [PATCH 3/6] media: v4l: subdev: Rename sub-device state information access functions
In reply to Sakari Ailuskernel test robot noticed the following build warnings:
Hi Sakari,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20231016]
[also build test WARNING on linus/master v6.6-rc6]
[cannot apply to media-tree/master rockchip/for-next sailus-media-tree/streams v6.6-rc6 v6.6-rc5 v6.6-rc4] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Sakari-Ailus/media-v4l-subdev-Also-return-pads-array-information-on-stream-functions/20231017-120800 base: next-20231016 patch link: https://lore.kernel.org/r/20231013104424.404768-4-sakari.ailus%40linux.intel.com patch subject: [PATCH 3/6] media: v4l: subdev: Rename sub-device state information access functions config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20231017/[email protected]/config) compiler: m68k-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231017/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/media/i2c/ds90ub913.c: In function 'ub913_set_fmt':
drivers/media/i2c/ds90ub913.c:427:15: error: implicit declaration of function 'v4l2_subdev_state_get_stream_format'; did you mean 'v4l2_subdev_state_get_opposite_stream_format'? [-Werror=implicit-function-declaration]
427 | fmt = v4l2_subdev_state_get_stream_format(state, format->pad,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| v4l2_subdev_state_get_opposite_stream_format
>> drivers/media/i2c/ds90ub913.c:427:13: warning: assignment to 'struct v4l2_mbus_framefmt *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
427 | fmt = v4l2_subdev_state_get_stream_format(state, format->pad,
| ^ cc1: some warnings being treated as errors
--
drivers/media/i2c/ds90ub953.c: In function 'ub953_set_fmt':
drivers/media/i2c/ds90ub953.c:561:15: error: implicit declaration of function 'v4l2_subdev_state_get_stream_format'; did you mean 'v4l2_subdev_state_get_opposite_stream_format'? [-Werror=implicit-function-declaration]
561 | fmt = v4l2_subdev_state_get_stream_format(state, format->pad,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| v4l2_subdev_state_get_opposite_stream_format
>> drivers/media/i2c/ds90ub953.c:561:13: warning: assignment to 'struct v4l2_mbus_framefmt *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
561 | fmt = v4l2_subdev_state_get_stream_format(state, format->pad,
| ^ cc1: some warnings being treated as errors
--
drivers/media/i2c/ds90ub960.c: In function 'ub960_configure_ports_for_streaming':
drivers/media/i2c/ds90ub960.c:2454:23: error: implicit declaration of function 'v4l2_subdev_state_get_stream_format'; did you mean 'v4l2_subdev_state_get_opposite_stream_format'? [-Werror=implicit-function-declaration]
2454 | fmt = v4l2_subdev_state_get_stream_format(state,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| v4l2_subdev_state_get_opposite_stream_format
>> drivers/media/i2c/ds90ub960.c:2454:21: warning: assignment to 'struct v4l2_mbus_framefmt *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2454 | fmt = v4l2_subdev_state_get_stream_format(state,
| ^
drivers/media/i2c/ds90ub960.c: In function 'ub960_get_frame_desc':
drivers/media/i2c/ds90ub960.c:2845:29: warning: assignment to 'struct v4l2_mbus_framefmt *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2845 | fmt = v4l2_subdev_state_get_stream_format(state, pad,
| ^
drivers/media/i2c/ds90ub960.c: In function 'ub960_set_fmt':
drivers/media/i2c/ds90ub960.c:2894:13: warning: assignment to 'struct v4l2_mbus_framefmt *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2894 | fmt = v4l2_subdev_state_get_stream_format(state, format->pad,
| ^cc1: some warnings being treated as errors
vim +427 drivers/media/i2c/ds90ub913.c
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 403
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 404 static int ub913_set_fmt(struct v4l2_subdev *sd,
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 405 struct v4l2_subdev_state *state,
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 406 struct v4l2_subdev_format *format)
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 407 {
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 408 struct ub913_data *priv = sd_to_ub913(sd);
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 409 struct v4l2_mbus_framefmt *fmt;
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 410 const struct ub913_format_info *finfo;
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 411
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 412 if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE &&
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 413 priv->enabled_source_streams)
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 414 return -EBUSY;
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 415
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 416 /* Source format is fully defined by the sink format, so not settable */
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 417 if (format->pad == UB913_PAD_SOURCE)
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 418 return v4l2_subdev_get_fmt(sd, state, format);
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 419
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 420 finfo = ub913_find_format(format->format.code);
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 421 if (!finfo) {
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 422 finfo = &ub913_formats[0];
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 423 format->format.code = finfo->incode;
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 424 }
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 425
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 426 /* Set sink format */
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 @427 fmt = v4l2_subdev_state_get_stream_format(state, format->pad,
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 428 format->stream);
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 429 if (!fmt)
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 430 return -EINVAL;
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 431
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 432 *fmt = format->format;
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 433
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 434 /* Propagate to source format, and adjust the mbus code */
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 435 fmt = v4l2_subdev_state_get_opposite_stream_format(state, format->pad,
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 436 format->stream);
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 437 if (!fmt)
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 438 return -EINVAL;
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 439
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 440 format->format.code = finfo->outcode;
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 441
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 442 *fmt = format->format;
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 443
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 444 return 0;
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 445 }
c158d0d4ff1530 Tomi Valkeinen 2023-06-19 446 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH 3/6] media: v4l: subdev: Rename sub-device state information access functions
In reply to Sakari Ailuskernel test robot noticed the following build warnings:
Hi Sakari,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20231016]
[also build test WARNING on linus/master v6.6-rc6]
[cannot apply to media-tree/master rockchip/for-next sailus-media-tree/streams v6.6-rc6 v6.6-rc5 v6.6-rc4] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Sakari-Ailus/media-v4l-subdev-Also-return-pads-array-information-on-stream-functions/20231017-120800 base: next-20231016 patch link: https://lore.kernel.org/r/20231013104424.404768-4-sakari.ailus%40linux.intel.com patch subject: [PATCH 3/6] media: v4l: subdev: Rename sub-device state information access functions config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20231017/[email protected]/config) compiler: sparc64-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231017/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c: In function 'mxc_isi_crossbar_gasket_enable':
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c:61:15: error: implicit declaration of function 'v4l2_subdev_state_get_stream_format'; did you mean 'v4l2_subdev_state_get_opposite_stream_format'? [-Werror=implicit-function-declaration]
61 | fmt = v4l2_subdev_state_get_stream_format(state, port, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| v4l2_subdev_state_get_opposite_stream_format
>> drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c:61:13: warning: assignment to 'const struct v4l2_mbus_framefmt *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
61 | fmt = v4l2_subdev_state_get_stream_format(state, port, 0);
| ^
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c: In function 'mxc_isi_crossbar_set_fmt':
>> drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c:284:18: warning: assignment to 'struct v4l2_mbus_framefmt *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
284 | sink_fmt = v4l2_subdev_state_get_stream_format(state, fmt->pad,
| ^
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c:299:28: warning: assignment to 'struct v4l2_mbus_framefmt *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
299 | source_fmt = v4l2_subdev_state_get_stream_format(state, route->source_pad,
| ^cc1: some warnings being treated as errors
vim +61 drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c
cf21f328fcafac Laurent Pinchart 2019-01-21 26
cf21f328fcafac Laurent Pinchart 2019-01-21 27 static int mxc_isi_crossbar_gasket_enable(struct mxc_isi_crossbar *xbar,
cf21f328fcafac Laurent Pinchart 2019-01-21 28 struct v4l2_subdev_state *state,
cf21f328fcafac Laurent Pinchart 2019-01-21 29 struct v4l2_subdev *remote_sd,
cf21f328fcafac Laurent Pinchart 2019-01-21 30 u32 remote_pad, unsigned int port)
cf21f328fcafac Laurent Pinchart 2019-01-21 31 {
cf21f328fcafac Laurent Pinchart 2019-01-21 32 struct mxc_isi_dev *isi = xbar->isi;
f48498ad0a4106 Guoniu.zhou 2023-06-29 33 const struct mxc_gasket_ops *gasket_ops = isi->pdata->gasket_ops;
cf21f328fcafac Laurent Pinchart 2019-01-21 34 const struct v4l2_mbus_framefmt *fmt;
cf21f328fcafac Laurent Pinchart 2019-01-21 35 struct v4l2_mbus_frame_desc fd;
cf21f328fcafac Laurent Pinchart 2019-01-21 36 int ret;
cf21f328fcafac Laurent Pinchart 2019-01-21 37
f48498ad0a4106 Guoniu.zhou 2023-06-29 38 if (!gasket_ops)
cf21f328fcafac Laurent Pinchart 2019-01-21 39 return 0;
cf21f328fcafac Laurent Pinchart 2019-01-21 40
cf21f328fcafac Laurent Pinchart 2019-01-21 41 /*
cf21f328fcafac Laurent Pinchart 2019-01-21 42 * Configure and enable the gasket with the frame size and CSI-2 data
cf21f328fcafac Laurent Pinchart 2019-01-21 43 * type. For YUV422 8-bit, enable dual component mode unconditionally,
cf21f328fcafac Laurent Pinchart 2019-01-21 44 * to match the configuration of the CSIS.
cf21f328fcafac Laurent Pinchart 2019-01-21 45 */
cf21f328fcafac Laurent Pinchart 2019-01-21 46
cf21f328fcafac Laurent Pinchart 2019-01-21 47 ret = v4l2_subdev_call(remote_sd, pad, get_frame_desc, remote_pad, &fd);
cf21f328fcafac Laurent Pinchart 2019-01-21 48 if (ret) {
cf21f328fcafac Laurent Pinchart 2019-01-21 49 dev_err(isi->dev,
cf21f328fcafac Laurent Pinchart 2019-01-21 50 "failed to get frame descriptor from '%s':%u: %d\n",
cf21f328fcafac Laurent Pinchart 2019-01-21 51 remote_sd->name, remote_pad, ret);
cf21f328fcafac Laurent Pinchart 2019-01-21 52 return ret;
cf21f328fcafac Laurent Pinchart 2019-01-21 53 }
cf21f328fcafac Laurent Pinchart 2019-01-21 54
cf21f328fcafac Laurent Pinchart 2019-01-21 55 if (fd.num_entries != 1) {
cf21f328fcafac Laurent Pinchart 2019-01-21 56 dev_err(isi->dev, "invalid frame descriptor for '%s':%u\n",
cf21f328fcafac Laurent Pinchart 2019-01-21 57 remote_sd->name, remote_pad);
cf21f328fcafac Laurent Pinchart 2019-01-21 58 return -EINVAL;
cf21f328fcafac Laurent Pinchart 2019-01-21 59 }
cf21f328fcafac Laurent Pinchart 2019-01-21 60
cf21f328fcafac Laurent Pinchart 2019-01-21 @61 fmt = v4l2_subdev_state_get_stream_format(state, port, 0);
cf21f328fcafac Laurent Pinchart 2019-01-21 62 if (!fmt)
cf21f328fcafac Laurent Pinchart 2019-01-21 63 return -EINVAL;
cf21f328fcafac Laurent Pinchart 2019-01-21 64
f48498ad0a4106 Guoniu.zhou 2023-06-29 65 gasket_ops->enable(isi, &fd, fmt, port);
cf21f328fcafac Laurent Pinchart 2019-01-21 66 return 0;
cf21f328fcafac Laurent Pinchart 2019-01-21 67 }
cf21f328fcafac Laurent Pinchart 2019-01-21 68 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Sakari Ailus
maintainerPATCH 4/6 media: v4l: subdev: v4l2_subdev_get_format always returns format now
In reply to Sakari AilusNow that v4l2_subdev_get_format() always returns format, don't call alternative v4l2_subdev_get_pad_format() anymore.
--- drivers/media/v4l2-core/v4l2-subdev.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/media/v4l2-core/v4l2-subdev.c +1 -8
@@ -1580,14 +1580,7 @@ int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, {struct v4l2_mbus_framefmt *fmt; -if (sd->flags &V4L2_SUBDEV_FL_STREAMS ) - fmt =v4l2_subdev_get_format (state, format->pad, - format->stream); -else if (format->pad < sd->entity.num_pads && format->stream ==0 ) - fmt =v4l2_subdev_get_pad_format (sd, state, format->pad); -else - fmt =NULL ; - + fmt =v4l2_subdev_get_format (state, format->pad, format->stream);if (!fmt)return -EINVAL ;
Signature · 1 line
2.39.2
Re: [PATCH 4/6] media: v4l: subdev: v4l2_subdev_get_format always returns format now
Hi Sakari,
Thank you for the patch.
Quoted 4 lines · Sakari Ailus
Now that
v4l2_subdev_get_format()always returns format, don't call alternativev4l2_subdev_get_pad_format()anymore.Signed-off-by Sakari Ailus <[email protected]>
Assuming we go forward for 2/6, this patch looks fine.
Quoted 24 lines
--- drivers/media/v4l2-core/v4l2-subdev.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)drivers/media/v4l2-core/v4l2-subdev.c +1
-8@@ -1580,14 +1580,7 @@ int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, {struct v4l2_mbus_framefmt *fmt; -if (sd->flags &V4L2_SUBDEV_FL_STREAMS ) - fmt =v4l2_subdev_get_format (state, format->pad, - format->stream); -else if (format->pad < sd->entity.num_pads && format->stream ==0 ) - fmt =v4l2_subdev_get_pad_format (sd, state, format->pad); -else - fmt =NULL ; - + fmt =v4l2_subdev_get_format (state, format->pad, format->stream);if (!fmt)return -EINVAL ;
Signature · 3 lines
Regards, Laurent Pinchart
Sakari Ailus
maintainerPATCH 5/6 media: v4l: subdev: Switch to stream-aware state functions
In reply to Sakari AilusSwitch all drivers accessing sub-device state to use the stream-aware functions. We will soon remove the old ones.
This patch has been generated using the following Coccinelle script:
---------8<------------
@@
expression E1, E2, E3;
@@
- v4l2_subdev_get_pad_format(E1, E2, E3)
+ v4l2_subdev_get_format(E2, E3, 0)
@@
expression E1, E2, E3;
@@
- v4l2_subdev_get_pad_crop(E1, E2, E3)
+ v4l2_subdev_get_crop(E2, E3, 0)
@@
expression E1, E2, E3;
@@
- v4l2_subdev_get_pad_compose(E1, E2, E3)
+ v4l2_subdev_get_compose(E2, E3, 0)
@@
expression E1, E2, E3;
@@
- v4l2_subdev_get_try_format(E1, E2, E3)
+ v4l2_subdev_get_format(E1, E2, E3)
@@
expression E1, E2, E3;
@@
- v4l2_subdev_get_try_crop(E1, E2, E3)
+ v4l2_subdev_get_crop(E1, E2, E3)
@@
expression E1, E2, E3;
@@
- v4l2_subdev_get_try_compose(E1, E2, E3)
+ v4l2_subdev_get_compose(E1, E2, E3)
---------8<------------
Additionally drivers/media/i2c/s5k5baf.c and drivers/media/platform/samsung/s3c-camif/camif-capture.c have been manually changed as Coccinelle didn't. Further local variables have been removed as they became unused as a result of the other changes.
--- drivers/media/i2c/adv7180.c | 4 +- drivers/media/i2c/adv748x/adv748x-afe.c | 6 +- drivers/media/i2c/adv748x/adv748x-csi2.c | 2 +- drivers/media/i2c/adv748x/adv748x-hdmi.c | 6 +- drivers/media/i2c/adv7511-v4l2.c | 4 +- drivers/media/i2c/adv7604.c | 4 +- drivers/media/i2c/adv7842.c | 4 +- drivers/media/i2c/ar0521.c | 5 +- drivers/media/i2c/ccs/ccs-core.c | 21 ++-- drivers/media/i2c/et8ek8/et8ek8_driver.c | 3 +- drivers/media/i2c/hi556.c | 12 +- drivers/media/i2c/hi846.c | 11 +- drivers/media/i2c/hi847.c | 8 +- drivers/media/i2c/imx208.c | 8 +- drivers/media/i2c/imx214.c | 4 +- drivers/media/i2c/imx219.c | 12 +- drivers/media/i2c/imx258.c | 8 +- drivers/media/i2c/imx290.c | 8 +- drivers/media/i2c/imx296.c | 18 +-- drivers/media/i2c/imx319.c | 7 +- drivers/media/i2c/imx334.c | 4 +- drivers/media/i2c/imx335.c | 4 +- drivers/media/i2c/imx355.c | 7 +- drivers/media/i2c/imx412.c | 4 +- drivers/media/i2c/imx415.c | 6 +- drivers/media/i2c/isl7998x.c | 6 +- drivers/media/i2c/max9286.c | 4 +- drivers/media/i2c/mt9m001.c | 4 +- drivers/media/i2c/mt9m111.c | 4 +- drivers/media/i2c/mt9m114.c | 58 +++++----- drivers/media/i2c/mt9p031.c | 6 +- drivers/media/i2c/mt9v032.c | 10 +- drivers/media/i2c/mt9v111.c | 2 +- drivers/media/i2c/og01a1b.c | 9 +- drivers/media/i2c/ov01a10.c | 2 +- drivers/media/i2c/ov02a10.c | 5 +- drivers/media/i2c/ov08d10.c | 8 +- drivers/media/i2c/ov08x40.c | 7 +- drivers/media/i2c/ov13858.c | 10 +- drivers/media/i2c/ov13b10.c | 10 +- drivers/media/i2c/ov2640.c | 4 +- drivers/media/i2c/ov2659.c | 6 +- drivers/media/i2c/ov2680.c | 6 +- drivers/media/i2c/ov2685.c | 4 +- drivers/media/i2c/ov2740.c | 4 +- drivers/media/i2c/ov4689.c | 2 +- drivers/media/i2c/ov5640.c | 9 +- drivers/media/i2c/ov5645.c | 4 +- drivers/media/i2c/ov5647.c | 12 +- drivers/media/i2c/ov5648.c | 6 +- drivers/media/i2c/ov5670.c | 12 +- drivers/media/i2c/ov5675.c | 8 +- drivers/media/i2c/ov5693.c | 4 +- drivers/media/i2c/ov5695.c | 7 +- drivers/media/i2c/ov7251.c | 4 +- drivers/media/i2c/ov7670.c | 7 +- drivers/media/i2c/ov7740.c | 7 +- drivers/media/i2c/ov8856.c | 8 +- drivers/media/i2c/ov8858.c | 6 +- drivers/media/i2c/ov8865.c | 8 +- drivers/media/i2c/ov9282.c | 6 +- drivers/media/i2c/ov9650.c | 7 +- drivers/media/i2c/ov9734.c | 8 +- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 35 +++--- drivers/media/i2c/s5k5baf.c | 30 +++-- drivers/media/i2c/s5k6a3.c | 8 +- drivers/media/i2c/st-mipid02.c | 11 +- drivers/media/i2c/st-vgxy61.c | 5 +- drivers/media/i2c/tc358746.c | 12 +- drivers/media/i2c/tda1997x.c | 6 +- drivers/media/i2c/tvp5150.c | 2 +- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 9 +- drivers/media/pci/intel/ivsc/mei_csi.c | 4 +- drivers/media/platform/cadence/cdns-csi2rx.c | 4 +- drivers/media/platform/cadence/cdns-csi2tx.c | 3 +- .../platform/microchip/microchip-csi2dc.c | 15 ++- .../platform/microchip/microchip-isc-scaler.c | 17 +-- drivers/media/platform/nxp/imx-mipi-csis.c | 10 +- drivers/media/platform/nxp/imx7-media-csi.c | 15 ++- .../platform/nxp/imx8-isi/imx8-isi-pipe.c | 18 +-- .../platform/nxp/imx8-isi/imx8-isi-video.c | 2 +- drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 12 +- .../media/platform/qcom/camss/camss-csid.c | 3 +- .../media/platform/qcom/camss/camss-csiphy.c | 3 +- .../media/platform/qcom/camss/camss-ispif.c | 3 +- drivers/media/platform/qcom/camss/camss-vfe.c | 9 +- drivers/media/platform/renesas/rcar-isp.c | 4 +- .../platform/renesas/rcar-vin/rcar-csi2.c | 4 +- .../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 6 +- .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 6 +- .../media/platform/renesas/vsp1/vsp1_brx.c | 2 +- .../media/platform/renesas/vsp1/vsp1_entity.c | 8 +- .../media/platform/renesas/vsp1/vsp1_rwpf.c | 3 +- .../platform/rockchip/rkisp1/rkisp1-csi.c | 16 ++- .../platform/rockchip/rkisp1/rkisp1-isp.c | 103 +++++++++--------- .../platform/rockchip/rkisp1/rkisp1-resizer.c | 53 ++++----- .../samsung/exynos4-is/fimc-capture.c | 12 +- .../platform/samsung/exynos4-is/fimc-isp.c | 23 ++-- .../platform/samsung/exynos4-is/fimc-lite.c | 17 ++- .../platform/samsung/exynos4-is/mipi-csis.c | 3 +- .../samsung/s3c-camif/camif-capture.c | 8 +- .../platform/sunxi/sun4i-csi/sun4i_v4l2.c | 8 +- .../sunxi/sun6i-csi/sun6i_csi_bridge.c | 7 +- .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 7 +- .../sun8i_a83t_mipi_csi2.c | 7 +- drivers/media/platform/ti/cal/cal-camerarx.c | 13 +-- drivers/media/platform/ti/cal/cal-video.c | 2 +- drivers/media/platform/ti/omap3isp/ispccdc.c | 6 +- drivers/media/platform/ti/omap3isp/ispccp2.c | 3 +- drivers/media/platform/ti/omap3isp/ispcsi2.c | 3 +- .../media/platform/ti/omap3isp/isppreview.c | 6 +- .../media/platform/ti/omap3isp/ispresizer.c | 5 +- drivers/media/platform/video-mux.c | 18 +-- .../media/platform/xilinx/xilinx-csi2rxss.c | 5 +- drivers/media/platform/xilinx/xilinx-tpg.c | 9 +- drivers/media/platform/xilinx/xilinx-vip.c | 4 +- .../media/test-drivers/vimc/vimc-debayer.c | 10 +- drivers/media/test-drivers/vimc/vimc-scaler.c | 9 +- drivers/media/test-drivers/vimc/vimc-sensor.c | 6 +- .../media/atomisp/i2c/atomisp-gc0310.c | 2 +- .../staging/media/atomisp/pci/atomisp_csi2.c | 3 +- .../media/atomisp/pci/atomisp_subdev.c | 6 +- drivers/staging/media/imx/imx-ic-prp.c | 2 +- drivers/staging/media/imx/imx-ic-prpencvf.c | 2 +- drivers/staging/media/imx/imx-media-csi.c | 8 +- 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 | 14 +-- drivers/staging/media/omap4iss/iss_csi2.c | 3 +- drivers/staging/media/omap4iss/iss_ipipe.c | 3 +- drivers/staging/media/omap4iss/iss_ipipeif.c | 3 +- drivers/staging/media/omap4iss/iss_resizer.c | 3 +- .../media/sunxi/sun6i-isp/sun6i_isp_proc.c | 7 +- include/media/v4l2-subdev.h | 6 +- 135 files changed, 530 insertions(+), 644 deletions(-)
drivers/media/i2c/adv7180.c +2 -2
@@ -769,7 +769,7 @@ static int adv7180_get_pad_format(struct v4l2_subdev *sd,struct adv7180_state *state =to_state (sd);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - format->format = *v4l2_subdev_get_try_format (sd, sd_state,0 ); + format->format = *v4l2_subdev_get_format (sd_state,0 ,0 ); }else {adv7180_mbus_fmt (sd, &format->format); format->format.field = state->field;
@@ -806,7 +806,7 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,adv7180_set_power (state, true); } }else { - framefmt =v4l2_subdev_get_try_format (sd, sd_state,0 ); + framefmt =v4l2_subdev_get_format (sd_state,0 ,0 ); *framefmt = format->format; }
drivers/media/i2c/adv748x/adv748x-afe.c +3 -3
@@ -354,8 +354,8 @@ static int adv748x_afe_get_format(struct v4l2_subdev *sd,return -EINVAL ;if (sdformat->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mbusformat =v4l2_subdev_get_try_format (sd, sd_state, - sdformat->pad); + mbusformat =v4l2_subdev_get_format (sd_state, sdformat->pad, +0 ); sdformat->format = *mbusformat; }else {adv748x_afe_fill_format (afe, &sdformat->format);
@@ -378,7 +378,7 @@ static int adv748x_afe_set_format(struct v4l2_subdev *sd,if (sdformat->which ==V4L2_SUBDEV_FORMAT_ACTIVE )return adv748x_afe_get_format (sd, sd_state, sdformat); - mbusformat =v4l2_subdev_get_try_format (sd, sd_state, sdformat->pad); + mbusformat =v4l2_subdev_get_format (sd_state, sdformat->pad,0 ); *mbusformat = sdformat->format;return 0 ;
drivers/media/i2c/adv748x/adv748x-csi2.c +1 -1
@@ -147,7 +147,7 @@ adv748x_csi2_get_pad_format(struct v4l2_subdev *sd,struct adv748x_csi2 *tx =adv748x_sd_to_csi2 (sd);if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return v4l2_subdev_get_try_format (sd, sd_state, pad); +return v4l2_subdev_get_format (sd_state, pad,0 );return &tx->format; }
drivers/media/i2c/adv748x/adv748x-hdmi.c +3 -3
@@ -441,8 +441,8 @@ static int adv748x_hdmi_get_format(struct v4l2_subdev *sd,return -EINVAL ;if (sdformat->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mbusformat =v4l2_subdev_get_try_format (sd, sd_state, - sdformat->pad); + mbusformat =v4l2_subdev_get_format (sd_state, sdformat->pad, +0 ); sdformat->format = *mbusformat; }else {adv748x_hdmi_fill_format (hdmi, &sdformat->format);
@@ -464,7 +464,7 @@ static int adv748x_hdmi_set_format(struct v4l2_subdev *sd,if (sdformat->which ==V4L2_SUBDEV_FORMAT_ACTIVE )return adv748x_hdmi_get_format (sd, sd_state, sdformat); - mbusformat =v4l2_subdev_get_try_format (sd, sd_state, sdformat->pad); + mbusformat =v4l2_subdev_get_format (sd_state, sdformat->pad,0 ); *mbusformat = sdformat->format;return 0 ;
drivers/media/i2c/adv7511-v4l2.c +2 -2
@@ -1238,7 +1238,7 @@ static int adv7511_get_fmt(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *fmt; - fmt =v4l2_subdev_get_try_format (sd, sd_state, format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 ); format->format.code = fmt->code; format->format.colorspace = fmt->colorspace; format->format.ycbcr_enc = fmt->ycbcr_enc;
@@ -1293,7 +1293,7 @@ static int adv7511_set_fmt(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *fmt; - fmt =v4l2_subdev_get_try_format (sd, sd_state, format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 ); fmt->code = format->format.code; fmt->colorspace = format->format.colorspace; fmt->ycbcr_enc = format->format.ycbcr_enc;
drivers/media/i2c/adv7604.c +2 -2
@@ -1929,7 +1929,7 @@ static int adv76xx_get_format(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *fmt; - fmt =v4l2_subdev_get_try_format (sd, sd_state, format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 ); format->format.code = fmt->code; }else { format->format.code = state->format->code;
@@ -1978,7 +1978,7 @@ static int adv76xx_set_format(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *fmt; - fmt =v4l2_subdev_get_try_format (sd, sd_state, format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 ); fmt->code = format->format.code; }else { state->format = info;
drivers/media/i2c/adv7842.c +2 -2
@@ -2087,7 +2087,7 @@ static int adv7842_get_format(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *fmt; - fmt =v4l2_subdev_get_try_format (sd, sd_state, format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 ); format->format.code = fmt->code; }else { format->format.code = state->format->code;
@@ -2119,7 +2119,7 @@ static int adv7842_set_format(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *fmt; - fmt =v4l2_subdev_get_try_format (sd, sd_state, format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 ); fmt->code = format->format.code; }else { state->format = info;
drivers/media/i2c/ar0521.c +2 -3
@@ -446,8 +446,7 @@ static int ar0521_get_fmt(struct v4l2_subdev *sd,mutex_lock (&sensor->lock);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt =v4l2_subdev_get_try_format (&sensor->sd, sd_state,0 -/* pad */ ); + fmt =v4l2_subdev_get_format (sd_state,0 ,0 );else fmt = &sensor->fmt;
@@ -472,7 +471,7 @@ static int ar0521_set_fmt(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *fmt; - fmt =v4l2_subdev_get_try_format (sd, sd_state,0 /* pad */ ); + fmt =v4l2_subdev_get_format (sd_state,0 ,0 ); *fmt = format->format;mutex_unlock (&sensor->lock);
drivers/media/i2c/ccs/ccs-core.c +10 -11
@@ -2030,7 +2030,7 @@ static int __ccs_get_format(struct v4l2_subdev *subdev,struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { - fmt->format = *v4l2_subdev_get_pad_format(subdev, sd_state, fmt->pad); + fmt->format = *v4l2_subdev_get_format(sd_state, fmt->pad, 0); fmt->format.code =__ccs_get_mbus_code (subdev, fmt->pad);return 0 ;
@@ -2061,10 +2061,9 @@ static void ccs_get_crop_compose(struct v4l2_subdev *subdev,if (crops)for (i =0 ; i < subdev->entity.num_pads; i++) crops[i] = -v4l2_subdev_get_pad_crop (subdev, sd_state, i); +v4l2_subdev_get_crop (sd_state, i,0 );if (comps) - *comps =v4l2_subdev_get_pad_compose (subdev, sd_state, - ssd->sink_pad); + *comps =v4l2_subdev_get_compose (sd_state, ssd->sink_pad,0 ); }/* Changes require propagation only on sink pad. */
@@ -2097,7 +2096,7 @@ static void ccs_propagate(struct v4l2_subdev *subdev, fallthrough;case V4L2_SEL_TGT_COMPOSE : *crops[CCS_PAD_SRC ] = *comp; - fmt =v4l2_subdev_get_pad_format (subdev, sd_state,CCS_PAD_SRC ); + fmt =v4l2_subdev_get_format (sd_state,CCS_PAD_SRC ,0 ); fmt->width = comp->width; fmt->height = comp->height;if (which ==V4L2_SUBDEV_FORMAT_ACTIVE && ssd == sensor->src)
@@ -2507,7 +2506,7 @@ static int ccs_set_crop(struct v4l2_subdev *subdev,if (sel->pad == ssd->sink_pad) {struct v4l2_mbus_framefmt *mfmt = -v4l2_subdev_get_pad_format (subdev, sd_state, sel->pad); +v4l2_subdev_get_format (sd_state, sel->pad,0 ); src_size.width = mfmt->width; src_size.height = mfmt->height;
@@ -2567,8 +2566,8 @@ static int ccs_get_selection(struct v4l2_subdev *subdev,ccs_get_native_size (ssd, &sel->r); }else if (sel->pad == ssd->sink_pad) {struct v4l2_mbus_framefmt *sink_fmt = -v4l2_subdev_get_pad_format (subdev, sd_state, - ssd->sink_pad); +v4l2_subdev_get_format (sd_state, + ssd->sink_pad,0 ); sel->r.top = sel->r.left =0 ; sel->r.width = sink_fmt->width; sel->r.height = sink_fmt->height;
@@ -3012,9 +3011,9 @@ static int ccs_init_cfg(struct v4l2_subdev *sd,unsigned int pad = ssd == sensor->pixel_array ?CCS_PA_PAD_SRC :CCS_PAD_SINK ;struct v4l2_mbus_framefmt *fmt = -v4l2_subdev_get_pad_format (sd, sd_state, pad); +v4l2_subdev_get_format (sd_state, pad,0 );struct v4l2_rect *crop = -v4l2_subdev_get_pad_crop (sd, sd_state, pad); +v4l2_subdev_get_crop (sd_state, pad,0 );bool is_active = !sd->active_state || sd->active_state == sd_state;mutex_lock (&sensor->mutex);
@@ -3034,7 +3033,7 @@ static int ccs_init_cfg(struct v4l2_subdev *sd,return 0 ; } - fmt =v4l2_subdev_get_pad_format (sd, sd_state,CCS_PAD_SRC ); + fmt =v4l2_subdev_get_format (sd_state,CCS_PAD_SRC ,0 ); fmt->code = ssd == sensor->src ? sensor->csi_format->code : sensor->internal_csi_format->code; fmt->field =V4L2_FIELD_NONE ;
drivers/media/i2c/et8ek8/et8ek8_driver.c +1 -2
@@ -995,8 +995,7 @@ __et8ek8_get_pad_format(struct et8ek8_sensor *sensor, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_format (&sensor->subdev, sd_state, - pad); +return v4l2_subdev_get_format (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &sensor->format;default :
drivers/media/i2c/hi556.c +5 -7
@@ -935,7 +935,7 @@ __hi556_get_pad_crop(struct hi556 *hi556, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&hi556->sd, sd_state, pad); +return v4l2_subdev_get_crop (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &hi556->cur_mode->crop; }
@@ -1075,7 +1075,7 @@ static int hi556_set_format(struct v4l2_subdev *sd,mutex_lock (&hi556->mutex);hi556_assign_pad_format (mode, &fmt->format);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad) = fmt->format; + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format; }else { hi556->cur_mode = mode;__v4l2_ctrl_s_ctrl (hi556->link_freq, mode->link_freq_index);
@@ -1109,9 +1109,7 @@ static int hi556_get_format(struct v4l2_subdev *sd,mutex_lock (&hi556->mutex);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (&hi556->sd, - sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else hi556_assign_pad_format (hi556->cur_mode, &fmt->format);
@@ -1157,10 +1155,10 @@ static int hi556_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)mutex_lock (&hi556->mutex);hi556_assign_pad_format (&supported_modes[0 ], -v4l2_subdev_get_try_format (sd, fh->state,0 )); +v4l2_subdev_get_format (fh->state,0 ,0 ));/* Initialize try_crop rectangle. */ - try_crop =v4l2_subdev_get_try_crop (sd, fh->state,0 ); + try_crop =v4l2_subdev_get_crop (fh->state,0 ,0 ); try_crop->top =HI556_PIXEL_ARRAY_TOP ; try_crop->left =HI556_PIXEL_ARRAY_LEFT ; try_crop->width =HI556_PIXEL_ARRAY_WIDTH ;
drivers/media/i2c/hi846.c +5 -6
@@ -1705,7 +1705,7 @@ static int hi846_set_format(struct v4l2_subdev *sd, }if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, format->pad) = *mf; + *v4l2_subdev_get_format (sd_state, format->pad,0 ) = *mf;return 0 ; }
@@ -1783,9 +1783,8 @@ static int hi846_get_format(struct v4l2_subdev *sd,struct i2c_client *client =v4l2_get_subdevdata (sd);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - format->format = *v4l2_subdev_get_try_format (&hi846->sd, - sd_state, - format->pad); + format->format = *v4l2_subdev_get_format (sd_state, + format->pad,0 );return 0 ; }
@@ -1852,7 +1851,7 @@ static int hi846_get_selection(struct v4l2_subdev *sd,mutex_lock (&hi846->mutex);switch (sel->which) {case V4L2_SUBDEV_FORMAT_TRY : -v4l2_subdev_get_try_crop (sd, sd_state, sel->pad); +v4l2_subdev_get_crop (sd_state, sel->pad,0 );break ;case V4L2_SUBDEV_FORMAT_ACTIVE : sel->r = hi846->cur_mode->crop;
@@ -1878,7 +1877,7 @@ static int hi846_init_cfg(struct v4l2_subdev *sd,struct hi846 *hi846 =to_hi846 (sd);struct v4l2_mbus_framefmt *mf; - mf =v4l2_subdev_get_try_format (sd, sd_state,0 ); + mf =v4l2_subdev_get_format (sd_state,0 ,0 );mutex_lock (&hi846->mutex); mf->code =HI846_MEDIA_BUS_FORMAT ;
drivers/media/i2c/hi847.c +3 -5
@@ -2655,7 +2655,7 @@ static int hi847_set_format(struct v4l2_subdev *sd,mutex_lock (&hi847->mutex);hi847_assign_pad_format (mode, &fmt->format);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad) = + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format; }else { hi847->cur_mode = mode;
@@ -2690,9 +2690,7 @@ static int hi847_get_format(struct v4l2_subdev *sd,mutex_lock (&hi847->mutex);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (&hi847->sd, - sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else hi847_assign_pad_format (hi847->cur_mode, &fmt->format);
@@ -2737,7 +2735,7 @@ static int hi847_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)mutex_lock (&hi847->mutex);hi847_assign_pad_format (&supported_modes[0 ], -v4l2_subdev_get_try_format (sd, fh->state,0 )); +v4l2_subdev_get_format (fh->state,0 ,0 ));mutex_unlock (&hi847->mutex);return 0 ;
drivers/media/i2c/imx208.c +3 -5
@@ -395,7 +395,7 @@ static int imx208_write_regs(struct imx208 *imx208,static int imx208_open (struct v4l2_subdev *sd,struct v4l2_subdev_fh *fh) {struct v4l2_mbus_framefmt *try_fmt = -v4l2_subdev_get_try_format (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 );/* Initialize try_fmt */ try_fmt->width = supported_modes[0 ].width;
@@ -548,9 +548,7 @@ static int __imx208_get_pad_format(struct imx208 *imx208, struct v4l2_subdev_format *fmt) {if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (&imx208->sd, - sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else imx208_mode_to_pad_format (imx208, imx208->cur_mode, fmt);
@@ -591,7 +589,7 @@ static int imx208_set_pad_format(struct v4l2_subdev *sd, fmt->format.width, fmt->format.height);imx208_mode_to_pad_format (imx208, mode, fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad) = fmt->format; + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format; }else { imx208->cur_mode = mode;__v4l2_ctrl_s_ctrl (imx208->link_freq, mode->link_freq_index);
drivers/media/i2c/imx214.c +2 -2
@@ -538,7 +538,7 @@ __imx214_get_pad_format(struct imx214 *imx214, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_format (&imx214->sd, sd_state, pad); +return v4l2_subdev_get_format (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &imx214->fmt;default :
@@ -568,7 +568,7 @@ __imx214_get_pad_crop(struct imx214 *imx214, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&imx214->sd, sd_state, pad); +return v4l2_subdev_get_crop (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &imx214->crop;default :
drivers/media/i2c/imx219.c +6 -6
@@ -374,7 +374,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl)int ret =0 ; state =v4l2_subdev_get_locked_active_state (&imx219->sd); - format =v4l2_subdev_get_pad_format (&imx219->sd, state,0 ); + format =v4l2_subdev_get_format (state,0 ,0 );if (ctrl->id ==V4L2_CID_VBLANK ) {int exposure_max, exposure_def;
@@ -593,8 +593,8 @@ static int imx219_set_framefmt(struct imx219 *imx219,u64 bin_h, bin_v;int ret =0 ; - format =v4l2_subdev_get_pad_format (&imx219->sd, state,0 ); - crop =v4l2_subdev_get_pad_crop (&imx219->sd, state,0 ); + format =v4l2_subdev_get_format (state,0 ,0 ); + crop =v4l2_subdev_get_crop (state,0 ,0 );switch (format->code) {case MEDIA_BUS_FMT_SRGGB8_1X8 :
@@ -826,7 +826,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,imx219_update_pad_format (imx219, mode, &fmt->format, fmt->format.code); - format =v4l2_subdev_get_pad_format (sd, state,0 ); + format =v4l2_subdev_get_format (state,0 ,0 ); *format = fmt->format;/*
@@ -836,7 +836,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, bin_h =min (IMX219_PIXEL_ARRAY_WIDTH / format->width,2U ); bin_v =min (IMX219_PIXEL_ARRAY_HEIGHT / format->height,2U ); - crop =v4l2_subdev_get_pad_crop (sd, state,0 ); + crop =v4l2_subdev_get_crop (state,0 ,0 ); crop->width = format->width * bin_h; crop->height = format->height * bin_v; crop->left = (IMX219_NATIVE_WIDTH - crop->width) /2 ;
@@ -880,7 +880,7 @@ static int imx219_get_selection(struct v4l2_subdev *sd, {switch (sel->target) {case V4L2_SEL_TGT_CROP : { - sel->r = *v4l2_subdev_get_pad_crop (sd, state,0 ); + sel->r = *v4l2_subdev_get_crop (state,0 ,0 );return 0 ; }
drivers/media/i2c/imx258.c +3 -5
@@ -708,7 +708,7 @@ static int imx258_write_regs(struct imx258 *imx258,static int imx258_open (struct v4l2_subdev *sd,struct v4l2_subdev_fh *fh) {struct v4l2_mbus_framefmt *try_fmt = -v4l2_subdev_get_try_format (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 );/* Initialize try_fmt */ try_fmt->width = supported_modes[0 ].width;
@@ -862,9 +862,7 @@ static int __imx258_get_pad_format(struct imx258 *imx258, struct v4l2_subdev_format *fmt) {if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (&imx258->sd, - sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else imx258_update_pad_format (imx258->cur_mode, fmt);
@@ -908,7 +906,7 @@ static int imx258_set_pad_format(struct v4l2_subdev *sd, fmt->format.width, fmt->format.height);imx258_update_pad_format (mode, fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *framefmt = fmt->format; }else { imx258->cur_mode = mode;
drivers/media/i2c/imx290.c +4 -4
@@ -758,7 +758,7 @@ static int imx290_set_ctrl(struct v4l2_ctrl *ctrl)return 0 ; state =v4l2_subdev_get_locked_active_state (&imx290->sd); - format =v4l2_subdev_get_pad_format (&imx290->sd, state,0 ); + format =v4l2_subdev_get_format (state,0 ,0 );switch (ctrl->id) {case V4L2_CID_ANALOGUE_GAIN :
@@ -994,7 +994,7 @@ static int imx290_start_streaming(struct imx290 *imx290, }/* Apply the register values related to current frame format */ - format =v4l2_subdev_get_pad_format (&imx290->sd, state,0 ); + format =v4l2_subdev_get_format (state,0 ,0 ); ret =imx290_setup_format (imx290, format);if (ret <0 ) {dev_err (imx290->dev,"Could not set frame format - %d\n" , ret);
@@ -1132,7 +1132,7 @@ static int imx290_set_fmt(struct v4l2_subdev *sd, fmt->format.quantization =V4L2_QUANTIZATION_FULL_RANGE ; fmt->format.xfer_func =V4L2_XFER_FUNC_NONE ; - format =v4l2_subdev_get_pad_format (sd, sd_state,0 ); + format =v4l2_subdev_get_format (sd_state,0 ,0 );if (fmt->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) { imx290->current_mode = mode;
@@ -1155,7 +1155,7 @@ static int imx290_get_selection(struct v4l2_subdev *sd,switch (sel->target) {case V4L2_SEL_TGT_CROP : { - format =v4l2_subdev_get_pad_format (sd, sd_state,0 ); + format =v4l2_subdev_get_format (sd_state,0 ,0 );/* * The sensor moves the readout by 1 pixel based on flips to
drivers/media/i2c/imx296.c +9 -9
@@ -323,7 +323,7 @@ static int imx296_s_ctrl(struct v4l2_ctrl *ctrl)return 0 ; state =v4l2_subdev_get_locked_active_state (&sensor->subdev); - format =v4l2_subdev_get_pad_format (&sensor->subdev, state,0 ); + format =v4l2_subdev_get_format (state,0 ,0 );switch (ctrl->id) {case V4L2_CID_EXPOSURE :
@@ -511,8 +511,8 @@ static int imx296_setup(struct imx296 *sensor, struct v4l2_subdev_state *state)unsigned int i;int ret =0 ; - format =v4l2_subdev_get_pad_format (&sensor->subdev, state,0 ); - crop =v4l2_subdev_get_pad_crop (&sensor->subdev, state,0 ); + format =v4l2_subdev_get_format (state,0 ,0 ); + crop =v4l2_subdev_get_crop (state,0 ,0 );for (i =0 ; i <ARRAY_SIZE (imx296_init_table); ++i) imx296_write(sensor, imx296_init_table[i].reg,
@@ -662,7 +662,7 @@ static int imx296_enum_frame_size(struct v4l2_subdev *sd, {const struct v4l2_mbus_framefmt *format; - format =v4l2_subdev_get_pad_format (sd, state, fse->pad); + format =v4l2_subdev_get_format (state, fse->pad,0 );if (fse->index >=2 || fse->code != format->code)return -EINVAL ;
@@ -683,8 +683,8 @@ static int imx296_set_format(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *format;struct v4l2_rect *crop; - crop =v4l2_subdev_get_pad_crop (sd, state, fmt->pad); - format =v4l2_subdev_get_pad_format (sd, state, fmt->pad); + crop =v4l2_subdev_get_crop (state, fmt->pad,0 ); + format =v4l2_subdev_get_format (state, fmt->pad,0 );/* * Binning is only allowed when cropping is disabled according to the
@@ -732,7 +732,7 @@ static int imx296_get_selection(struct v4l2_subdev *sd, {switch (sel->target) {case V4L2_SEL_TGT_CROP : - sel->r = *v4l2_subdev_get_pad_crop (sd, state, sel->pad); + sel->r = *v4l2_subdev_get_crop (state, sel->pad,0 );break ;case V4L2_SEL_TGT_CROP_DEFAULT :
@@ -780,14 +780,14 @@ static int imx296_set_selection(struct v4l2_subdev *sd, rect.height = min_t(unsigned int, rect.height,IMX296_PIXEL_ARRAY_HEIGHT - rect.top); - crop =v4l2_subdev_get_pad_crop (sd, state, sel->pad); + crop =v4l2_subdev_get_crop (state, sel->pad,0 );if (rect.width != crop->width || rect.height != crop->height) {/* * Reset the output image size if the crop rectangle size has * been modified. */ - format =v4l2_subdev_get_pad_format (sd, state, sel->pad); + format =v4l2_subdev_get_format (state, sel->pad,0 ); format->width = rect.width; format->height = rect.height; }
drivers/media/i2c/imx319.c +3 -4
@@ -1860,7 +1860,7 @@ static int imx319_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) {struct imx319 *imx319 =to_imx319 (sd);struct v4l2_mbus_framefmt *try_fmt = -v4l2_subdev_get_try_format (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 );mutex_lock (&imx319->mutex);
@@ -2001,10 +2001,9 @@ static int imx319_do_get_pad_format(struct imx319 *imx319, struct v4l2_subdev_format *fmt) {struct v4l2_mbus_framefmt *framefmt; -struct v4l2_subdev *sd = &imx319->sd;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *framefmt; }else {imx319_update_pad_format (imx319, imx319->cur_mode, fmt);
@@ -2055,7 +2054,7 @@ imx319_set_pad_format(struct v4l2_subdev *sd, fmt->format.width, fmt->format.height);imx319_update_pad_format (imx319, mode, fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *framefmt = fmt->format; }else { imx319->cur_mode = mode;
drivers/media/i2c/imx334.c +2 -2
@@ -879,7 +879,7 @@ static int imx334_get_pad_format(struct v4l2_subdev *sd,if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *framefmt; - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *framefmt; }else { fmt->format.code = imx334->cur_code;
@@ -920,7 +920,7 @@ static int imx334_set_pad_format(struct v4l2_subdev *sd,if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *framefmt; - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *framefmt = fmt->format; }else if (imx334->cur_mode != mode || imx334->cur_code != fmt->format.code) { imx334->cur_code = fmt->format.code;
drivers/media/i2c/imx335.c +2 -2
@@ -569,7 +569,7 @@ static int imx335_get_pad_format(struct v4l2_subdev *sd,if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *framefmt; - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *framefmt; }else {imx335_fill_pad_format (imx335, imx335->cur_mode, fmt);
@@ -604,7 +604,7 @@ static int imx335_set_pad_format(struct v4l2_subdev *sd,if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *framefmt; - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *framefmt = fmt->format; }else { ret =imx335_update_controls (imx335, mode);
drivers/media/i2c/imx355.c +3 -4
@@ -1158,7 +1158,7 @@ static int imx355_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) {struct imx355 *imx355 =to_imx355 (sd);struct v4l2_mbus_framefmt *try_fmt = -v4l2_subdev_get_try_format (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 );mutex_lock (&imx355->mutex);
@@ -1299,10 +1299,9 @@ static int imx355_do_get_pad_format(struct imx355 *imx355, struct v4l2_subdev_format *fmt) {struct v4l2_mbus_framefmt *framefmt; -struct v4l2_subdev *sd = &imx355->sd;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *framefmt; }else {imx355_update_pad_format (imx355, imx355->cur_mode, fmt);
@@ -1353,7 +1352,7 @@ imx355_set_pad_format(struct v4l2_subdev *sd, fmt->format.width, fmt->format.height);imx355_update_pad_format (imx355, mode, fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *framefmt = fmt->format; }else { imx355->cur_mode = mode;
drivers/media/i2c/imx412.c +2 -2
@@ -721,7 +721,7 @@ static int imx412_get_pad_format(struct v4l2_subdev *sd,if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *framefmt; - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *framefmt; }else {imx412_fill_pad_format (imx412, imx412->cur_mode, fmt);
@@ -756,7 +756,7 @@ static int imx412_set_pad_format(struct v4l2_subdev *sd,if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *framefmt; - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *framefmt = fmt->format; }else { ret =imx412_update_controls (imx412, mode);
drivers/media/i2c/imx415.c +3 -3
@@ -546,7 +546,7 @@ static int imx415_s_ctrl(struct v4l2_ctrl *ctrl)return 0 ; state =v4l2_subdev_get_locked_active_state (&sensor->subdev); - format =v4l2_subdev_get_pad_format (&sensor->subdev, state,0 ); + format =v4l2_subdev_get_format (state,0 ,0 );switch (ctrl->id) {case V4L2_CID_EXPOSURE :
@@ -828,7 +828,7 @@ static int imx415_enum_frame_size(struct v4l2_subdev *sd, {const struct v4l2_mbus_framefmt *format; - format =v4l2_subdev_get_pad_format (sd, state, fse->pad); + format =v4l2_subdev_get_format (state, fse->pad,0 );if (fse->index >0 || fse->code != format->code)return -EINVAL ;
@@ -846,7 +846,7 @@ static int imx415_set_format(struct v4l2_subdev *sd, {struct v4l2_mbus_framefmt *format; - format =v4l2_subdev_get_pad_format (sd, state, fmt->pad); + format =v4l2_subdev_get_format (state, fmt->pad,0 ); format->width = fmt->format.width; format->height = fmt->format.height;
drivers/media/i2c/isl7998x.c +3 -3
@@ -1007,8 +1007,8 @@ static int isl7998x_get_fmt(struct v4l2_subdev *sd,mutex_lock (&isl7998x->lock);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - format->format = *v4l2_subdev_get_try_format (sd, sd_state, - format->pad); + format->format = *v4l2_subdev_get_format (sd_state, + format->pad,0 ); goto out; }
@@ -1044,7 +1044,7 @@ static int isl7998x_set_fmt(struct v4l2_subdev *sd, mf->field = mode->field;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) - *v4l2_subdev_get_try_format (sd, sd_state, format->pad) = format->format; + *v4l2_subdev_get_format (sd_state, format->pad,0 ) = format->format;mutex_unlock (&isl7998x->lock);
drivers/media/i2c/max9286.c +2 -2
@@ -913,7 +913,7 @@ max9286_get_pad_format(struct max9286_priv *priv, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_format (&priv->sd, sd_state, pad); +return v4l2_subdev_get_format (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &priv->fmt[pad];default :
@@ -1020,7 +1020,7 @@ static int max9286_open(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)unsigned int i;for (i =0 ; i <MAX9286_N_SINKS ; i++) { - format =v4l2_subdev_get_try_format (subdev, fh->state, i); + format =v4l2_subdev_get_format (fh->state, i,0 );max9286_init_format (format); }
drivers/media/i2c/mt9m001.c +2 -2
@@ -325,7 +325,7 @@ static int mt9m001_get_fmt(struct v4l2_subdev *sd,return -EINVAL ;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state,0 ); + mf =v4l2_subdev_get_format (sd_state,0 ,0 ); format->format = *mf;return 0 ; }
@@ -656,7 +656,7 @@ static int mt9m001_init_cfg(struct v4l2_subdev *sd,struct i2c_client *client =v4l2_get_subdevdata (sd);struct mt9m001 *mt9m001 =to_mt9m001 (client);struct v4l2_mbus_framefmt *try_fmt = -v4l2_subdev_get_try_format (sd, sd_state,0 ); +v4l2_subdev_get_format (sd_state,0 ,0 ); try_fmt->width =MT9M001_MAX_WIDTH ; try_fmt->height =MT9M001_MAX_HEIGHT ;
drivers/media/i2c/mt9m111.c +2 -2
@@ -525,7 +525,7 @@ static int mt9m111_get_fmt(struct v4l2_subdev *sd,return -EINVAL ;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, format->pad); + mf =v4l2_subdev_get_format (sd_state, format->pad,0 ); format->format = *mf;return 0 ; }
@@ -1115,7 +1115,7 @@ static int mt9m111_init_cfg(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state) {struct v4l2_mbus_framefmt *format = -v4l2_subdev_get_try_format (sd, sd_state,0 ); +v4l2_subdev_get_format (sd_state,0 ,0 ); format->width =MT9M111_MAX_WIDTH ; format->height =MT9M111_MAX_HEIGHT ;
drivers/media/i2c/mt9m114.c +29 -29
186 lines not on this page · raw message
drivers/media/i2c/mt9p031.c +2 -4
@@ -549,8 +549,7 @@ __mt9p031_get_pad_format(struct mt9p031 *mt9p031, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_format (&mt9p031->subdev, sd_state, - pad); +return v4l2_subdev_get_format (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &mt9p031->format;default :
@@ -565,8 +564,7 @@ __mt9p031_get_pad_crop(struct mt9p031 *mt9p031, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&mt9p031->subdev, sd_state, - pad); +return v4l2_subdev_get_crop (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &mt9p031->crop;default :
drivers/media/i2c/mt9v032.c +4 -6
@@ -356,8 +356,7 @@ __mt9v032_get_pad_format(struct mt9v032 *mt9v032, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_format (&mt9v032->subdev, sd_state, - pad); +return v4l2_subdev_get_format (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &mt9v032->format;default :
@@ -372,8 +371,7 @@ __mt9v032_get_pad_crop(struct mt9v032 *mt9v032, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&mt9v032->subdev, sd_state, - pad); +return v4l2_subdev_get_crop (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &mt9v032->crop;default :
@@ -931,13 +929,13 @@ static int mt9v032_open(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)struct v4l2_mbus_framefmt *format;struct v4l2_rect *crop; - crop =v4l2_subdev_get_try_crop (subdev, fh->state,0 ); + crop =v4l2_subdev_get_crop (fh->state,0 ,0 ); crop->left =MT9V032_COLUMN_START_DEF ; crop->top =MT9V032_ROW_START_DEF ; crop->width =MT9V032_WINDOW_WIDTH_DEF ; crop->height =MT9V032_WINDOW_HEIGHT_DEF ; - format =v4l2_subdev_get_try_format (subdev, fh->state,0 ); + format =v4l2_subdev_get_format (fh->state,0 ,0 );if (mt9v032->model->color) format->code =MEDIA_BUS_FMT_SGRBG10_1X10 ;
drivers/media/i2c/mt9v111.c +1 -1
@@ -795,7 +795,7 @@ static struct v4l2_mbus_framefmt *__mt9v111_get_pad_format( {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_format (&mt9v111->sd, sd_state, pad); +return v4l2_subdev_get_format (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &mt9v111->fmt;default :
drivers/media/i2c/og01a1b.c +3 -6
@@ -769,8 +769,7 @@ static int og01a1b_set_format(struct v4l2_subdev *sd,mutex_lock (&og01a1b->mutex);og01a1b_update_pad_format (mode, &fmt->format);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, - fmt->pad) = fmt->format; + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format; }else { og01a1b->cur_mode = mode;__v4l2_ctrl_s_ctrl (og01a1b->link_freq, mode->link_freq_index);
@@ -803,9 +802,7 @@ static int og01a1b_get_format(struct v4l2_subdev *sd,mutex_lock (&og01a1b->mutex);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (&og01a1b->sd, - sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else og01a1b_update_pad_format (og01a1b->cur_mode, &fmt->format);
@@ -850,7 +847,7 @@ static int og01a1b_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)mutex_lock (&og01a1b->mutex);og01a1b_update_pad_format (&supported_modes[0 ], -v4l2_subdev_get_try_format (sd, fh->state,0 )); +v4l2_subdev_get_format (fh->state,0 ,0 ));mutex_unlock (&og01a1b->mutex);return 0 ;
drivers/media/i2c/ov01a10.c +1 -1
@@ -723,7 +723,7 @@ static int ov01a10_set_format(struct v4l2_subdev *sd, h_blank); } - format =v4l2_subdev_get_pad_format (sd, sd_state, fmt->stream); + format =v4l2_subdev_get_format (sd_state, fmt->stream,0 ); *format = fmt->format;return 0 ;
drivers/media/i2c/ov02a10.c +2 -3
@@ -315,7 +315,7 @@ static int ov02a10_set_fmt(struct v4l2_subdev *sd,ov02a10_fill_fmt (ov02a10->cur_mode, mbus_fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - frame_fmt =v4l2_subdev_get_try_format (sd, sd_state,0 ); + frame_fmt =v4l2_subdev_get_format (sd_state,0 ,0 );else frame_fmt = &ov02a10->fmt;
@@ -336,8 +336,7 @@ static int ov02a10_get_fmt(struct v4l2_subdev *sd,mutex_lock (&ov02a10->mutex);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - fmt->format = *v4l2_subdev_get_try_format (sd, sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 ); }else { fmt->format = ov02a10->fmt; mbus_fmt->code = ov02a10->fmt.code;
drivers/media/i2c/ov08d10.c +3 -5
@@ -1145,7 +1145,7 @@ static int ov08d10_set_format(struct v4l2_subdev *sd,mutex_lock (&ov08d10->mutex);ov08d10_update_pad_format (ov08d10, mode, &fmt->format);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad) = + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format; }else { ov08d10->cur_mode = mode;
@@ -1184,9 +1184,7 @@ static int ov08d10_get_format(struct v4l2_subdev *sd,mutex_lock (&ov08d10->mutex);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (&ov08d10->sd, - sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else ov08d10_update_pad_format (ov08d10, ov08d10->cur_mode, &fmt->format);
@@ -1242,7 +1240,7 @@ static int ov08d10_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)mutex_lock (&ov08d10->mutex);ov08d10_update_pad_format (ov08d10, &ov08d10->priv_lane->sp_modes[0 ], -v4l2_subdev_get_try_format (sd, fh->state,0 )); +v4l2_subdev_get_format (fh->state,0 ,0 ));mutex_unlock (&ov08d10->mutex);return 0 ;
drivers/media/i2c/ov08x40.c +3 -4
@@ -2536,7 +2536,7 @@ static int ov08x40_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)const struct ov08x40_mode *default_mode = &supported_modes[0 ];struct ov08x40 *ov08x =to_ov08x40 (sd);struct v4l2_mbus_framefmt *try_fmt = -v4l2_subdev_get_try_format (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 );mutex_lock (&ov08x->mutex);
@@ -2774,10 +2774,9 @@ static int ov08x40_do_get_pad_format(struct ov08x40 *ov08x, struct v4l2_subdev_format *fmt) {struct v4l2_mbus_framefmt *framefmt; -struct v4l2_subdev *sd = &ov08x->sd;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *framefmt; }else {ov08x40_update_pad_format (ov08x->cur_mode, fmt);
@@ -2826,7 +2825,7 @@ ov08x40_set_pad_format(struct v4l2_subdev *sd, fmt->format.width, fmt->format.height);ov08x40_update_pad_format (mode, fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *framefmt = fmt->format; }else { ov08x->cur_mode = mode;
drivers/media/i2c/ov13858.c +4 -6
@@ -1147,9 +1147,8 @@ static int ov13858_write_reg_list(struct ov13858 *ov13858,static int ov13858_open (struct v4l2_subdev *sd,struct v4l2_subdev_fh *fh) {struct ov13858 *ov13858 =to_ov13858 (sd); -struct v4l2_mbus_framefmt *try_fmt =v4l2_subdev_get_try_format (sd, - fh->state, -0 ); +struct v4l2_mbus_framefmt *try_fmt =v4l2_subdev_get_format (fh->state, +0 ,0 );mutex_lock (&ov13858->mutex);
@@ -1317,10 +1316,9 @@ static int ov13858_do_get_pad_format(struct ov13858 *ov13858, struct v4l2_subdev_format *fmt) {struct v4l2_mbus_framefmt *framefmt; -struct v4l2_subdev *sd = &ov13858->sd;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *framefmt; }else {ov13858_update_pad_format (ov13858->cur_mode, fmt);
@@ -1369,7 +1367,7 @@ ov13858_set_pad_format(struct v4l2_subdev *sd, fmt->format.width, fmt->format.height);ov13858_update_pad_format (mode, fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *framefmt = fmt->format; }else { ov13858->cur_mode = mode;
drivers/media/i2c/ov13b10.c +4 -6
@@ -755,9 +755,8 @@ static int ov13b10_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) {const struct ov13b10_mode *default_mode = &supported_modes[0 ];struct ov13b10 *ov13b =to_ov13b10 (sd); -struct v4l2_mbus_framefmt *try_fmt =v4l2_subdev_get_try_format (sd, - fh->state, -0 ); +struct v4l2_mbus_framefmt *try_fmt =v4l2_subdev_get_format (fh->state, +0 ,0 );mutex_lock (&ov13b->mutex);
@@ -1002,10 +1001,9 @@ static int ov13b10_do_get_pad_format(struct ov13b10 *ov13b, struct v4l2_subdev_format *fmt) {struct v4l2_mbus_framefmt *framefmt; -struct v4l2_subdev *sd = &ov13b->sd;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *framefmt; }else {ov13b10_update_pad_format (ov13b->cur_mode, fmt);
@@ -1054,7 +1052,7 @@ ov13b10_set_pad_format(struct v4l2_subdev *sd, fmt->format.width, fmt->format.height);ov13b10_update_pad_format (mode, fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *framefmt = fmt->format; }else { ov13b->cur_mode = mode;
drivers/media/i2c/ov2640.c +2 -2
@@ -920,7 +920,7 @@ static int ov2640_get_fmt(struct v4l2_subdev *sd,return -EINVAL ;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state,0 ); + mf =v4l2_subdev_get_format (sd_state,0 ,0 ); format->format = *mf;return 0 ; }
@@ -1000,7 +1000,7 @@ static int ov2640_init_cfg(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state) {struct v4l2_mbus_framefmt *try_fmt = -v4l2_subdev_get_try_format (sd, sd_state,0 ); +v4l2_subdev_get_format (sd_state,0 ,0 );const struct ov2640_win_size *win =ov2640_select_win (SVGA_WIDTH ,SVGA_HEIGHT );
drivers/media/i2c/ov2659.c +3 -3
@@ -1033,7 +1033,7 @@ static int ov2659_get_fmt(struct v4l2_subdev *sd,if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *mf; - mf =v4l2_subdev_get_try_format (sd, sd_state,0 ); + mf =v4l2_subdev_get_format (sd_state,0 ,0 );mutex_lock (&ov2659->lock); fmt->format = *mf;mutex_unlock (&ov2659->lock);
@@ -1109,7 +1109,7 @@ static int ov2659_set_fmt(struct v4l2_subdev *sd,mutex_lock (&ov2659->lock);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + mf =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *mf = fmt->format; }else {s64 val;
@@ -1304,7 +1304,7 @@ static int ov2659_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) {struct i2c_client *client =v4l2_get_subdevdata (sd);struct v4l2_mbus_framefmt *format = -v4l2_subdev_get_try_format (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 );dev_dbg (&client->dev,"%s:\n" , __func__);
drivers/media/i2c/ov2680.c +3 -3
@@ -309,7 +309,7 @@ __ov2680_get_pad_format(struct ov2680_dev *sensor, enum v4l2_subdev_format_whence which) {if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return v4l2_subdev_get_try_format (&sensor->sd, state, pad); +return v4l2_subdev_get_format (state, pad,0 );return &sensor->mode.fmt; }
@@ -321,7 +321,7 @@ __ov2680_get_pad_crop(struct ov2680_dev *sensor, enum v4l2_subdev_format_whence which) {if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return v4l2_subdev_get_try_crop (&sensor->sd, state, pad); +return v4l2_subdev_get_crop (state, pad,0 );return &sensor->mode.crop; }
@@ -650,7 +650,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,ov2680_fill_format (sensor, &format->format, width, height);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - try_fmt =v4l2_subdev_get_try_format (sd, sd_state,0 ); + try_fmt =v4l2_subdev_get_format (sd_state,0 ,0 ); *try_fmt = format->format;return 0 ; }
drivers/media/i2c/ov2685.c +2 -2
@@ -404,7 +404,7 @@ __ov2685_get_pad_crop(struct ov2685 *ov2685,switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&ov2685->subdev, state, pad); +return v4l2_subdev_get_crop (state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return mode->analog_crop; }
@@ -547,7 +547,7 @@ static int ov2685_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)mutex_lock (&ov2685->mutex); - try_fmt =v4l2_subdev_get_try_format (sd, fh->state,0 ); + try_fmt =v4l2_subdev_get_format (fh->state,0 ,0 );/* Initialize try_fmt */ ov2685_fill_fmt (&supported_modes[0 ], try_fmt);
drivers/media/i2c/ov2740.c +2 -2
@@ -826,7 +826,7 @@ static int ov2740_set_format(struct v4l2_subdev *sd, fmt->format.height);ov2740_update_pad_format (mode, &fmt->format); - *v4l2_subdev_get_pad_format (sd, sd_state, fmt->pad) = fmt->format; + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY )return 0 ;
@@ -883,7 +883,7 @@ static int ov2740_init_cfg(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state) {ov2740_update_pad_format (&supported_modes[0 ], -v4l2_subdev_get_pad_format (sd, sd_state,0 )); +v4l2_subdev_get_format (sd_state,0 ,0 ));return 0 ; }
drivers/media/i2c/ov4689.c +1 -1
@@ -570,7 +570,7 @@ static int ov4689_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)mutex_lock (&ov4689->mutex); - try_fmt =v4l2_subdev_get_try_format (sd, fh->state,0 ); + try_fmt =v4l2_subdev_get_format (fh->state,0 ,0 );/* Initialize try_fmt */ ov4689_fill_fmt (&supported_modes[OV4689_MODE_2688_1520 ], try_fmt);
drivers/media/i2c/ov5640.c +4 -5
@@ -2797,8 +2797,7 @@ static int ov5640_get_fmt(struct v4l2_subdev *sd,mutex_lock (&sensor->lock);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt =v4l2_subdev_get_try_format (&sensor->sd, sd_state, - format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 );else fmt = &sensor->fmt;
@@ -2971,7 +2970,7 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd, goto out;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state,0 ) = *mbus_fmt; + *v4l2_subdev_get_format (sd_state,0 ,0 ) = *mbus_fmt; goto out; }
@@ -3750,8 +3749,8 @@ static int ov5640_init_cfg(struct v4l2_subdev *sd, {struct ov5640_dev *sensor =to_ov5640_dev (sd);struct v4l2_mbus_framefmt *fmt = -v4l2_subdev_get_try_format (sd, state,0 ); -struct v4l2_rect *crop =v4l2_subdev_get_try_crop (sd, state,0 ); +v4l2_subdev_get_format (state,0 ,0 ); +struct v4l2_rect *crop =v4l2_subdev_get_crop (state,0 ,0 ); *fmt =ov5640_is_csi2 (sensor) ? ov5640_csi2_default_fmt : ov5640_dvp_default_fmt;
drivers/media/i2c/ov5645.c +2 -2
@@ -851,7 +851,7 @@ __ov5645_get_pad_format(struct ov5645 *ov5645, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_format (&ov5645->sd, sd_state, pad); +return v4l2_subdev_get_format (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &ov5645->fmt;default :
@@ -878,7 +878,7 @@ __ov5645_get_pad_crop(struct ov5645 *ov5645, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&ov5645->sd, sd_state, pad); +return v4l2_subdev_get_crop (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &ov5645->crop;default :
drivers/media/i2c/ov5647.c +6 -6
@@ -882,7 +882,7 @@ __ov5647_get_pad_crop(struct ov5647 *ov5647, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&ov5647->sd, sd_state, pad); +return v4l2_subdev_get_crop (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &ov5647->mode->crop; }
@@ -975,8 +975,8 @@ static int ov5647_get_pad_fmt(struct v4l2_subdev *sd,mutex_lock (&sensor->lock);switch (format->which) {case V4L2_SUBDEV_FORMAT_TRY : - sensor_format =v4l2_subdev_get_try_format (sd, sd_state, - format->pad); + sensor_format =v4l2_subdev_get_format (sd_state, format->pad, +0 );break ;default : sensor_format = &sensor->mode->format;
@@ -1004,7 +1004,7 @@ static int ov5647_set_pad_fmt(struct v4l2_subdev *sd,/* Update the sensor mode and apply at it at streamon time. */ mutex_lock (&sensor->lock);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, format->pad) = mode->format; + *v4l2_subdev_get_format (sd_state, format->pad,0 ) = mode->format; }else {int exposure_max, exposure_def;int hblank, vblank;
@@ -1121,8 +1121,8 @@ static int ov5647_detect(struct v4l2_subdev *sd)static int ov5647_open (struct v4l2_subdev *sd,struct v4l2_subdev_fh *fh) {struct v4l2_mbus_framefmt *format = -v4l2_subdev_get_try_format (sd, fh->state,0 ); -struct v4l2_rect *crop =v4l2_subdev_get_try_crop (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 ); +struct v4l2_rect *crop =v4l2_subdev_get_crop (fh->state,0 ,0 ); crop->left =OV5647_PIXEL_ARRAY_LEFT ; crop->top =OV5647_PIXEL_ARRAY_TOP ;
drivers/media/i2c/ov5648.c +3 -3
@@ -2232,8 +2232,8 @@ static int ov5648_get_fmt(struct v4l2_subdev *subdev,mutex_lock (&sensor->mutex);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) - *mbus_format = *v4l2_subdev_get_try_format (subdev, sd_state, - format->pad); + *mbus_format = *v4l2_subdev_get_format (sd_state, format->pad, +0 );else ov5648_mbus_format_fill (mbus_format, sensor->state.mbus_code, sensor->state.mode);
@@ -2285,7 +2285,7 @@ static int ov5648_set_fmt(struct v4l2_subdev *subdev,ov5648_mbus_format_fill (mbus_format, mbus_code, mode);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) - *v4l2_subdev_get_try_format (subdev, sd_state, format->pad) = + *v4l2_subdev_get_format (sd_state, format->pad,0 ) = *mbus_format;else if (sensor->state.mode != mode || sensor->state.mbus_code != mbus_code)
drivers/media/i2c/ov5670.c +5 -7
@@ -2200,9 +2200,9 @@ static int ov5670_init_cfg(struct v4l2_subdev *sd, struct v4l2_subdev_state *state) {struct v4l2_mbus_framefmt *fmt = -v4l2_subdev_get_try_format (sd, state,0 ); +v4l2_subdev_get_format (state,0 ,0 );const struct ov5670_mode *default_mode = &supported_modes[0 ]; -struct v4l2_rect *crop =v4l2_subdev_get_try_crop (sd, state,0 ); +struct v4l2_rect *crop =v4l2_subdev_get_crop (state,0 ,0 ); fmt->width = default_mode->width; fmt->height = default_mode->height;
@@ -2263,9 +2263,7 @@ static int ov5670_do_get_pad_format(struct ov5670 *ov5670, struct v4l2_subdev_format *fmt) {if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (&ov5670->sd, - sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else ov5670_update_pad_format (ov5670->cur_mode, fmt);
@@ -2310,7 +2308,7 @@ static int ov5670_set_pad_format(struct v4l2_subdev *sd, fmt->format.width, fmt->format.height);ov5670_update_pad_format (mode, fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad) = fmt->format; + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format; }else { ov5670->cur_mode = mode;__v4l2_ctrl_s_ctrl (ov5670->link_freq, mode->link_freq_index);
@@ -2550,7 +2548,7 @@ __ov5670_get_pad_crop(struct ov5670 *sensor, struct v4l2_subdev_state *state,switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&sensor->sd, state, pad); +return v4l2_subdev_get_crop (state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return mode->analog_crop; }
drivers/media/i2c/ov5675.c +3 -5
@@ -1036,7 +1036,7 @@ static int ov5675_set_format(struct v4l2_subdev *sd,mutex_lock (&ov5675->mutex);ov5675_update_pad_format (mode, &fmt->format);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad) = fmt->format; + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format; }else { ov5675->cur_mode = mode;__v4l2_ctrl_s_ctrl (ov5675->link_freq, mode->link_freq_index);
@@ -1069,9 +1069,7 @@ static int ov5675_get_format(struct v4l2_subdev *sd,mutex_lock (&ov5675->mutex);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (&ov5675->sd, - sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else ov5675_update_pad_format (ov5675->cur_mode, &fmt->format);
@@ -1141,7 +1139,7 @@ static int ov5675_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)mutex_lock (&ov5675->mutex);ov5675_update_pad_format (&supported_modes[0 ], -v4l2_subdev_get_try_format (sd, fh->state,0 )); +v4l2_subdev_get_format (fh->state,0 ,0 ));mutex_unlock (&ov5675->mutex);return 0 ;
drivers/media/i2c/ov5693.c +2 -2
@@ -775,7 +775,7 @@ __ov5693_get_pad_format(struct ov5693_device *ov5693, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_format (&ov5693->sd, state, pad); +return v4l2_subdev_get_format (state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &ov5693->mode.format;default :
@@ -790,7 +790,7 @@ __ov5693_get_pad_crop(struct ov5693_device *ov5693, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&ov5693->sd, state, pad); +return v4l2_subdev_get_crop (state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &ov5693->mode.crop; }
drivers/media/i2c/ov5695.c +3 -4
@@ -820,7 +820,7 @@ static int ov5695_set_fmt(struct v4l2_subdev *sd, fmt->format.height = mode->height; fmt->format.field =V4L2_FIELD_NONE ;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad) = fmt->format; + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format; }else { ov5695->cur_mode = mode; h_blank = mode->hts_def - mode->width;
@@ -846,8 +846,7 @@ static int ov5695_get_fmt(struct v4l2_subdev *sd,mutex_lock (&ov5695->mutex);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - fmt->format = *v4l2_subdev_get_try_format (sd, sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 ); }else { fmt->format.width = mode->width; fmt->format.height = mode->height;
@@ -1039,7 +1038,7 @@ static int ov5695_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) {struct ov5695 *ov5695 =to_ov5695 (sd);struct v4l2_mbus_framefmt *try_fmt = -v4l2_subdev_get_try_format (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 );const struct ov5695_mode *def_mode = &supported_modes[0 ];mutex_lock (&ov5695->mutex);
drivers/media/i2c/ov7251.c +2 -2
@@ -1139,7 +1139,7 @@ __ov7251_get_pad_format(struct ov7251 *ov7251, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_format (&ov7251->sd, sd_state, pad); +return v4l2_subdev_get_format (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &ov7251->fmt;default :
@@ -1169,7 +1169,7 @@ __ov7251_get_pad_crop(struct ov7251 *ov7251, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&ov7251->sd, sd_state, pad); +return v4l2_subdev_get_crop (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &ov7251->crop;default :
drivers/media/i2c/ov7670.c +3 -4
@@ -1112,8 +1112,7 @@ static int ov7670_set_fmt(struct v4l2_subdev *sd, ret =ov7670_try_fmt_internal (sd, &format->format,NULL ,NULL );if (ret)return ret; - mbus_fmt =v4l2_subdev_get_try_format (sd, sd_state, - format->pad); + mbus_fmt =v4l2_subdev_get_format (sd_state, format->pad,0 ); *mbus_fmt = format->format;return 0 ; }
@@ -1141,7 +1140,7 @@ static int ov7670_get_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mbus_fmt;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mbus_fmt =v4l2_subdev_get_try_format (sd, sd_state,0 ); + mbus_fmt =v4l2_subdev_get_format (sd_state,0 ,0 ); format->format = *mbus_fmt;return 0 ; }else {
@@ -1707,7 +1706,7 @@ static void ov7670_get_default_format(struct v4l2_subdev *sd,static int ov7670_open (struct v4l2_subdev *sd,struct v4l2_subdev_fh *fh) {struct v4l2_mbus_framefmt *format = -v4l2_subdev_get_try_format (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 );ov7670_get_default_format (sd, format);
drivers/media/i2c/ov7740.c +3 -4
@@ -812,8 +812,7 @@ static int ov7740_set_fmt(struct v4l2_subdev *sd,if (ret) goto error; - mbus_fmt =v4l2_subdev_get_try_format (sd, sd_state, - format->pad); + mbus_fmt =v4l2_subdev_get_format (sd_state, format->pad,0 ); *mbus_fmt = format->format;mutex_unlock (&ov7740->mutex);return 0 ;
@@ -843,7 +842,7 @@ static int ov7740_get_fmt(struct v4l2_subdev *sd,mutex_lock (&ov7740->mutex);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mbus_fmt =v4l2_subdev_get_try_format (sd, sd_state,0 ); + mbus_fmt =v4l2_subdev_get_format (sd_state,0 ,0 ); format->format = *mbus_fmt; }else { format->format = ov7740->format;
@@ -883,7 +882,7 @@ static int ov7740_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);struct v4l2_mbus_framefmt *format = -v4l2_subdev_get_try_format (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 );mutex_lock (&ov7740->mutex);ov7740_get_default_format (sd, format);
drivers/media/i2c/ov8856.c +3 -5
@@ -2134,7 +2134,7 @@ static int ov8856_set_format(struct v4l2_subdev *sd,mutex_lock (&ov8856->mutex);ov8856_update_pad_format (ov8856, mode, &fmt->format);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad) = fmt->format; + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format; }else { ov8856->cur_mode = mode;__v4l2_ctrl_s_ctrl (ov8856->link_freq, mode->link_freq_index);
@@ -2172,9 +2172,7 @@ static int ov8856_get_format(struct v4l2_subdev *sd,mutex_lock (&ov8856->mutex);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (&ov8856->sd, - sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else ov8856_update_pad_format (ov8856, ov8856->cur_mode, &fmt->format);
@@ -2225,7 +2223,7 @@ static int ov8856_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)mutex_lock (&ov8856->mutex);ov8856_update_pad_format (ov8856, &ov8856->priv_lane->supported_modes[0 ], -v4l2_subdev_get_try_format (sd, fh->state,0 )); +v4l2_subdev_get_format (fh->state,0 ,0 ));mutex_unlock (&ov8856->mutex);return 0 ;
drivers/media/i2c/ov8858.c +3 -3
@@ -1333,7 +1333,7 @@ static int ov8858_start_stream(struct ov8858 *ov8858,if (ret)return ret; - format =v4l2_subdev_get_pad_format (&ov8858->subdev, state,0 ); + format =v4l2_subdev_get_format (state,0 ,0 ); mode =v4l2_find_nearest_size (ov8858_modes,ARRAY_SIZE (ov8858_modes), width, height, format->width, format->height);
@@ -1428,7 +1428,7 @@ static int ov8858_set_fmt(struct v4l2_subdev *sd, fmt->format.field =V4L2_FIELD_NONE ;/* Store the format in the current subdev state. */ - *v4l2_subdev_get_pad_format (sd, state,0 ) = fmt->format; + *v4l2_subdev_get_format (state,0 ,0 ) = fmt->format;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY )return 0 ;
@@ -1547,7 +1547,7 @@ static int ov8858_set_ctrl(struct v4l2_ctrl *ctrl)* - by the driver when s_ctrl is called in the s_stream(1) call path */ state =v4l2_subdev_get_locked_active_state (&ov8858->subdev); - format =v4l2_subdev_get_pad_format (&ov8858->subdev, state,0 ); + format =v4l2_subdev_get_format (state,0 ,0 );/* Propagate change of current control to all related controls */ switch (ctrl->id) {
drivers/media/i2c/ov8865.c +4 -4
@@ -2710,8 +2710,8 @@ static int ov8865_get_fmt(struct v4l2_subdev *subdev,mutex_lock (&sensor->mutex);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) - *mbus_format = *v4l2_subdev_get_try_format (subdev, sd_state, - format->pad); + *mbus_format = *v4l2_subdev_get_format (sd_state, format->pad, +0 );else ov8865_mbus_format_fill (mbus_format, sensor->state.mbus_code, sensor->state.mode);
@@ -2765,7 +2765,7 @@ static int ov8865_set_fmt(struct v4l2_subdev *subdev,ov8865_mbus_format_fill (mbus_format, mbus_code, mode);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) - *v4l2_subdev_get_try_format (subdev, sd_state, format->pad) = + *v4l2_subdev_get_format (sd_state, format->pad,0 ) = *mbus_format;else if (sensor->state.mode != mode || sensor->state.mbus_code != mbus_code)
@@ -2818,7 +2818,7 @@ __ov8865_get_pad_crop(struct ov8865_sensor *sensor,switch (which) {case V4L2_SUBDEV_FORMAT_TRY : - *r = *v4l2_subdev_get_try_crop (&sensor->subdev, state, pad); + *r = *v4l2_subdev_get_crop (state, pad,0 );break ;case V4L2_SUBDEV_FORMAT_ACTIVE : r->height = mode->output_size_y;
drivers/media/i2c/ov9282.c +3 -3
@@ -814,7 +814,7 @@ static int ov9282_get_pad_format(struct v4l2_subdev *sd,if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *framefmt; - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *framefmt; }else { ov9282_fill_pad_format(ov9282, ov9282->cur_mode, ov9282->code,
@@ -860,7 +860,7 @@ static int ov9282_set_pad_format(struct v4l2_subdev *sd,if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *framefmt; - framefmt =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + framefmt =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *framefmt = fmt->format; }else { ret =ov9282_update_controls (ov9282, mode, fmt);
@@ -902,7 +902,7 @@ __ov9282_get_pad_crop(struct ov9282 *ov9282, {switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_crop (&ov9282->sd, sd_state, pad); +return v4l2_subdev_get_crop (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &ov9282->cur_mode->crop; }
drivers/media/i2c/ov9650.c +3 -4
@@ -1172,7 +1172,7 @@ static int ov965x_get_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mf;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state,0 ); + mf =v4l2_subdev_get_format (sd_state,0 ,0 ); fmt->format = *mf;return 0 ; }
@@ -1233,8 +1233,7 @@ static int ov965x_set_fmt(struct v4l2_subdev *sd,if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) {if (sd_state) { - mf =v4l2_subdev_get_try_format (sd, sd_state, - fmt->pad); + mf =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *mf = fmt->format; } }else {
@@ -1363,7 +1362,7 @@ static int ov965x_s_stream(struct v4l2_subdev *sd, int on)static int ov965x_open (struct v4l2_subdev *sd,struct v4l2_subdev_fh *fh) {struct v4l2_mbus_framefmt *mf = -v4l2_subdev_get_try_format (sd, fh->state,0 ); +v4l2_subdev_get_format (fh->state,0 ,0 );ov965x_get_default_format (mf);return 0 ;
drivers/media/i2c/ov9734.c +3 -5
@@ -697,7 +697,7 @@ static int ov9734_set_format(struct v4l2_subdev *sd,mutex_lock (&ov9734->mutex);ov9734_update_pad_format (mode, &fmt->format);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad) = fmt->format; + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = fmt->format; }else { ov9734->cur_mode = mode;__v4l2_ctrl_s_ctrl (ov9734->link_freq, mode->link_freq_index);
@@ -730,9 +730,7 @@ static int ov9734_get_format(struct v4l2_subdev *sd,mutex_lock (&ov9734->mutex);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (&ov9734->sd, - sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else ov9734_update_pad_format (ov9734->cur_mode, &fmt->format);
@@ -777,7 +775,7 @@ static int ov9734_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)mutex_lock (&ov9734->mutex);ov9734_update_pad_format (&supported_modes[0 ], -v4l2_subdev_get_try_format (sd, fh->state,0 )); +v4l2_subdev_get_format (fh->state,0 ,0 ));mutex_unlock (&ov9734->mutex);return 0 ;
drivers/media/i2c/s5c73m3/s5c73m3-core.c +15 -20
@@ -819,7 +819,6 @@ static void s5c73m3_oif_try_format(struct s5c73m3 *state,struct v4l2_subdev_format *fmt, const struct s5c73m3_frame_size **fs) { - struct v4l2_subdev *sd = &state->sensor_sd; u32 code;switch (fmt->pad) {
@@ -841,10 +840,8 @@ static void s5c73m3_oif_try_format(struct s5c73m3 *state,if (fmt->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) *fs = state->oif_pix_size[RES_ISP ];else - *fs =s5c73m3_find_frame_size ( -v4l2_subdev_get_try_format (sd, sd_state, -OIF_ISP_PAD ), -RES_ISP ); + *fs =s5c73m3_find_frame_size (v4l2_subdev_get_format (sd_state,OIF_ISP_PAD ,0 ), +RES_ISP );break ; }
@@ -990,8 +987,7 @@ static int s5c73m3_get_fmt(struct v4l2_subdev *sd,u32 code;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - fmt->format = *v4l2_subdev_get_try_format (sd, sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );return 0 ; }
@@ -1025,8 +1021,7 @@ static int s5c73m3_oif_get_fmt(struct v4l2_subdev *sd,u32 code;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - fmt->format = *v4l2_subdev_get_try_format (sd, sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );return 0 ; }
@@ -1069,7 +1064,7 @@ static int s5c73m3_set_fmt(struct v4l2_subdev *sd,s5c73m3_try_format (state, sd_state, fmt, &frame_size);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + mf =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *mf = fmt->format; }else {switch (fmt->pad) {
@@ -1108,11 +1103,11 @@ static int s5c73m3_oif_set_fmt(struct v4l2_subdev *sd,s5c73m3_oif_try_format (state, sd_state, fmt, &frame_size);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + mf =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *mf = fmt->format;if (fmt->pad ==OIF_ISP_PAD ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, -OIF_SOURCE_PAD ); + mf =v4l2_subdev_get_format (sd_state,OIF_SOURCE_PAD , +0 ); mf->width = fmt->format.width; mf->height = fmt->format.height; }
@@ -1260,8 +1255,8 @@ static int s5c73m3_oif_enum_frame_size(struct v4l2_subdev *sd,if (fse->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *mf; - mf =v4l2_subdev_get_try_format (sd, sd_state, -OIF_ISP_PAD ); + mf =v4l2_subdev_get_format (sd_state, +OIF_ISP_PAD ,0 ); w = mf->width; h = mf->height;
@@ -1316,11 +1311,11 @@ static int s5c73m3_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) {struct v4l2_mbus_framefmt *mf; - mf =v4l2_subdev_get_try_format (sd, fh->state,S5C73M3_ISP_PAD ); + mf =v4l2_subdev_get_format (fh->state,S5C73M3_ISP_PAD ,0 );s5c73m3_fill_mbus_fmt (mf, &s5c73m3_isp_resolutions[1 ],S5C73M3_ISP_FMT ); - mf =v4l2_subdev_get_try_format (sd, fh->state,S5C73M3_JPEG_PAD ); + mf =v4l2_subdev_get_format (fh->state,S5C73M3_JPEG_PAD ,0 );s5c73m3_fill_mbus_fmt (mf, &s5c73m3_jpeg_resolutions[1 ],S5C73M3_JPEG_FMT );
@@ -1331,15 +1326,15 @@ static int s5c73m3_oif_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) {struct v4l2_mbus_framefmt *mf; - mf =v4l2_subdev_get_try_format (sd, fh->state,OIF_ISP_PAD ); + mf =v4l2_subdev_get_format (fh->state,OIF_ISP_PAD ,0 );s5c73m3_fill_mbus_fmt (mf, &s5c73m3_isp_resolutions[1 ],S5C73M3_ISP_FMT ); - mf =v4l2_subdev_get_try_format (sd, fh->state,OIF_JPEG_PAD ); + mf =v4l2_subdev_get_format (fh->state,OIF_JPEG_PAD ,0 );s5c73m3_fill_mbus_fmt (mf, &s5c73m3_jpeg_resolutions[1 ],S5C73M3_JPEG_FMT ); - mf =v4l2_subdev_get_try_format (sd, fh->state,OIF_SOURCE_PAD ); + mf =v4l2_subdev_get_format (fh->state,OIF_SOURCE_PAD ,0 );s5c73m3_fill_mbus_fmt (mf, &s5c73m3_isp_resolutions[1 ],S5C73M3_ISP_FMT );return 0 ;
drivers/media/i2c/s5k5baf.c +13 -17
@@ -1273,7 +1273,7 @@ static int s5k5baf_get_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mf;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + mf =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *mf;return 0 ; }
@@ -1307,7 +1307,7 @@ static int s5k5baf_set_fmt(struct v4l2_subdev *sd, mf->field =V4L2_FIELD_NONE ;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad) = *mf; + *v4l2_subdev_get_format (sd_state, fmt->pad,0 ) = *mf;return 0 ; }
@@ -1379,11 +1379,10 @@ static int s5k5baf_get_selection(struct v4l2_subdev *sd,if (sel->which ==V4L2_SUBDEV_FORMAT_TRY ) {if (rtype ==R_COMPOSE ) - sel->r = *v4l2_subdev_get_try_compose (sd, sd_state, - sel->pad); + sel->r = *v4l2_subdev_get_compose (sd_state, sel->pad, +0 );else - sel->r = *v4l2_subdev_get_try_crop (sd, sd_state, - sel->pad); + sel->r = *v4l2_subdev_get_crop (sd_state, sel->pad,0 );return 0 ; }
@@ -1473,12 +1472,9 @@ static int s5k5baf_set_selection(struct v4l2_subdev *sd,if (sel->which ==V4L2_SUBDEV_FORMAT_TRY ) { rects = (struct v4l2_rect * []) { &s5k5baf_cis_rect, -v4l2_subdev_get_try_crop (sd, sd_state, -PAD_CIS ), -v4l2_subdev_get_try_compose (sd, sd_state, -PAD_CIS ), -v4l2_subdev_get_try_crop (sd, sd_state, -PAD_OUT ) +v4l2_subdev_get_crop (sd_state,PAD_CIS ,0 ), +v4l2_subdev_get_compose (sd_state,PAD_CIS ,0 ), +v4l2_subdev_get_crop (sd_state,PAD_OUT ,0 ) };s5k5baf_set_rect_and_adjust (rects, rtype, &sel->r);return 0 ;
@@ -1696,22 +1692,22 @@ static int s5k5baf_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) {struct v4l2_mbus_framefmt *mf; - mf =v4l2_subdev_get_try_format (sd, fh->state,PAD_CIS ); + mf =v4l2_subdev_get_format (fh->state,PAD_CIS ,0 );s5k5baf_try_cis_format (mf);if (s5k5baf_is_cis_subdev (sd))return 0 ; - mf =v4l2_subdev_get_try_format (sd, fh->state,PAD_OUT ); + mf =v4l2_subdev_get_format (fh->state,PAD_OUT ,0 ); mf->colorspace = s5k5baf_formats[0 ].colorspace; mf->code = s5k5baf_formats[0 ].code; mf->width = s5k5baf_cis_rect.width; mf->height = s5k5baf_cis_rect.height; mf->field =V4L2_FIELD_NONE ; - *v4l2_subdev_get_try_crop (sd, fh->state,PAD_CIS ) = s5k5baf_cis_rect; - *v4l2_subdev_get_try_compose (sd, fh->state,PAD_CIS ) = s5k5baf_cis_rect; - *v4l2_subdev_get_try_crop (sd, fh->state,PAD_OUT ) = s5k5baf_cis_rect; + *v4l2_subdev_get_crop (fh->state,PAD_CIS ,0 ) = s5k5baf_cis_rect; + *v4l2_subdev_get_compose (fh->state,PAD_CIS ,0 ) = s5k5baf_cis_rect; + *v4l2_subdev_get_crop (fh->state,PAD_OUT ,0 ) = s5k5baf_cis_rect;return 0 ; }
drivers/media/i2c/s5k6a3.c +3 -5
@@ -127,8 +127,7 @@ static struct v4l2_mbus_framefmt *__s5k6a3_get_format( u32 pad, enum v4l2_subdev_format_whence which) {if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return sd_state ?v4l2_subdev_get_try_format (&sensor->subdev, - sd_state, pad) :NULL ; +return sd_state ?v4l2_subdev_get_format (sd_state, pad,0 ) :NULL ;return &sensor->format; }
@@ -174,9 +173,8 @@ static const struct v4l2_subdev_pad_ops s5k6a3_pad_ops = {static int s5k6a3_open (struct v4l2_subdev *sd,struct v4l2_subdev_fh *fh) { -struct v4l2_mbus_framefmt *format =v4l2_subdev_get_try_format (sd, - fh->state, -0 ); +struct v4l2_mbus_framefmt *format =v4l2_subdev_get_format (fh->state, +0 ,0 ); *format = s5k6a3_formats[0 ]; format->width =S5K6A3_DEFAULT_WIDTH ;
drivers/media/i2c/st-mipid02.c +5 -6
@@ -724,8 +724,7 @@ static int mipid02_get_fmt(struct v4l2_subdev *sd,return -EINVAL ;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt =v4l2_subdev_get_try_format (&bridge->sd, sd_state, - format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 );else fmt = &bridge->fmt;
@@ -751,8 +750,8 @@ static void mipid02_set_fmt_source(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) format->format = bridge->fmt;else - format->format = *v4l2_subdev_get_try_format (sd, sd_state, -MIPID02_SINK_0 ); + format->format = *v4l2_subdev_get_format (sd_state, +MIPID02_SINK_0 ,0 );/* but code may need to be converted */ format->format.code =serial_to_parallel_code (format->format.code);
@@ -761,7 +760,7 @@ static void mipid02_set_fmt_source(struct v4l2_subdev *sd,if (format->which !=V4L2_SUBDEV_FORMAT_TRY )return ; - *v4l2_subdev_get_try_format (sd, sd_state,MIPID02_SOURCE ) = + *v4l2_subdev_get_format (sd_state,MIPID02_SOURCE ,0 ) = format->format; }
@@ -775,7 +774,7 @@ static void mipid02_set_fmt_sink(struct v4l2_subdev *sd, format->format.code =get_fmt_code (format->format.code);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt =v4l2_subdev_get_try_format (sd, sd_state, format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 );else fmt = &bridge->fmt;
drivers/media/i2c/st-vgxy61.c +2 -3
@@ -780,8 +780,7 @@ static int vgxy61_get_fmt(struct v4l2_subdev *sd,mutex_lock (&sensor->lock);if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt =v4l2_subdev_get_try_format (&sensor->sd, sd_state, - format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 );else fmt = &sensor->fmt;
@@ -1289,7 +1288,7 @@ static int vgxy61_set_fmt(struct v4l2_subdev *sd, goto out;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - fmt =v4l2_subdev_get_try_format (sd, sd_state,0 ); + fmt =v4l2_subdev_get_format (sd_state,0 ,0 ); *fmt = format->format; }else if (sensor->current_mode != new_mode || sensor->fmt.code != format->format.code) {
drivers/media/i2c/tc358746.c +6 -6
@@ -427,7 +427,7 @@ static int tc358746_apply_misc_config(struct tc358746 *tc358746) sink_state =v4l2_subdev_lock_and_get_active_state (sd); - mbusfmt =v4l2_subdev_get_pad_format (sd, sink_state,TC358746_SINK ); + mbusfmt =v4l2_subdev_get_format (sink_state,TC358746_SINK ,0 ); fmt =tc358746_get_format_by_code (TC358746_SINK , mbusfmt->code);/* Self defined CSI user data type id's are not supported yet */
@@ -745,10 +745,10 @@ static int tc358746_init_cfg(struct v4l2_subdev *sd, {struct v4l2_mbus_framefmt *fmt; - fmt =v4l2_subdev_get_pad_format (sd, state,TC358746_SINK ); + fmt =v4l2_subdev_get_format (state,TC358746_SINK ,0 ); *fmt = tc358746_def_fmt; - fmt =v4l2_subdev_get_pad_format (sd, state,TC358746_SOURCE ); + fmt =v4l2_subdev_get_format (state,TC358746_SOURCE ,0 ); *fmt = tc358746_def_fmt; fmt->code =tc358746_src_mbus_code (tc358746_def_fmt.code);
@@ -781,7 +781,7 @@ static int tc358746_set_fmt(struct v4l2_subdev *sd,if (format->pad ==TC358746_SOURCE )return v4l2_subdev_get_fmt (sd, sd_state, format); - sink_fmt =v4l2_subdev_get_pad_format (sd, sd_state,TC358746_SINK ); + sink_fmt =v4l2_subdev_get_format (sd_state,TC358746_SINK ,0 ); fmt =tc358746_get_format_by_code (format->pad, format->format.code);if (IS_ERR (fmt)) {
@@ -800,7 +800,7 @@ static int tc358746_set_fmt(struct v4l2_subdev *sd, *sink_fmt = format->format; - src_fmt =v4l2_subdev_get_pad_format (sd, sd_state,TC358746_SOURCE ); + src_fmt =v4l2_subdev_get_format (sd_state,TC358746_SOURCE ,0 ); *src_fmt = *sink_fmt; src_fmt->code =tc358746_src_mbus_code (sink_fmt->code);
@@ -905,7 +905,7 @@ tc358746_link_validate(struct v4l2_subdev *sd, struct media_link *link,return err; sink_state =v4l2_subdev_lock_and_get_active_state (sd); - mbusfmt =v4l2_subdev_get_pad_format (sd, sink_state,TC358746_SINK ); + mbusfmt =v4l2_subdev_get_format (sink_state,TC358746_SINK ,0 );/* Check the FIFO settings */ fmt =tc358746_get_format_by_code (TC358746_SINK , mbusfmt->code);
drivers/media/i2c/tda1997x.c +3 -3
@@ -1740,7 +1740,7 @@ static int tda1997x_init_cfg(struct v4l2_subdev *sd,struct tda1997x_state *state =to_state (sd);struct v4l2_mbus_framefmt *mf; - mf =v4l2_subdev_get_try_format (sd, sd_state,0 ); + mf =v4l2_subdev_get_format (sd_state,0 ,0 ); mf->code = state->mbus_codes[0 ];return 0 ;
@@ -1792,7 +1792,7 @@ static int tda1997x_get_format(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *fmt; - fmt =v4l2_subdev_get_try_format (sd, sd_state, format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 ); format->format.code = fmt->code; }else format->format.code = state->mbus_code;
@@ -1826,7 +1826,7 @@ static int tda1997x_set_format(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) {struct v4l2_mbus_framefmt *fmt; - fmt =v4l2_subdev_get_try_format (sd, sd_state, format->pad); + fmt =v4l2_subdev_get_format (sd_state, format->pad,0 ); *fmt = format->format; }else {int ret =tda1997x_setup_format (state, format->format.code);
drivers/media/i2c/tvp5150.c +1 -1
@@ -1035,7 +1035,7 @@ tvp5150_get_pad_crop(struct tvp5150 *decoder,return &decoder->rect;case V4L2_SUBDEV_FORMAT_TRY :#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API ) -return v4l2_subdev_get_try_crop (&decoder->sd, sd_state, pad); +return v4l2_subdev_get_crop (sd_state, pad,0 );#else return ERR_PTR (-EINVAL );#endif
drivers/media/pci/intel/ipu3/ipu3-cio2.c +4 -5
@@ -1205,11 +1205,11 @@ static int cio2_subdev_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) };/* Initialize try_fmt */ - format =v4l2_subdev_get_try_format (sd, fh->state,CIO2_PAD_SINK ); + format =v4l2_subdev_get_format (fh->state,CIO2_PAD_SINK ,0 ); *format = fmt_default;/* same as sink */ - format =v4l2_subdev_get_try_format (sd, fh->state,CIO2_PAD_SOURCE ); + format =v4l2_subdev_get_format (fh->state,CIO2_PAD_SOURCE ,0 ); *format = fmt_default;return 0 ;
@@ -1231,8 +1231,7 @@ static int cio2_subdev_get_fmt(struct v4l2_subdev *sd,mutex_lock (&q->subdev_lock);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - fmt->format = *v4l2_subdev_get_try_format (sd, sd_state, - fmt->pad); + fmt->format = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );else fmt->format = q->subdev_fmt;
@@ -1265,7 +1264,7 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd,return cio2_subdev_get_fmt (sd, sd_state, fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - mbus =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + mbus =v4l2_subdev_get_format (sd_state, fmt->pad,0 );else mbus = &q->subdev_fmt;
drivers/media/pci/intel/ivsc/mei_csi.c +2 -2
@@ -338,7 +338,7 @@ mei_csi_get_pad_format(struct v4l2_subdev *sd,switch (which) {case V4L2_SUBDEV_FORMAT_TRY : -return v4l2_subdev_get_try_format (sd, sd_state, pad); +return v4l2_subdev_get_format (sd_state, pad,0 );case V4L2_SUBDEV_FORMAT_ACTIVE :return &csi->format_mbus[pad];default :
@@ -356,7 +356,7 @@ static int mei_csi_init_cfg(struct v4l2_subdev *sd,mutex_lock (&csi->lock);for (i =0 ; i < sd->entity.num_pads; i++) { - mbusformat =v4l2_subdev_get_try_format (sd, sd_state, i); + mbusformat =v4l2_subdev_get_format (sd_state, i,0 ); *mbusformat = mei_csi_format_mbus_default; }
drivers/media/platform/cadence/cdns-csi2rx.c +2 -2
@@ -406,12 +406,12 @@ static int csi2rx_set_fmt(struct v4l2_subdev *subdev, format->format.field =V4L2_FIELD_NONE ;/* Set sink format */ - fmt =v4l2_subdev_get_pad_format (subdev, state, format->pad); + fmt =v4l2_subdev_get_format (state, format->pad,0 ); *fmt = format->format;/* Propagate to source formats */ for (i =CSI2RX_PAD_SOURCE_STREAM0 ; i <CSI2RX_PAD_MAX ; i++) { - fmt =v4l2_subdev_get_pad_format (subdev, state, i); + fmt =v4l2_subdev_get_format (state, i,0 ); *fmt = format->format; }
drivers/media/platform/cadence/cdns-csi2tx.c +1 -2
@@ -176,8 +176,7 @@ __csi2tx_get_pad_format(struct v4l2_subdev *subdev,struct csi2tx_priv *csi2tx =v4l2_subdev_to_csi2tx (subdev);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) -return v4l2_subdev_get_try_format (subdev, sd_state, - fmt->pad); +return v4l2_subdev_get_format (sd_state, fmt->pad,0 );return &csi2tx->pad_fmts[fmt->pad]; }
drivers/media/platform/microchip/microchip-csi2dc.c +7 -8
@@ -232,8 +232,8 @@ static int csi2dc_get_fmt(struct v4l2_subdev *csi2dc_sd,struct v4l2_mbus_framefmt *v4l2_try_fmt;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - v4l2_try_fmt =v4l2_subdev_get_try_format (csi2dc_sd, sd_state, - format->pad); + v4l2_try_fmt =v4l2_subdev_get_format (sd_state, format->pad, +0 ); format->format = *v4l2_try_fmt;return 0 ;
@@ -281,13 +281,12 @@ static int csi2dc_set_fmt(struct v4l2_subdev *csi2dc_sd, req_fmt->format.field =V4L2_FIELD_NONE ;if (req_fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - v4l2_try_fmt =v4l2_subdev_get_try_format (csi2dc_sd, sd_state, - req_fmt->pad); + v4l2_try_fmt =v4l2_subdev_get_format (sd_state, req_fmt->pad, +0 ); *v4l2_try_fmt = req_fmt->format;/* Trying on the sink pad makes the source pad change too */ - v4l2_try_fmt =v4l2_subdev_get_try_format (csi2dc_sd, - sd_state, -CSI2DC_PAD_SOURCE ); + v4l2_try_fmt =v4l2_subdev_get_format (sd_state, +CSI2DC_PAD_SOURCE ,0 ); *v4l2_try_fmt = req_fmt->format;/* if we are just trying, we are done */
@@ -440,7 +439,7 @@ static int csi2dc_init_cfg(struct v4l2_subdev *csi2dc_sd, struct v4l2_subdev_state *sd_state) {struct v4l2_mbus_framefmt *v4l2_try_fmt = -v4l2_subdev_get_try_format (csi2dc_sd, sd_state,0 ); +v4l2_subdev_get_format (sd_state,0 ,0 ); v4l2_try_fmt->height =480 ; v4l2_try_fmt->width =640 ;
drivers/media/platform/microchip/microchip-isc-scaler.c +9 -8
@@ -33,8 +33,8 @@ static int isc_scaler_get_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *v4l2_try_fmt;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - v4l2_try_fmt =v4l2_subdev_get_try_format (sd, sd_state, - format->pad); + v4l2_try_fmt =v4l2_subdev_get_format (sd_state, format->pad, +0 ); format->format = *v4l2_try_fmt;return 0 ;
@@ -74,12 +74,13 @@ static int isc_scaler_set_fmt(struct v4l2_subdev *sd, req_fmt->format.code = fmt->mbus_code;if (req_fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - v4l2_try_fmt =v4l2_subdev_get_try_format (sd, sd_state, - req_fmt->pad); + v4l2_try_fmt =v4l2_subdev_get_format (sd_state, req_fmt->pad, +0 ); *v4l2_try_fmt = req_fmt->format;/* Trying on the sink pad makes the source pad change too */ - v4l2_try_fmt =v4l2_subdev_get_try_format (sd, sd_state, -ISC_SCALER_PAD_SOURCE ); + v4l2_try_fmt =v4l2_subdev_get_format (sd_state, +ISC_SCALER_PAD_SOURCE , +0 ); *v4l2_try_fmt = req_fmt->format; v4l_bound_align_image(&v4l2_try_fmt->width,
@@ -149,13 +150,13 @@ static int isc_scaler_init_cfg(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state) {struct v4l2_mbus_framefmt *v4l2_try_fmt = -v4l2_subdev_get_try_format (sd, sd_state,0 ); +v4l2_subdev_get_format (sd_state,0 ,0 );struct v4l2_rect *try_crop; struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); *v4l2_try_fmt = isc->scaler_format[ISC_SCALER_PAD_SOURCE ]; - try_crop =v4l2_subdev_get_try_crop (sd, sd_state,0 ); + try_crop =v4l2_subdev_get_crop (sd_state,0 ,0 ); try_crop->top =0 ; try_crop->left =0 ;
drivers/media/platform/nxp/imx-mipi-csis.c +5 -5
@@ -954,7 +954,7 @@ static int mipi_csis_s_stream(struct v4l2_subdev *sd, int enable) state =v4l2_subdev_lock_and_get_active_state (sd); - format =v4l2_subdev_get_pad_format (sd, state,CSIS_PAD_SINK ); + format =v4l2_subdev_get_format (state,CSIS_PAD_SINK ,0 ); csis_fmt =find_csis_format (format->code); ret =mipi_csis_calculate_params (csis, csis_fmt);
@@ -1002,7 +1002,7 @@ static int mipi_csis_enum_mbus_code(struct v4l2_subdev *sd,if (code->index >0 )return -EINVAL ; - fmt =v4l2_subdev_get_pad_format (sd, sd_state, code->pad); + fmt =v4l2_subdev_get_format (sd_state, code->pad,0 ); code->code = fmt->code;return 0 ; }
@@ -1069,7 +1069,7 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd, &sdformat->format.height,1 , CSIS_MAX_PIX_HEIGHT, 0, 0); - fmt =v4l2_subdev_get_pad_format (sd, sd_state, sdformat->pad); + fmt =v4l2_subdev_get_format (sd_state, sdformat->pad,0 ); fmt->code = csis_fmt->code; fmt->width = sdformat->format.width;
@@ -1083,7 +1083,7 @@ static int mipi_csis_set_fmt(struct v4l2_subdev *sd, sdformat->format = *fmt;/* Propagate the format from sink to source. */ - fmt =v4l2_subdev_get_pad_format (sd, sd_state,CSIS_PAD_SOURCE ); + fmt =v4l2_subdev_get_format (sd_state,CSIS_PAD_SOURCE ,0 ); *fmt = sdformat->format;/* The format on the source pad might change due to unpacking. */
@@ -1104,7 +1104,7 @@ static int mipi_csis_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,return -EINVAL ; state =v4l2_subdev_lock_and_get_active_state (sd); - fmt =v4l2_subdev_get_pad_format (sd, state,CSIS_PAD_SOURCE ); + fmt =v4l2_subdev_get_format (state,CSIS_PAD_SOURCE ,0 ); csis_fmt =find_csis_format (fmt->code);v4l2_subdev_unlock_state (state);
drivers/media/platform/nxp/imx7-media-csi.c +7 -8
@@ -542,8 +542,8 @@ static void imx7_csi_configure(struct imx7_csi *csi, }else {const struct v4l2_mbus_framefmt *sink_fmt; - sink_fmt =v4l2_subdev_get_pad_format (&csi->sd, sd_state, -IMX7_CSI_PAD_SINK ); + sink_fmt =v4l2_subdev_get_format (sd_state,IMX7_CSI_PAD_SINK , +0 ); cr1 =BIT_SOF_POL |BIT_REDGE |BIT_HSYNC_POL |BIT_FCC |BIT_MCLKDIV (1 ) |BIT_MCLKEN ;
@@ -1738,7 +1738,7 @@ static int imx7_csi_init_cfg(struct v4l2_subdev *sd,for (i =0 ; i <IMX7_CSI_PADS_NUM ; i++) {struct v4l2_mbus_framefmt *mf = -v4l2_subdev_get_pad_format (sd, sd_state, i); +v4l2_subdev_get_format (sd_state, i,0 ); mf->code =IMX7_CSI_DEF_MBUS_CODE ; mf->width =IMX7_CSI_DEF_PIX_WIDTH ;
@@ -1762,7 +1762,7 @@ static int imx7_csi_enum_mbus_code(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *in_fmt;int ret =0 ; - in_fmt =v4l2_subdev_get_pad_format (sd, sd_state,IMX7_CSI_PAD_SINK ); + in_fmt =v4l2_subdev_get_format (sd_state,IMX7_CSI_PAD_SINK ,0 );switch (code->pad) {case IMX7_CSI_PAD_SINK :
@@ -1841,7 +1841,7 @@ static void imx7_csi_try_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *in_fmt;u32 code; - in_fmt =v4l2_subdev_get_pad_format (sd, sd_state,IMX7_CSI_PAD_SINK ); + in_fmt =v4l2_subdev_get_format (sd_state,IMX7_CSI_PAD_SINK ,0 );switch (sdformat->pad) {case IMX7_CSI_PAD_SRC :
@@ -1891,7 +1891,7 @@ static int imx7_csi_set_fmt(struct v4l2_subdev *sd,imx7_csi_try_fmt (sd, sd_state, sdformat, &cc); - fmt =v4l2_subdev_get_pad_format (sd, sd_state, sdformat->pad); + fmt =v4l2_subdev_get_format (sd_state, sdformat->pad,0 ); *fmt = sdformat->format;
@@ -1902,8 +1902,7 @@ static int imx7_csi_set_fmt(struct v4l2_subdev *sd, format.format = sdformat->format;imx7_csi_try_fmt (sd, sd_state, &format, &outcc); - outfmt =v4l2_subdev_get_pad_format (sd, sd_state, -IMX7_CSI_PAD_SRC ); + outfmt =v4l2_subdev_get_format (sd_state,IMX7_CSI_PAD_SRC ,0 ); *outfmt = format.format; }
drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c +9 -9
@@ -263,10 +263,10 @@ int mxc_isi_pipe_enable(struct mxc_isi_pipe *pipe)/* Configure the pipeline. */ state =v4l2_subdev_lock_and_get_active_state (sd); - sink_fmt =v4l2_subdev_get_try_format (sd, state,MXC_ISI_PIPE_PAD_SINK ); - src_fmt =v4l2_subdev_get_try_format (sd, state,MXC_ISI_PIPE_PAD_SOURCE ); - compose =v4l2_subdev_get_try_compose (sd, state,MXC_ISI_PIPE_PAD_SINK ); - crop = *v4l2_subdev_get_try_crop (sd, state,MXC_ISI_PIPE_PAD_SOURCE ); + sink_fmt =v4l2_subdev_get_format (state,MXC_ISI_PIPE_PAD_SINK ,0 ); + src_fmt =v4l2_subdev_get_format (state,MXC_ISI_PIPE_PAD_SOURCE ,0 ); + compose =v4l2_subdev_get_compose (state,MXC_ISI_PIPE_PAD_SINK ,0 ); + crop = *v4l2_subdev_get_crop (state,MXC_ISI_PIPE_PAD_SOURCE ,0 ); sink_info =mxc_isi_bus_format_by_code (sink_fmt->code,MXC_ISI_PIPE_PAD_SINK );
@@ -322,7 +322,7 @@ mxc_isi_pipe_get_pad_format(struct mxc_isi_pipe *pipe, struct v4l2_subdev_state *state, unsigned int pad) { -return v4l2_subdev_get_try_format (&pipe->sd, state, pad); +return v4l2_subdev_get_format (state, pad,0 ); } static struct v4l2_rect *
@@ -330,7 +330,7 @@ mxc_isi_pipe_get_pad_crop(struct mxc_isi_pipe *pipe, struct v4l2_subdev_state *state, unsigned int pad) { -return v4l2_subdev_get_try_crop (&pipe->sd, state, pad); +return v4l2_subdev_get_crop (state, pad,0 ); } static struct v4l2_rect *
@@ -338,7 +338,7 @@ mxc_isi_pipe_get_pad_compose(struct mxc_isi_pipe *pipe, struct v4l2_subdev_state *state, unsigned int pad) { -return v4l2_subdev_get_try_compose (&pipe->sd, state, pad); +return v4l2_subdev_get_compose (state, pad,0 ); } static int mxc_isi_pipe_init_cfg(struct v4l2_subdev *sd,
@@ -832,8 +832,8 @@ int mxc_isi_pipe_acquire(struct mxc_isi_pipe *pipe,int ret; state =v4l2_subdev_lock_and_get_active_state (sd); - sink_fmt =v4l2_subdev_get_try_format (sd, state,MXC_ISI_PIPE_PAD_SINK ); - src_fmt =v4l2_subdev_get_try_format (sd, state,MXC_ISI_PIPE_PAD_SOURCE ); + sink_fmt =v4l2_subdev_get_format (state,MXC_ISI_PIPE_PAD_SINK ,0 ); + src_fmt =v4l2_subdev_get_format (state,MXC_ISI_PIPE_PAD_SOURCE ,0 );v4l2_subdev_unlock_state (state); sink_info = mxc_isi_bus_format_by_code(sink_fmt->code,
drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c +1 -1
@@ -713,7 +713,7 @@ static int mxc_isi_video_validate_format(struct mxc_isi_video *video) info =mxc_isi_format_by_fourcc (video->pix.pixelformat,MXC_ISI_VIDEO_CAP ); - format =v4l2_subdev_get_try_format (sd, state,MXC_ISI_PIPE_PAD_SOURCE ); + format =v4l2_subdev_get_format (state,MXC_ISI_PIPE_PAD_SOURCE ,0 ); if (format->code != info->mbus_code || format->width != video->pix.width ||
drivers/media/platform/nxp/imx8mq-mipi-csi2.c +6 -6
@@ -296,7 +296,7 @@ static int imx8mq_mipi_csi_calc_hs_settle(struct csi_state *state,/* Calculate the line rate from the pixel rate. */ - fmt =v4l2_subdev_get_pad_format (&state->sd, sd_state,MIPI_CSI2_PAD_SINK ); + fmt =v4l2_subdev_get_format (sd_state,MIPI_CSI2_PAD_SINK ,0 ); csi2_fmt =find_csi2_format (fmt->code); link_freq = v4l2_get_link_freq(state->src_sd->ctrl_handler,
@@ -443,8 +443,8 @@ static int imx8mq_mipi_csi_init_cfg(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *fmt_sink;struct v4l2_mbus_framefmt *fmt_source; - fmt_sink =v4l2_subdev_get_pad_format (sd, sd_state,MIPI_CSI2_PAD_SINK ); - fmt_source =v4l2_subdev_get_pad_format (sd, sd_state,MIPI_CSI2_PAD_SOURCE ); + fmt_sink =v4l2_subdev_get_format (sd_state,MIPI_CSI2_PAD_SINK ,0 ); + fmt_source =v4l2_subdev_get_format (sd_state,MIPI_CSI2_PAD_SOURCE ,0 ); fmt_sink->code =MEDIA_BUS_FMT_SGBRG10_1X10 ; fmt_sink->width =MIPI_CSI2_DEF_PIX_WIDTH ;
@@ -477,7 +477,7 @@ static int imx8mq_mipi_csi_enum_mbus_code(struct v4l2_subdev *sd,if (code->index >0 )return -EINVAL ; - fmt =v4l2_subdev_get_pad_format (sd, sd_state, code->pad); + fmt =v4l2_subdev_get_format (sd_state, code->pad,0 ); code->code = fmt->code;return 0 ; }
@@ -514,7 +514,7 @@ static int imx8mq_mipi_csi_set_fmt(struct v4l2_subdev *sd,if (!csi2_fmt) csi2_fmt = &imx8mq_mipi_csi_formats[0 ]; - fmt =v4l2_subdev_get_pad_format (sd, sd_state, sdformat->pad); + fmt =v4l2_subdev_get_format (sd_state, sdformat->pad,0 ); fmt->code = csi2_fmt->code; fmt->width = sdformat->format.width;
@@ -523,7 +523,7 @@ static int imx8mq_mipi_csi_set_fmt(struct v4l2_subdev *sd, sdformat->format = *fmt;/* Propagate the format from sink to source. */ - fmt =v4l2_subdev_get_pad_format (sd, sd_state,MIPI_CSI2_PAD_SOURCE ); + fmt =v4l2_subdev_get_format (sd_state,MIPI_CSI2_PAD_SOURCE ,0 ); *fmt = sdformat->format;return 0 ;
drivers/media/platform/qcom/camss/camss-csid.c +1 -2
@@ -276,8 +276,7 @@ __csid_get_format(struct csid_device *csid, enum v4l2_subdev_format_whence which) {if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return v4l2_subdev_get_try_format (&csid->subdev, sd_state, - pad); +return v4l2_subdev_get_format (sd_state, pad,0 );return &csid->fmt[pad]; }
drivers/media/platform/qcom/camss/camss-csiphy.c +1 -2
@@ -325,8 +325,7 @@ __csiphy_get_format(struct csiphy_device *csiphy, enum v4l2_subdev_format_whence which) {if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return v4l2_subdev_get_try_format (&csiphy->subdev, sd_state, - pad); +return v4l2_subdev_get_format (sd_state, pad,0 );return &csiphy->fmt[pad]; }
drivers/media/platform/qcom/camss/camss-ispif.c +1 -2
@@ -879,8 +879,7 @@ __ispif_get_format(struct ispif_line *line, enum v4l2_subdev_format_whence which) {if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return v4l2_subdev_get_try_format (&line->subdev, sd_state, - pad); +return v4l2_subdev_get_format (sd_state, pad,0 );return &line->fmt[pad]; }
drivers/media/platform/qcom/camss/camss-vfe.c +3 -6
@@ -828,8 +828,7 @@ __vfe_get_format(struct vfe_line *line, enum v4l2_subdev_format_whence which) {if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return v4l2_subdev_get_try_format (&line->subdev, sd_state, - pad); +return v4l2_subdev_get_format (sd_state, pad,0 );return &line->fmt[pad]; }
@@ -848,8 +847,7 @@ __vfe_get_compose(struct vfe_line *line, enum v4l2_subdev_format_whence which) {if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return v4l2_subdev_get_try_compose (&line->subdev, sd_state, -MSM_VFE_PAD_SINK ); +return v4l2_subdev_get_compose (sd_state,MSM_VFE_PAD_SINK ,0 );return &line->compose; }
@@ -868,8 +866,7 @@ __vfe_get_crop(struct vfe_line *line, enum v4l2_subdev_format_whence which) {if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return v4l2_subdev_get_try_crop (&line->subdev, sd_state, -MSM_VFE_PAD_SRC ); +return v4l2_subdev_get_crop (sd_state,MSM_VFE_PAD_SRC ,0 );return &line->crop; }
drivers/media/platform/renesas/rcar-isp.c +2 -2
@@ -282,7 +282,7 @@ static int risp_set_pad_format(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) { isp->mf = format->format; }else { - framefmt =v4l2_subdev_get_try_format (sd, sd_state,0 ); + framefmt =v4l2_subdev_get_format (sd_state,0 ,0 ); *framefmt = format->format; }
@@ -302,7 +302,7 @@ static int risp_get_pad_format(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) format->format = isp->mf;else - format->format = *v4l2_subdev_get_try_format (sd, sd_state,0 ); + format->format = *v4l2_subdev_get_format (sd_state,0 ,0 );mutex_unlock (&isp->lock);
drivers/media/platform/renesas/rcar-vin/rcar-csi2.c +2 -2
@@ -1185,7 +1185,7 @@ static int rcsi2_set_pad_format(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) { priv->mf = format->format; }else { - framefmt =v4l2_subdev_get_try_format (sd, sd_state,0 ); + framefmt =v4l2_subdev_get_format (sd_state,0 ,0 ); *framefmt = format->format; }
@@ -1205,7 +1205,7 @@ static int rcsi2_get_pad_format(struct v4l2_subdev *sd,if (format->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) format->format = priv->mf;else - format->format = *v4l2_subdev_get_try_format (sd, sd_state,0 ); + format->format = *v4l2_subdev_get_format (sd_state,0 ,0 );mutex_unlock (&priv->lock);
drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +3 -3
@@ -250,7 +250,7 @@ static int rzg2l_csi2_calc_mbps(struct rzg2l_csi2 *csi2) } state =v4l2_subdev_lock_and_get_active_state (&csi2->subdev); - fmt =v4l2_subdev_get_pad_format (&csi2->subdev, state,RZG2L_CSI2_SINK ); + fmt =v4l2_subdev_get_format (state,RZG2L_CSI2_SINK ,0 ); format =rzg2l_csi2_code_to_fmt (fmt->code);v4l2_subdev_unlock_state (state);
@@ -500,13 +500,13 @@ static int rzg2l_csi2_set_format(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *src_format;struct v4l2_mbus_framefmt *sink_format; - src_format =v4l2_subdev_get_pad_format (sd, state,RZG2L_CSI2_SOURCE ); + src_format =v4l2_subdev_get_format (state,RZG2L_CSI2_SOURCE ,0 );if (fmt->pad ==RZG2L_CSI2_SOURCE ) { fmt->format = *src_format;return 0 ; } - sink_format =v4l2_subdev_get_pad_format (sd, state,RZG2L_CSI2_SINK ); + sink_format =v4l2_subdev_get_format (state,RZG2L_CSI2_SINK ,0 );if (!rzg2l_csi2_code_to_fmt (fmt->format.code)) sink_format->code = rzg2l_csi2_formats[0 ].code;
drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +3 -3
@@ -39,7 +39,7 @@ struct v4l2_mbus_framefmt *rzg2l_cru_ip_get_src_fmt(struct rzg2l_cru_dev *cru)struct v4l2_mbus_framefmt *fmt; state =v4l2_subdev_lock_and_get_active_state (&cru->ip.subdev); - fmt =v4l2_subdev_get_pad_format (&cru->ip.subdev, state,1 ); + fmt =v4l2_subdev_get_format (state,1 ,0 );v4l2_subdev_unlock_state (state);return fmt;
@@ -108,13 +108,13 @@ static int rzg2l_cru_ip_set_format(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *src_format;struct v4l2_mbus_framefmt *sink_format; - src_format =v4l2_subdev_get_pad_format (sd, state,RZG2L_CRU_IP_SOURCE ); + src_format =v4l2_subdev_get_format (state,RZG2L_CRU_IP_SOURCE ,0 );if (fmt->pad ==RZG2L_CRU_IP_SOURCE ) { fmt->format = *src_format;return 0 ; } - sink_format =v4l2_subdev_get_pad_format (sd, state, fmt->pad); + sink_format =v4l2_subdev_get_format (state, fmt->pad,0 );if (!rzg2l_cru_ip_code_to_fmt (fmt->format.code)) sink_format->code = rzg2l_cru_ip_formats[0 ].code;
drivers/media/platform/renesas/vsp1/vsp1_brx.c +1 -1
@@ -100,7 +100,7 @@ static struct v4l2_rect *brx_get_compose(struct vsp1_brx *brx, struct v4l2_subdev_state *sd_state, unsigned int pad) { -return v4l2_subdev_get_try_compose (&brx->entity.subdev, sd_state, pad); +return v4l2_subdev_get_compose (sd_state, pad,0 ); } static void brx_try_format(struct vsp1_brx *brx,
drivers/media/platform/renesas/vsp1/vsp1_entity.c +3 -5
@@ -142,7 +142,7 @@ vsp1_entity_get_pad_format(struct vsp1_entity *entity, struct v4l2_subdev_state *sd_state, unsigned int pad) { -return v4l2_subdev_get_try_format (&entity->subdev, sd_state, pad); +return v4l2_subdev_get_format (sd_state, pad,0 ); }/**
@@ -163,11 +163,9 @@ vsp1_entity_get_pad_selection(struct vsp1_entity *entity, {switch (target) {case V4L2_SEL_TGT_COMPOSE : -return v4l2_subdev_get_try_compose (&entity->subdev, sd_state, - pad); +return v4l2_subdev_get_compose (sd_state, pad,0 );case V4L2_SEL_TGT_CROP : -return v4l2_subdev_get_try_crop (&entity->subdev, sd_state, - pad); +return v4l2_subdev_get_crop (sd_state, pad,0 );default :return NULL ; }
drivers/media/platform/renesas/vsp1/vsp1_rwpf.c +1 -2
@@ -19,8 +19,7 @@struct v4l2_rect *vsp1_rwpf_get_crop (struct vsp1_rwpf *rwpf,struct v4l2_subdev_state *sd_state) { -return v4l2_subdev_get_try_crop (&rwpf->entity.subdev, sd_state, -RWPF_PAD_SINK ); +return v4l2_subdev_get_crop (sd_state,RWPF_PAD_SINK ,0 ); }/* -----------------------------------------------------------------------------
drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c +7 -9
@@ -242,8 +242,8 @@ static int rkisp1_csi_enum_mbus_code(struct v4l2_subdev *sd,if (code->index)return -EINVAL ; - sink_fmt =v4l2_subdev_get_pad_format (sd, sd_state, -RKISP1_CSI_PAD_SINK ); + sink_fmt =v4l2_subdev_get_format (sd_state, +RKISP1_CSI_PAD_SINK ,0 ); code->code = sink_fmt->code;return 0 ;
@@ -275,10 +275,8 @@ static int rkisp1_csi_init_config(struct v4l2_subdev *sd, {struct v4l2_mbus_framefmt *sink_fmt, *src_fmt; - sink_fmt =v4l2_subdev_get_pad_format (sd, sd_state, -RKISP1_CSI_PAD_SINK ); - src_fmt =v4l2_subdev_get_pad_format (sd, sd_state, -RKISP1_CSI_PAD_SRC ); + sink_fmt =v4l2_subdev_get_format (sd_state,RKISP1_CSI_PAD_SINK ,0 ); + src_fmt =v4l2_subdev_get_format (sd_state,RKISP1_CSI_PAD_SRC ,0 ); sink_fmt->width =RKISP1_DEFAULT_WIDTH ; sink_fmt->height =RKISP1_DEFAULT_HEIGHT ;
@@ -301,7 +299,7 @@ static int rkisp1_csi_set_fmt(struct v4l2_subdev *sd,if (fmt->pad ==RKISP1_CSI_PAD_SRC )return v4l2_subdev_get_fmt (sd, sd_state, fmt); - sink_fmt =v4l2_subdev_get_pad_format (sd, sd_state,RKISP1_CSI_PAD_SINK ); + sink_fmt =v4l2_subdev_get_format (sd_state,RKISP1_CSI_PAD_SINK ,0 ); sink_fmt->code = fmt->format.code;
@@ -321,7 +319,7 @@ static int rkisp1_csi_set_fmt(struct v4l2_subdev *sd, fmt->format = *sink_fmt;/* Propagate the format to the source pad. */ - src_fmt =v4l2_subdev_get_pad_format (sd, sd_state,RKISP1_CSI_PAD_SRC ); + src_fmt =v4l2_subdev_get_format (sd_state,RKISP1_CSI_PAD_SRC ,0 ); *src_fmt = *sink_fmt;return 0 ;
@@ -374,7 +372,7 @@ static int rkisp1_csi_s_stream(struct v4l2_subdev *sd, int enable)return -EINVAL ; sd_state =v4l2_subdev_lock_and_get_active_state (sd); - sink_fmt =v4l2_subdev_get_pad_format (sd, sd_state,RKISP1_CSI_PAD_SINK ); + sink_fmt =v4l2_subdev_get_format (sd_state,RKISP1_CSI_PAD_SINK ,0 ); format =rkisp1_mbus_info_get_by_code (sink_fmt->code);v4l2_subdev_unlock_state (sd_state);
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c +52 -51
216 lines not on this page · raw message
drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c +19 -34
118 lines not on this page · raw message
drivers/media/platform/samsung/exynos4-is/fimc-capture.c +6 -6
@@ -1479,7 +1479,7 @@ static int fimc_subdev_get_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mf;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + mf =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *mf;return 0 ; }
@@ -1534,7 +1534,7 @@ static int fimc_subdev_set_fmt(struct v4l2_subdev *sd, mf->colorspace =V4L2_COLORSPACE_JPEG ;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + mf =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *mf = fmt->format;return 0 ; }
@@ -1604,10 +1604,10 @@ static int fimc_subdev_get_selection(struct v4l2_subdev *sd,return 0 ;case V4L2_SEL_TGT_CROP : - try_sel =v4l2_subdev_get_try_crop (sd, sd_state, sel->pad); + try_sel =v4l2_subdev_get_crop (sd_state, sel->pad,0 );break ;case V4L2_SEL_TGT_COMPOSE : - try_sel =v4l2_subdev_get_try_compose (sd, sd_state, sel->pad); + try_sel =v4l2_subdev_get_compose (sd_state, sel->pad,0 ); f = &ctx->d_frame;break ;default :
@@ -1651,10 +1651,10 @@ static int fimc_subdev_set_selection(struct v4l2_subdev *sd,switch (sel->target) {case V4L2_SEL_TGT_CROP : - try_sel =v4l2_subdev_get_try_crop (sd, sd_state, sel->pad); + try_sel =v4l2_subdev_get_crop (sd_state, sel->pad,0 );break ;case V4L2_SEL_TGT_COMPOSE : - try_sel =v4l2_subdev_get_try_compose (sd, sd_state, sel->pad); + try_sel =v4l2_subdev_get_compose (sd_state, sel->pad,0 ); f = &ctx->d_frame;break ;default :
drivers/media/platform/samsung/exynos4-is/fimc-isp.c +10 -13
@@ -126,7 +126,7 @@ static int fimc_isp_subdev_get_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mf = &fmt->format;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *mf = *v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + *mf = *v4l2_subdev_get_format (sd_state, fmt->pad,0 );return 0 ; }
@@ -172,9 +172,9 @@ static void __isp_subdev_try_format(struct fimc_isp *isp, mf->code =MEDIA_BUS_FMT_SGRBG10_1X10 ; }else {if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) - format =v4l2_subdev_get_try_format (&isp->subdev, - sd_state, -FIMC_ISP_SD_PAD_SINK ); + format =v4l2_subdev_get_format (sd_state, +FIMC_ISP_SD_PAD_SINK , +0 );else format = &isp->sink_fmt;
@@ -207,7 +207,7 @@ static int fimc_isp_subdev_set_fmt(struct v4l2_subdev *sd,__isp_subdev_try_format (isp, sd_state, fmt);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + mf =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *mf = fmt->format;/* Propagate format to the source pads */
@@ -220,8 +220,7 @@ static int fimc_isp_subdev_set_fmt(struct v4l2_subdev *sd, format.pad = pad;__isp_subdev_try_format (isp, sd_state, &format); - mf =v4l2_subdev_get_try_format (sd, sd_state, - pad); + mf =v4l2_subdev_get_format (sd_state, pad,0 ); *mf = format.format; } }
@@ -374,18 +373,16 @@ static int fimc_isp_subdev_open(struct v4l2_subdev *sd, .field = V4L2_FIELD_NONE, }; - format =v4l2_subdev_get_try_format (sd, fh->state, -FIMC_ISP_SD_PAD_SINK ); + format =v4l2_subdev_get_format (fh->state,FIMC_ISP_SD_PAD_SINK ,0 ); *format = fmt; - format =v4l2_subdev_get_try_format (sd, fh->state, -FIMC_ISP_SD_PAD_SRC_FIFO ); + format =v4l2_subdev_get_format (fh->state,FIMC_ISP_SD_PAD_SRC_FIFO , +0 ); fmt.width =DEFAULT_PREVIEW_STILL_WIDTH ; fmt.height =DEFAULT_PREVIEW_STILL_HEIGHT ; *format = fmt; - format =v4l2_subdev_get_try_format (sd, fh->state, -FIMC_ISP_SD_PAD_SRC_DMA ); + format =v4l2_subdev_get_format (fh->state,FIMC_ISP_SD_PAD_SRC_DMA ,0 ); *format = fmt;return 0 ;
drivers/media/platform/samsung/exynos4-is/fimc-lite.c +8 -9
@@ -574,16 +574,15 @@ static const struct fimc_fmt *fimc_lite_subdev_try_fmt(struct fimc_lite *fimc,struct v4l2_rect *rect;if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { - sink_fmt =v4l2_subdev_get_try_format (&fimc->subdev, - sd_state, -FLITE_SD_PAD_SINK ); + sink_fmt =v4l2_subdev_get_format (sd_state, +FLITE_SD_PAD_SINK , +0 ); mf->code = sink_fmt->code; mf->colorspace = sink_fmt->colorspace; - rect =v4l2_subdev_get_try_crop (&fimc->subdev, - sd_state, -FLITE_SD_PAD_SINK ); + rect =v4l2_subdev_get_crop (sd_state, +FLITE_SD_PAD_SINK ,0 ); }else { mf->code = sink->fmt->mbus_code; mf->colorspace = sink->fmt->colorspace;
@@ -1021,7 +1020,7 @@ static struct v4l2_mbus_framefmt *__fimc_lite_subdev_get_try_fmt(if (pad !=FLITE_SD_PAD_SINK ) pad =FLITE_SD_PAD_SOURCE_DMA ; -return v4l2_subdev_get_try_format (sd, sd_state, pad); +return v4l2_subdev_get_format (sd_state, pad,0 ); } static int fimc_lite_subdev_get_fmt(struct v4l2_subdev *sd,
@@ -1129,7 +1128,7 @@ static int fimc_lite_subdev_get_selection(struct v4l2_subdev *sd,return -EINVAL ;if (sel->which ==V4L2_SUBDEV_FORMAT_TRY ) { - sel->r = *v4l2_subdev_get_try_crop (sd, sd_state, sel->pad); + sel->r = *v4l2_subdev_get_crop (sd_state, sel->pad,0 );return 0 ; }
@@ -1166,7 +1165,7 @@ static int fimc_lite_subdev_set_selection(struct v4l2_subdev *sd,fimc_lite_try_crop (fimc, &sel->r);if (sel->which ==V4L2_SUBDEV_FORMAT_TRY ) { - *v4l2_subdev_get_try_crop (sd, sd_state, sel->pad) = sel->r; + *v4l2_subdev_get_crop (sd_state, sel->pad,0 ) = sel->r; }else {unsigned long flags;spin_lock_irqsave (&fimc->slock, flags);
drivers/media/platform/samsung/exynos4-is/mipi-csis.c +1 -2
@@ -569,8 +569,7 @@ static struct v4l2_mbus_framefmt *__s5pcsis_get_format( enum v4l2_subdev_format_whence which) {if (which ==V4L2_SUBDEV_FORMAT_TRY ) -return sd_state ?v4l2_subdev_get_try_format (&state->sd, - sd_state,0 ) :NULL ; +return sd_state ?v4l2_subdev_get_format (sd_state,0 ,0 ) :NULL ;return &state->format; }
drivers/media/platform/samsung/s3c-camif/camif-capture.c +4 -4
@@ -1216,7 +1216,7 @@ static int s3c_camif_subdev_get_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mf = &fmt->format;if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + mf =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); fmt->format = *mf;return 0 ; }
@@ -1305,7 +1305,7 @@ static int s3c_camif_subdev_set_fmt(struct v4l2_subdev *sd,__camif_subdev_try_format (camif, mf, fmt->pad);if (fmt->which ==V4L2_SUBDEV_FORMAT_TRY ) { - mf =v4l2_subdev_get_try_format (sd, sd_state, fmt->pad); + mf =v4l2_subdev_get_format (sd_state, fmt->pad,0 ); *mf = fmt->format;mutex_unlock (&camif->lock);return 0 ;
@@ -1357,7 +1357,7 @@ static int s3c_camif_subdev_get_selection(struct v4l2_subdev *sd,return -EINVAL ;
Lines of this file are not shown. View the raw message.
drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c +3 -5
Lines of this file are not shown. View the raw message.
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c +3 -4
Lines of this file are not shown. View the raw message.
drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c +3 -4
Lines of this file are not shown. View the raw message.
drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c +3 -4
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/cal/cal-camerarx.c +5 -8
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/cal/cal-video.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispccdc.c +2 -4
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispccp2.c +1 -2
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispcsi2.c +1 -2
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/isppreview.c +2 -4
Lines of this file are not shown. View the raw message.
drivers/media/platform/ti/omap3isp/ispresizer.c +2 -3
Lines of this file are not shown. View the raw message.
drivers/media/platform/xilinx/xilinx-csi2rxss.c +2 -3
Lines of this file are not shown. View the raw message.
drivers/media/platform/xilinx/xilinx-tpg.c +4 -5
Lines of this file are not shown. View the raw message.
drivers/media/platform/xilinx/xilinx-vip.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/media/test-drivers/vimc/vimc-debayer.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/media/test-drivers/vimc/vimc-scaler.c +4 -5
Lines of this file are not shown. View the raw message.
drivers/media/test-drivers/vimc/vimc-sensor.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/staging/media/atomisp/i2c/atomisp-gc0310.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/atomisp/pci/atomisp_csi2.c +1 -2
Lines of this file are not shown. View the raw message.
drivers/staging/media/atomisp/pci/atomisp_subdev.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-ic-prpencvf.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-media-csi.c +3 -5
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 +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx6-mipi-csi2.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/omap4iss/iss_csi2.c +1 -2
Lines of this file are not shown. View the raw message.
drivers/staging/media/omap4iss/iss_ipipe.c +1 -2
Lines of this file are not shown. View the raw message.
drivers/staging/media/omap4iss/iss_ipipeif.c +1 -2
Lines of this file are not shown. View the raw message.
drivers/staging/media/omap4iss/iss_resizer.c +1 -2
Lines of this file are not shown. View the raw message.
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c +3 -4
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.39.2
Part of the diff is not shown here. View the raw message.
kernel test robot
build botRe: [PATCH 5/6] media: v4l: subdev: Switch to stream-aware state functions
kernel test robot noticed the following build warnings:
Hi Sakari,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20231016]
[cannot apply to media-tree/master rockchip/for-next sailus-media-tree/streams v6.6-rc6 v6.6-rc5 v6.6-rc4 linus/master v6.6-rc6] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Sakari-Ailus/media-v4l-subdev-Also-return-pads-array-information-on-stream-functions/20231017-120800 base: next-20231016 patch link: https://lore.kernel.org/r/20231013104424.404768-6-sakari.ailus%40linux.intel.com patch subject: [PATCH 5/6] media: v4l: subdev: Switch to stream-aware state functions config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20231017/[email protected]/config) compiler: sparc64-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231017/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/staging/media/imx/imx-ic-prp.c: In function '__prp_get_fmt':
>> drivers/staging/media/imx/imx-ic-prp.c:85:29: warning: unused variable 'ic_priv' [-Wunused-variable]
85 | struct imx_ic_priv *ic_priv = priv->ic_priv;
| ^~~~~~~
--
drivers/staging/media/imx/imx-ic-prpencvf.c: In function '__prp_get_fmt':
>> drivers/staging/media/imx/imx-ic-prpencvf.c:793:29: warning: unused variable 'ic_priv' [-Wunused-variable]
793 | struct imx_ic_priv *ic_priv = priv->ic_priv;
| ^~~~~~~
--
drivers/media/platform/ti/cal/cal-camerarx.c: In function 'cal_camerarx_sd_enum_mbus_code':
>> drivers/media/platform/ti/cal/cal-camerarx.c:624:30: warning: unused variable 'phy' [-Wunused-variable]
624 | struct cal_camerarx *phy = to_cal_camerarx(sd);
| ^~~vim +/ic_priv +85 drivers/staging/media/imx/imx-ic-prp.c
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 80
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 81 static struct v4l2_mbus_framefmt *
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 82 __prp_get_fmt(struct prp_priv *priv, struct v4l2_subdev_state *sd_state,
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 83 unsigned int pad, enum v4l2_subdev_format_whence which)
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 84 {
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 @85 struct imx_ic_priv *ic_priv = priv->ic_priv;
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 86
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 87 if (which == V4L2_SUBDEV_FORMAT_TRY)
95c1b021ae1138 Sakari Ailus 2023-10-13 88 return v4l2_subdev_get_format(sd_state, pad, 0);
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 89 else
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 90 return &priv->format_mbus;
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 91 }
f0d9c8924e2c33 Steve Longerbeam 2017-06-07 92 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Sakari Ailus
maintainerPATCH 6/6 media: v4l: subdev: Remove stream-unaware sub-device state access
In reply to Sakari AilusRemove stream-unaware sub-device state access functions and macros. These are no longer used.
--- include/media/v4l2-subdev.h | 77 ------------------------------------- 1 file changed, 77 deletions(-)
include/media/v4l2-subdev.h +0 -77
@@ -1144,83 +1144,6 @@ struct v4l2_subdev_fh {#define to_v4l2_subdev_fh (fh) \ container_of(fh, struct v4l2_subdev_fh, vfh) -#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API ) - -/** -* v4l2_subdev_get_pad_format - ancillary routine to call -* &struct v4l2_subdev_pad_config->try_fmt -* -* @sd: pointer to &struct v4l2_subdev -* @state: pointer to &struct v4l2_subdev_state -* @pad: index of the pad in the &struct v4l2_subdev_state->pads array -*/ -static inline struct v4l2_mbus_framefmt * -v4l2_subdev_get_pad_format (struct v4l2_subdev *sd, -struct v4l2_subdev_state *state, -unsigned int pad) -{ -if (WARN_ON (!state)) -return NULL ; -if (WARN_ON (pad >= sd->entity.num_pads)) - pad =0 ; -return &state->pads[pad].try_fmt; -} - -/** -* v4l2_subdev_get_pad_crop - ancillary routine to call -* &struct v4l2_subdev_pad_config->try_crop -* -* @sd: pointer to &struct v4l2_subdev -* @state: pointer to &struct v4l2_subdev_state. -* @pad: index of the pad in the &struct v4l2_subdev_state->pads array. -*/ -static inline struct v4l2_rect * -v4l2_subdev_get_pad_crop (struct v4l2_subdev *sd, -struct v4l2_subdev_state *state, -unsigned int pad) -{ -if (WARN_ON (!state)) -return NULL ; -if (WARN_ON (pad >= sd->entity.num_pads)) - pad =0 ; -return &state->pads[pad].try_crop; -} - -/** -* v4l2_subdev_get_pad_compose - ancillary routine to call -* &struct v4l2_subdev_pad_config->try_compose -* -* @sd: pointer to &struct v4l2_subdev -* @state: pointer to &struct v4l2_subdev_state. -* @pad: index of the pad in the &struct v4l2_subdev_state->pads array. -*/ -static inline struct v4l2_rect * -v4l2_subdev_get_pad_compose (struct v4l2_subdev *sd, -struct v4l2_subdev_state *state, -unsigned int pad) -{ -if (WARN_ON (!state)) -return NULL ; -if (WARN_ON (pad >= sd->entity.num_pads)) - pad =0 ; -return &state->pads[pad].try_compose; -} - -/* -* Temprary helpers until uses of v4l2_subdev_get_try_* functions have been -* renamed -*/ -#define v4l2_subdev_get_try_format (sd, state, pad) \ - v4l2_subdev_get_format(state, pad, 0) - -#define v4l2_subdev_get_try_crop (sd, state, pad) \ - v4l2_subdev_get_crop(state, pad, 0) - -#define v4l2_subdev_get_try_compose (sd, state, pad) \ - v4l2_subdev_get_compose(state, pad, 0) - -#endif /* CONFIG_VIDEO_V4L2_SUBDEV_API */ -extern const struct v4l2_file_operations v4l2_subdev_fops;/**
Signature · 1 line
2.39.2