2023-06-19 11:47:02

by Tomi Valkeinen

[permalink] [raw]
Subject: [PATCH 3/3] media: subdev: Add debug prints to enable/disable_streams

It is often useful to see when streaming for a device is being enabled
or disabled. Add debug prints for this to v4l2_subdev_enable_streams()
and v4l2_subdev_disable_streams().

Signed-off-by: Tomi Valkeinen <[email protected]>
---
drivers/media/v4l2-core/v4l2-subdev.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 73f716a42569..0f86a165b202 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -1977,11 +1977,16 @@ int v4l2_subdev_enable_streams(struct v4l2_subdev *sd, u32 pad,
goto done;
}

+ dev_dbg(dev, "enable streams %u:%#llx\n", pad, streams_mask);
+
/* Call the .enable_streams() operation. */
ret = v4l2_subdev_call(sd, pad, enable_streams, state, pad,
streams_mask);
- if (ret)
+ if (ret) {
+ dev_dbg(dev, "enable streams %u:%#llx failed: %d\n", pad,
+ streams_mask, ret);
goto done;
+ }

/* Mark the streams as enabled. */
for (i = 0; i < state->stream_configs.num_configs; ++i) {
@@ -2089,11 +2094,16 @@ int v4l2_subdev_disable_streams(struct v4l2_subdev *sd, u32 pad,
goto done;
}

+ dev_dbg(dev, "disable streams %u:%#llx\n", pad, streams_mask);
+
/* Call the .disable_streams() operation. */
ret = v4l2_subdev_call(sd, pad, disable_streams, state, pad,
streams_mask);
- if (ret)
+ if (ret) {
+ dev_dbg(dev, "disable streams %u:%#llx failed: %d\n", pad,
+ streams_mask, ret);
goto done;
+ }

/* Mark the streams as disabled. */
for (i = 0; i < state->stream_configs.num_configs; ++i) {
--
2.34.1



2023-07-17 14:32:59

by Jacopo Mondi

[permalink] [raw]
Subject: Re: [PATCH 3/3] media: subdev: Add debug prints to enable/disable_streams

Hi Tomi

On Mon, Jun 19, 2023 at 02:27:07PM +0300, Tomi Valkeinen wrote:
> It is often useful to see when streaming for a device is being enabled
> or disabled. Add debug prints for this to v4l2_subdev_enable_streams()
> and v4l2_subdev_disable_streams().
>
> Signed-off-by: Tomi Valkeinen <[email protected]>
> ---
> drivers/media/v4l2-core/v4l2-subdev.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> index 73f716a42569..0f86a165b202 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -1977,11 +1977,16 @@ int v4l2_subdev_enable_streams(struct v4l2_subdev *sd, u32 pad,
> goto done;
> }
>
> + dev_dbg(dev, "enable streams %u:%#llx\n", pad, streams_mask);

With the use of the # incantation clarified offline:

Reviewed-by: Jacopo Mondi <[email protected]>


> +
> /* Call the .enable_streams() operation. */
> ret = v4l2_subdev_call(sd, pad, enable_streams, state, pad,
> streams_mask);
> - if (ret)
> + if (ret) {
> + dev_dbg(dev, "enable streams %u:%#llx failed: %d\n", pad,
> + streams_mask, ret);
> goto done;
> + }
>
> /* Mark the streams as enabled. */
> for (i = 0; i < state->stream_configs.num_configs; ++i) {
> @@ -2089,11 +2094,16 @@ int v4l2_subdev_disable_streams(struct v4l2_subdev *sd, u32 pad,
> goto done;
> }
>
> + dev_dbg(dev, "disable streams %u:%#llx\n", pad, streams_mask);
> +
> /* Call the .disable_streams() operation. */
> ret = v4l2_subdev_call(sd, pad, disable_streams, state, pad,
> streams_mask);
> - if (ret)
> + if (ret) {
> + dev_dbg(dev, "disable streams %u:%#llx failed: %d\n", pad,
> + streams_mask, ret);
> goto done;
> + }
>
> /* Mark the streams as disabled. */
> for (i = 0; i < state->stream_configs.num_configs; ++i) {
> --
> 2.34.1
>