From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB

---
 kernel/drivers/media/platform/rockchip/cif/procfs.c |   66 ++++++++++++++++++++++++--------
 1 files changed, 49 insertions(+), 17 deletions(-)

diff --git a/kernel/drivers/media/platform/rockchip/cif/procfs.c b/kernel/drivers/media/platform/rockchip/cif/procfs.c
index 3c6955b..d9f063f 100644
--- a/kernel/drivers/media/platform/rockchip/cif/procfs.c
+++ b/kernel/drivers/media/platform/rockchip/cif/procfs.c
@@ -8,7 +8,6 @@
 #include <linux/spinlock.h>
 #include <linux/v4l2-mediabus.h>
 
-#include "hw.h"
 #include "dev.h"
 #include "procfs.h"
 
@@ -224,7 +223,7 @@
 		   dev->workmode == RKCIF_WORKMODE_ONEFRAME ? "one frame" :
 		   dev->workmode == RKCIF_WORKMODE_PINGPONG ? "ping pong" : "line loop");
 
-	monitor_mode = dev->hw_dev->hw_timer.monitor_mode;
+	monitor_mode = dev->reset_watchdog_timer.monitor_mode;
 	seq_printf(f, "Monitor Mode:%s\n",
 		   rkcif_get_monitor_mode(monitor_mode));
 }
@@ -272,7 +271,8 @@
 				   mbus_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH ? "high active" : "low active");
 		} else {
 			seq_printf(f, "\tinterface:%s\n",
-				   sensor->mbus.type == V4L2_MBUS_CSI2 ? "mipi csi2" :
+				   sensor->mbus.type == V4L2_MBUS_CSI2_DPHY ? "mipi csi2 dphy" :
+				   sensor->mbus.type == V4L2_MBUS_CSI2_CPHY ? "mipi csi2 cphy" :
 				   sensor->mbus.type == V4L2_MBUS_CCP2 ? "lvds" : "unknown");
 			seq_printf(f, "\tlanes:%d\n", sensor->lanes);
 			seq_puts(f, "\tvc channel:");
@@ -288,8 +288,9 @@
 		}
 
 		seq_printf(f, "\thdr mode: %s\n",
-			   dev->hdr.mode == NO_HDR ? "normal" :
-			   dev->hdr.mode == HDR_X2 ? "hdr_x2" : "hdr_x3");
+			   dev->hdr.hdr_mode == NO_HDR ? "normal" :
+			   dev->hdr.hdr_mode == HDR_COMPR ? "hdr_compr" :
+			   dev->hdr.hdr_mode == HDR_X2 ? "hdr_x2" : "hdr_x3");
 
 		seq_printf(f, "\tformat:%s/%ux%u@%d\n",
 			   rkcif_pixelcode_to_string(stream->cif_fmt_in->mbus_code),
@@ -314,11 +315,12 @@
 			   dev->channels[0].width, dev->channels[0].height,
 			   dev->channels[0].crop_st_x, dev->channels[0].crop_st_y);
 		seq_printf(f, "\tcompact:%s\n", stream->is_compact ? "enable" : "disabled");
-		seq_printf(f, "\tframe amount:%d\n", stream->frame_idx);
+		seq_printf(f, "\tframe amount:%d\n", stream->frame_idx - 1);
 		if (dev->inf_id == RKCIF_MIPI_LVDS) {
 			time_val = div_u64(stream->readout.early_time, 1000000);
 			seq_printf(f, "\tearly:%u ms\n", time_val);
-			if (dev->hdr.mode == NO_HDR) {
+			if (dev->hdr.hdr_mode == NO_HDR ||
+			    dev->hdr.hdr_mode == HDR_COMPR) {
 				time_val = div_u64(stream->readout.readout_time, 1000000);
 				seq_printf(f, "\treadout:%u ms\n", time_val);
 			} else {
@@ -334,20 +336,51 @@
 		seq_printf(f, "\tfps:%llu\n", fps);
 		seq_puts(f, "\tirq statistics:\n");
 		seq_printf(f, "\t\t\ttotal:%llu\n",
-			   dev->irq_stats.all_frm_end_cnt + dev->irq_stats.all_err_cnt);
+			   dev->irq_stats.frm_end_cnt[0] +
+			   dev->irq_stats.frm_end_cnt[1] +
+			   dev->irq_stats.frm_end_cnt[2] +
+			   dev->irq_stats.frm_end_cnt[3] +
+			   dev->irq_stats.all_err_cnt);
 		if (sensor->mbus.type == V4L2_MBUS_PARALLEL ||
 		    sensor->mbus.type == V4L2_MBUS_BT656) {
 			seq_printf(f, "\t\t\tdvp bus err:%llu\n", dev->irq_stats.dvp_bus_err_cnt);
 			seq_printf(f, "\t\t\tdvp pix err:%llu\n", dev->irq_stats.dvp_pix_err_cnt);
 			seq_printf(f, "\t\t\tdvp line err:%llu\n", dev->irq_stats.dvp_line_err_cnt);
 			seq_printf(f, "\t\t\tdvp over flow:%llu\n", dev->irq_stats.dvp_overflow_cnt);
+			seq_printf(f, "\t\t\tdvp bandwidth lack:%llu\n",
+				   dev->irq_stats.dvp_bwidth_lack_cnt);
+			seq_printf(f, "\t\t\tdvp size err:%llu\n", dev->irq_stats.dvp_size_err_cnt);
 		} else {
 			seq_printf(f, "\t\t\tcsi over flow:%llu\n", dev->irq_stats.csi_overflow_cnt);
-			seq_printf(f, "\t\t\tcsi bandwidth lack:%llu\n", dev->irq_stats.csi_bwidth_lack_cnt);
-
+			seq_printf(f, "\t\t\tcsi bandwidth lack:%llu\n",
+				   dev->irq_stats.csi_bwidth_lack_cnt);
+			seq_printf(f, "\t\t\tcsi size err:%llu\n", dev->irq_stats.csi_size_err_cnt);
 		}
+		seq_printf(f, "\t\t\tnot active buf cnt:%llu %llu %llu %llu\n",
+			   dev->irq_stats.not_active_buf_cnt[0],
+			   dev->irq_stats.not_active_buf_cnt[1],
+			   dev->irq_stats.not_active_buf_cnt[2],
+			   dev->irq_stats.not_active_buf_cnt[3]);
 		seq_printf(f, "\t\t\tall err count:%llu\n", dev->irq_stats.all_err_cnt);
-		seq_printf(f, "\t\t\tframe dma end:%llu\n", dev->irq_stats.all_frm_end_cnt);
+		seq_printf(f, "\t\t\tframe dma end:%llu %llu %llu %llu\n",
+			   dev->irq_stats.frm_end_cnt[0],
+			   dev->irq_stats.frm_end_cnt[1],
+			   dev->irq_stats.frm_end_cnt[2],
+			   dev->irq_stats.frm_end_cnt[3]);
+		seq_printf(f, "irq time: %llu ns\n", dev->hw_dev->irq_time);
+		seq_printf(f, "dma enable: 0x%x 0x%x 0x%x 0x%x\n",
+			   dev->stream[0].dma_en, dev->stream[1].dma_en,
+			   dev->stream[2].dma_en, dev->stream[3].dma_en);
+		seq_printf(f, "buf_cnt in drv: %d %d %d %d\n",
+			   atomic_read(&dev->stream[0].buf_cnt),
+			   atomic_read(&dev->stream[1].buf_cnt),
+			   atomic_read(&dev->stream[2].buf_cnt),
+			   atomic_read(&dev->stream[3].buf_cnt));
+		seq_printf(f, "total buf_cnt: %d %d %d %d\n",
+			   dev->stream[0].total_buf_num,
+			   dev->stream[1].total_buf_num,
+			   dev->stream[2].total_buf_num,
+			   dev->stream[3].total_buf_num);
 	}
 }
 
@@ -373,12 +406,11 @@
 	return single_open(file, rkcif_proc_show, data);
 }
 
-static const struct file_operations rkcif_proc_fops = {
-	.owner = THIS_MODULE,
-	.open = rkcif_proc_open,
-	.release = single_release,
-	.read = seq_read,
-	.llseek = seq_lseek,
+static const struct proc_ops rkcif_proc_fops = {
+	.proc_open = rkcif_proc_open,
+	.proc_release = single_release,
+	.proc_read = seq_read,
+	.proc_lseek = seq_lseek,
 };
 
 int rkcif_proc_init(struct rkcif_device *dev)

--
Gitblit v1.6.2