diff mbox series

[6/6] media: staging: rkisp1: cap: add warning when link validation fails

Message ID 20201002184222.7094-7-dafna.hirschfeld@collabora.com (mailing list archive)
State New, archived
Headers show
Series media: staging: rkisp1: improvements | expand

Commit Message

Dafna Hirschfeld Oct. 2, 2020, 6:42 p.m. UTC
The link validation between the capture and resizer might
fail because of various reasons. Add an informative warning
to make it easier to debug.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 drivers/staging/media/rkisp1/rkisp1-capture.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart Oct. 2, 2020, 7:26 p.m. UTC | #1
Hi Dafna,

Thank you for the patch.

On Fri, Oct 02, 2020 at 08:42:22PM +0200, Dafna Hirschfeld wrote:
> The link validation between the capture and resizer might
> fail because of various reasons. Add an informative warning
> to make it easier to debug.
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
> ---
>  drivers/staging/media/rkisp1/rkisp1-capture.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c
> index 9b4a12e13f13..75321280ebf0 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-capture.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c
> @@ -1269,8 +1269,16 @@ static int rkisp1_capture_link_validate(struct media_link *link)
>  
>  	if (sd_fmt.format.height != cap->pix.fmt.height ||
>  	    sd_fmt.format.width != cap->pix.fmt.width ||
> -	    sd_fmt.format.code != fmt->mbus)
> +	    sd_fmt.format.code != fmt->mbus) {
> +		dev_warn(cap->rkisp1->dev,

I'd make this dev_dbg().

> +			 "%s: failed for '%s' sd:cap: height %u:%u, width %u:%u mbus: 0x%x:0x%x\n",
> +			 __func__,
> +			 cap->vnode.vdev.name,
> +			 sd_fmt.format.height, cap->pix.fmt.height,
> +			 sd_fmt.format.width, cap->pix.fmt.width,
> +			 sd_fmt.format.code, fmt->mbus);
>  		return -EPIPE;
> +	}
>  
>  	return 0;
>  }
diff mbox series

Patch

diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c
index 9b4a12e13f13..75321280ebf0 100644
--- a/drivers/staging/media/rkisp1/rkisp1-capture.c
+++ b/drivers/staging/media/rkisp1/rkisp1-capture.c
@@ -1269,8 +1269,16 @@  static int rkisp1_capture_link_validate(struct media_link *link)
 
 	if (sd_fmt.format.height != cap->pix.fmt.height ||
 	    sd_fmt.format.width != cap->pix.fmt.width ||
-	    sd_fmt.format.code != fmt->mbus)
+	    sd_fmt.format.code != fmt->mbus) {
+		dev_warn(cap->rkisp1->dev,
+			 "%s: failed for '%s' sd:cap: height %u:%u, width %u:%u mbus: 0x%x:0x%x\n",
+			 __func__,
+			 cap->vnode.vdev.name,
+			 sd_fmt.format.height, cap->pix.fmt.height,
+			 sd_fmt.format.width, cap->pix.fmt.width,
+			 sd_fmt.format.code, fmt->mbus);
 		return -EPIPE;
+	}
 
 	return 0;
 }