forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/media/platform/rockchip/cif/procfs.c
....@@ -8,7 +8,6 @@
88 #include <linux/spinlock.h>
99 #include <linux/v4l2-mediabus.h>
1010
11
-#include "hw.h"
1211 #include "dev.h"
1312 #include "procfs.h"
1413
....@@ -224,7 +223,7 @@
224223 dev->workmode == RKCIF_WORKMODE_ONEFRAME ? "one frame" :
225224 dev->workmode == RKCIF_WORKMODE_PINGPONG ? "ping pong" : "line loop");
226225
227
- monitor_mode = dev->hw_dev->hw_timer.monitor_mode;
226
+ monitor_mode = dev->reset_watchdog_timer.monitor_mode;
228227 seq_printf(f, "Monitor Mode:%s\n",
229228 rkcif_get_monitor_mode(monitor_mode));
230229 }
....@@ -272,7 +271,8 @@
272271 mbus_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH ? "high active" : "low active");
273272 } else {
274273 seq_printf(f, "\tinterface:%s\n",
275
- sensor->mbus.type == V4L2_MBUS_CSI2 ? "mipi csi2" :
274
+ sensor->mbus.type == V4L2_MBUS_CSI2_DPHY ? "mipi csi2 dphy" :
275
+ sensor->mbus.type == V4L2_MBUS_CSI2_CPHY ? "mipi csi2 cphy" :
276276 sensor->mbus.type == V4L2_MBUS_CCP2 ? "lvds" : "unknown");
277277 seq_printf(f, "\tlanes:%d\n", sensor->lanes);
278278 seq_puts(f, "\tvc channel:");
....@@ -288,8 +288,9 @@
288288 }
289289
290290 seq_printf(f, "\thdr mode: %s\n",
291
- dev->hdr.mode == NO_HDR ? "normal" :
292
- dev->hdr.mode == HDR_X2 ? "hdr_x2" : "hdr_x3");
291
+ dev->hdr.hdr_mode == NO_HDR ? "normal" :
292
+ dev->hdr.hdr_mode == HDR_COMPR ? "hdr_compr" :
293
+ dev->hdr.hdr_mode == HDR_X2 ? "hdr_x2" : "hdr_x3");
293294
294295 seq_printf(f, "\tformat:%s/%ux%u@%d\n",
295296 rkcif_pixelcode_to_string(stream->cif_fmt_in->mbus_code),
....@@ -314,11 +315,12 @@
314315 dev->channels[0].width, dev->channels[0].height,
315316 dev->channels[0].crop_st_x, dev->channels[0].crop_st_y);
316317 seq_printf(f, "\tcompact:%s\n", stream->is_compact ? "enable" : "disabled");
317
- seq_printf(f, "\tframe amount:%d\n", stream->frame_idx);
318
+ seq_printf(f, "\tframe amount:%d\n", stream->frame_idx - 1);
318319 if (dev->inf_id == RKCIF_MIPI_LVDS) {
319320 time_val = div_u64(stream->readout.early_time, 1000000);
320321 seq_printf(f, "\tearly:%u ms\n", time_val);
321
- if (dev->hdr.mode == NO_HDR) {
322
+ if (dev->hdr.hdr_mode == NO_HDR ||
323
+ dev->hdr.hdr_mode == HDR_COMPR) {
322324 time_val = div_u64(stream->readout.readout_time, 1000000);
323325 seq_printf(f, "\treadout:%u ms\n", time_val);
324326 } else {
....@@ -334,20 +336,51 @@
334336 seq_printf(f, "\tfps:%llu\n", fps);
335337 seq_puts(f, "\tirq statistics:\n");
336338 seq_printf(f, "\t\t\ttotal:%llu\n",
337
- dev->irq_stats.all_frm_end_cnt + dev->irq_stats.all_err_cnt);
339
+ dev->irq_stats.frm_end_cnt[0] +
340
+ dev->irq_stats.frm_end_cnt[1] +
341
+ dev->irq_stats.frm_end_cnt[2] +
342
+ dev->irq_stats.frm_end_cnt[3] +
343
+ dev->irq_stats.all_err_cnt);
338344 if (sensor->mbus.type == V4L2_MBUS_PARALLEL ||
339345 sensor->mbus.type == V4L2_MBUS_BT656) {
340346 seq_printf(f, "\t\t\tdvp bus err:%llu\n", dev->irq_stats.dvp_bus_err_cnt);
341347 seq_printf(f, "\t\t\tdvp pix err:%llu\n", dev->irq_stats.dvp_pix_err_cnt);
342348 seq_printf(f, "\t\t\tdvp line err:%llu\n", dev->irq_stats.dvp_line_err_cnt);
343349 seq_printf(f, "\t\t\tdvp over flow:%llu\n", dev->irq_stats.dvp_overflow_cnt);
350
+ seq_printf(f, "\t\t\tdvp bandwidth lack:%llu\n",
351
+ dev->irq_stats.dvp_bwidth_lack_cnt);
352
+ seq_printf(f, "\t\t\tdvp size err:%llu\n", dev->irq_stats.dvp_size_err_cnt);
344353 } else {
345354 seq_printf(f, "\t\t\tcsi over flow:%llu\n", dev->irq_stats.csi_overflow_cnt);
346
- seq_printf(f, "\t\t\tcsi bandwidth lack:%llu\n", dev->irq_stats.csi_bwidth_lack_cnt);
347
-
355
+ seq_printf(f, "\t\t\tcsi bandwidth lack:%llu\n",
356
+ dev->irq_stats.csi_bwidth_lack_cnt);
357
+ seq_printf(f, "\t\t\tcsi size err:%llu\n", dev->irq_stats.csi_size_err_cnt);
348358 }
359
+ seq_printf(f, "\t\t\tnot active buf cnt:%llu %llu %llu %llu\n",
360
+ dev->irq_stats.not_active_buf_cnt[0],
361
+ dev->irq_stats.not_active_buf_cnt[1],
362
+ dev->irq_stats.not_active_buf_cnt[2],
363
+ dev->irq_stats.not_active_buf_cnt[3]);
349364 seq_printf(f, "\t\t\tall err count:%llu\n", dev->irq_stats.all_err_cnt);
350
- seq_printf(f, "\t\t\tframe dma end:%llu\n", dev->irq_stats.all_frm_end_cnt);
365
+ seq_printf(f, "\t\t\tframe dma end:%llu %llu %llu %llu\n",
366
+ dev->irq_stats.frm_end_cnt[0],
367
+ dev->irq_stats.frm_end_cnt[1],
368
+ dev->irq_stats.frm_end_cnt[2],
369
+ dev->irq_stats.frm_end_cnt[3]);
370
+ seq_printf(f, "irq time: %llu ns\n", dev->hw_dev->irq_time);
371
+ seq_printf(f, "dma enable: 0x%x 0x%x 0x%x 0x%x\n",
372
+ dev->stream[0].dma_en, dev->stream[1].dma_en,
373
+ dev->stream[2].dma_en, dev->stream[3].dma_en);
374
+ seq_printf(f, "buf_cnt in drv: %d %d %d %d\n",
375
+ atomic_read(&dev->stream[0].buf_cnt),
376
+ atomic_read(&dev->stream[1].buf_cnt),
377
+ atomic_read(&dev->stream[2].buf_cnt),
378
+ atomic_read(&dev->stream[3].buf_cnt));
379
+ seq_printf(f, "total buf_cnt: %d %d %d %d\n",
380
+ dev->stream[0].total_buf_num,
381
+ dev->stream[1].total_buf_num,
382
+ dev->stream[2].total_buf_num,
383
+ dev->stream[3].total_buf_num);
351384 }
352385 }
353386
....@@ -373,12 +406,11 @@
373406 return single_open(file, rkcif_proc_show, data);
374407 }
375408
376
-static const struct file_operations rkcif_proc_fops = {
377
- .owner = THIS_MODULE,
378
- .open = rkcif_proc_open,
379
- .release = single_release,
380
- .read = seq_read,
381
- .llseek = seq_lseek,
409
+static const struct proc_ops rkcif_proc_fops = {
410
+ .proc_open = rkcif_proc_open,
411
+ .proc_release = single_release,
412
+ .proc_read = seq_read,
413
+ .proc_lseek = seq_lseek,
382414 };
383415
384416 int rkcif_proc_init(struct rkcif_device *dev)