diff mbox series

[v1.1,6/8] media: renesas: vsp1: Print debug message to diagnose validation failure

Message ID 20240619223915.7183-1-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New
Headers show
Series None | expand

Commit Message

Laurent Pinchart June 19, 2024, 10:39 p.m. UTC
When formats don't match between a subdev and a connected video device,
starting streaming returns an error without giving the user any
indication as to what went wrong. To help debugging pipeline
misconfigurations, add a debug message that indicates the cause of the
failure.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
Changes since v1:

- Replace -EINVAL with -EPIPE
---
 drivers/media/platform/renesas/vsp1/vsp1_video.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/platform/renesas/vsp1/vsp1_video.c b/drivers/media/platform/renesas/vsp1/vsp1_video.c
index 5a9cb0e5640e..28cee0304e77 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_video.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_video.c
@@ -78,8 +78,14 @@  static int vsp1_video_verify_format(struct vsp1_video *video)
 
 	if (video->rwpf->fmtinfo->mbus != fmt.format.code ||
 	    video->rwpf->format.height != fmt.format.height ||
-	    video->rwpf->format.width != fmt.format.width)
-		return -EINVAL;
+	    video->rwpf->format.width != fmt.format.width) {
+		dev_dbg(video->vsp1->dev,
+			"Format mismatch: 0x%04x/%ux%u != 0x%04x/%ux%u\n",
+			video->rwpf->fmtinfo->mbus, video->rwpf->format.width,
+			video->rwpf->format.height, fmt.format.code,
+			fmt.format.width, fmt.format.height);
+		return -EPIPE;
+	}
 
 	return 0;
 }