media: rkisp1: debug: Count completed frame interrupts
authorPaul Elder <paul.elder@ideasonboard.com>
Fri, 1 Dec 2023 14:04:32 +0000 (15:04 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 9 Dec 2023 06:46:41 +0000 (07:46 +0100)
Add a counter to debugfs to count the number of frame-end interrupts.

Link: https://lore.kernel.org/r/20231201140433.2126011-4-paul.elder@ideasonboard.com
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c

index 2d7f06281c390efff5df79da783454c9f4afef71..4b6b28c05b8916b7e5e079b6d2791009907c22db 100644 (file)
@@ -425,6 +425,7 @@ struct rkisp1_debug {
        unsigned long stats_error;
        unsigned long stop_timeout[2];
        unsigned long frame_drop[2];
+       unsigned long complete_frames;
 };
 
 /*
index d2fbed42164e641b98f345418db0e9a9cd14eb2c..79cda589d935ea22ed2cd49e09726324b7f107ca 100644 (file)
@@ -221,6 +221,8 @@ void rkisp1_debug_init(struct rkisp1_device *rkisp1)
                             &debug->frame_drop[RKISP1_MAINPATH]);
        debugfs_create_ulong("sp_frame_drop", 0444, debug->debugfs_dir,
                             &debug->frame_drop[RKISP1_SELFPATH]);
+       debugfs_create_ulong("complete_frames", 0444, debug->debugfs_dir,
+                            &debug->complete_frames);
        debugfs_create_file("input_status", 0444, debug->debugfs_dir, rkisp1,
                            &rkisp1_debug_input_status_fops);
 
index da313f87e248a1d9538dd245706b6f8bb9013766..f00873d31c42b702d239e9e9fefcb8eddb599275 100644 (file)
@@ -1009,6 +1009,8 @@ irqreturn_t rkisp1_isp_isr(int irq, void *ctx)
        if (status & RKISP1_CIF_ISP_FRAME) {
                u32 isp_ris;
 
+               rkisp1->debug.complete_frames++;
+
                /* New frame from the sensor received */
                isp_ris = rkisp1_read(rkisp1, RKISP1_CIF_ISP_RIS);
                if (isp_ris & RKISP1_STATS_MEAS_MASK)