[v6,11/11] media: subdev: Improve s_stream documentation

Message ID 20240424-enable-streams-impro-v6-11-5fb14c20147d@ideasonboard.com (mailing list archive)
State Accepted
Headers
Series media: subdev: Improve stream enable/disable machinery |

Commit Message

Tomi Valkeinen April 24, 2024, 3:39 p.m. UTC
  Now that enable/disable_streams operations are available for
single-stream subdevices too, there's no reason to use the old s_stream
operation on new drivers. Extend the documentation reflecting this.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 include/media/v4l2-subdev.h | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Umang Jain April 24, 2024, 4:33 p.m. UTC | #1
Hi Tomi,

On 24/04/24 9:09 pm, Tomi Valkeinen wrote:
> Now that enable/disable_streams operations are available for
> single-stream subdevices too, there's no reason to use the old s_stream
> operation on new drivers. Extend the documentation reflecting this.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

Reviewed-by: Umang Jain<umang.jain@ideasonboard.com>

> ---
>   include/media/v4l2-subdev.h | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index 14a3c91cce93..99564a2ef71c 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -450,6 +450,15 @@ enum v4l2_subdev_pre_streamon_flags {
>    *	already started or stopped subdev. Also see call_s_stream wrapper in
>    *	v4l2-subdev.c.
>    *
> + *	New drivers should instead implement &v4l2_subdev_pad_ops.enable_streams
> + *	and &v4l2_subdev_pad_ops.disable_streams operations, and use
> + *	v4l2_subdev_s_stream_helper for the &v4l2_subdev_video_ops.s_stream
> + *	operation to support legacy users.
> + *
> + *	Drivers should also not call the .s_stream() subdev operation directly,
> + *	but use the v4l2_subdev_enable_streams() and
> + *	v4l2_subdev_disable_streams() helpers.
> + *
>    * @g_pixelaspect: callback to return the pixelaspect ratio.
>    *
>    * @s_rx_buffer: set a host allocated memory buffer for the subdev. The subdev
>
  
Laurent Pinchart April 25, 2024, 11:08 a.m. UTC | #2
Hi Tomi,

Thank you for the patch.

On Wed, Apr 24, 2024 at 06:39:14PM +0300, Tomi Valkeinen wrote:
> Now that enable/disable_streams operations are available for
> single-stream subdevices too, there's no reason to use the old s_stream
> operation on new drivers. Extend the documentation reflecting this.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  include/media/v4l2-subdev.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index 14a3c91cce93..99564a2ef71c 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -450,6 +450,15 @@ enum v4l2_subdev_pre_streamon_flags {
>   *	already started or stopped subdev. Also see call_s_stream wrapper in
>   *	v4l2-subdev.c.
>   *
> + *	New drivers should instead implement &v4l2_subdev_pad_ops.enable_streams
> + *	and &v4l2_subdev_pad_ops.disable_streams operations, and use
> + *	v4l2_subdev_s_stream_helper for the &v4l2_subdev_video_ops.s_stream
> + *	operation to support legacy users.
> + *
> + *	Drivers should also not call the .s_stream() subdev operation directly,
> + *	but use the v4l2_subdev_enable_streams() and
> + *	v4l2_subdev_disable_streams() helpers.
> + *
>   * @g_pixelaspect: callback to return the pixelaspect ratio.
>   *
>   * @s_rx_buffer: set a host allocated memory buffer for the subdev. The subdev
  
Sakari Ailus April 25, 2024, 11:15 a.m. UTC | #3
Hi Laurent, others,

On Thu, Apr 25, 2024 at 02:08:54PM +0300, Laurent Pinchart wrote:
> Hi Tomi,
> 
> Thank you for the patch.
> 
> On Wed, Apr 24, 2024 at 06:39:14PM +0300, Tomi Valkeinen wrote:
> > Now that enable/disable_streams operations are available for
> > single-stream subdevices too, there's no reason to use the old s_stream
> > operation on new drivers. Extend the documentation reflecting this.
> > 
> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks!

If there are no further comments requiring changes, I'll send a PR on these
with Umang's imx335 and my CCS driver patches tomorrow.
  

Patch

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 14a3c91cce93..99564a2ef71c 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -450,6 +450,15 @@  enum v4l2_subdev_pre_streamon_flags {
  *	already started or stopped subdev. Also see call_s_stream wrapper in
  *	v4l2-subdev.c.
  *
+ *	New drivers should instead implement &v4l2_subdev_pad_ops.enable_streams
+ *	and &v4l2_subdev_pad_ops.disable_streams operations, and use
+ *	v4l2_subdev_s_stream_helper for the &v4l2_subdev_video_ops.s_stream
+ *	operation to support legacy users.
+ *
+ *	Drivers should also not call the .s_stream() subdev operation directly,
+ *	but use the v4l2_subdev_enable_streams() and
+ *	v4l2_subdev_disable_streams() helpers.
+ *
  * @g_pixelaspect: callback to return the pixelaspect ratio.
  *
  * @s_rx_buffer: set a host allocated memory buffer for the subdev. The subdev