media: rkisp1: cap: Print debug message on failed link validation
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 14 Jun 2022 19:10:42 +0000 (20:10 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 17 Jul 2022 11:02:04 +0000 (12:02 +0100)
When a link validation failure occurs, print a debug message to help
diagnosing the cause.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c

index 94819e6c23e2b8052b60e7b068b41f979295ad53..fb14c8aa154caecc47cf51891ad1c998e1eaf42f 100644 (file)
@@ -1294,8 +1294,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_dbg(cap->rkisp1->dev,
+                       "link '%s':%u -> '%s':%u not valid: 0x%04x/%ux%u != 0x%04x/%ux%u\n",
+                       link->source->entity->name, link->source->index,
+                       link->sink->entity->name, link->sink->index,
+                       sd_fmt.format.code, sd_fmt.format.width,
+                       sd_fmt.format.height, fmt->mbus, cap->pix.fmt.width,
+                       cap->pix.fmt.height);
                return -EPIPE;
+       }
 
        return 0;
 }