Tool/software:
We used the v4l2 framework to capture the image when debugging the ads6311. Found that there will be frame drop. We further analyzed and found that memcpy copy 3932160 bytes, requiring about 30ms. So the dma rate is suspected to be too slow.
ti_csi2rx0: ticsi2rx@30102000 { compatible = "ti,j721e-csi2rx"; dmas = <&main_bcdma_csi 0 0x5000 15>, <&main_bcdma_csi 0 0x5001 15>, <&main_bcdma_csi 0 0x5002 15>, <&main_bcdma_csi 0 0x5003 15>; dma-names = "rx0", "rx1", "rx2", "rx3"; reg = <0x00 0x30102000 0x00 0x1000>; power-domains = <&k3_pds 182 TI_SCI_PD_EXCLUSIVE>; #address-cells = <2>; #size-cells = <2>; ranges; status = "disabled"; cdns_csi2rx0: csi-bridge@30101000 { compatible = "cdns,csi2rx"; reg = <0x00 0x30101000 0x00 0x1000>; clocks = <&k3_clks 182 0>, <&k3_clks 182 3>, <&k3_clks 182 0>, <&k3_clks 182 0>, <&k3_clks 182 4>, <&k3_clks 182 4>; clock-names = "sys_clk", "p_clk", "pixel_if0_clk", "pixel_if1_clk", "pixel_if2_clk", "pixel_if3_clk"; phys = <&dphy0>; phy-names = "dphy"; power-domains = <&k3_pds 182 TI_SCI_PD_EXCLUSIVE>; ports { #address-cells = <1>; #size-cells = <0>; csi0_port0: port@0 { reg = <0>; status = "disabled"; }; csi0_port1: port@1 { reg = <1>; status = "disabled"; }; csi0_port2: port@2 { reg = <2>; status = "disabled"; }; csi0_port3: port@3 { reg = <3>; status = "disabled"; }; csi0_port4: port@4 { reg = <4>; status = "disabled"; }; }; }; };
We changed the priority to 15。
dmas = <&main_bcdma_csi 0 0x5000 15>, <&main_bcdma_csi 0 0x5001 15>,
<&main_bcdma_csi 0 0x5002 15>, <&main_bcdma_csi 0 0x5003 15>;
After the change, we can't capture the data, the data is 0。What method can dma accelerate。
version:09.02.01.10
vision tiam62p5 linux6.1.83 memcpy耗时测试.txt
[2022-04-28 17:44:01 920.392][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 560 us. [2022-04-28 17:44:01 958.194][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 37 ms 115 us. [2022-04-28 17:44:01 959.249][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 510 us. [2022-04-28 17:44:01 994.379][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 35 ms 370 us. [2022-04-28 17:44:02 041.317][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 835 us. [2022-04-28 17:44:02 072.225][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 110 us. [2022-04-28 17:44:02 072.900][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 760 us. [2022-04-28 17:44:02 101.438][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 155 us. [2022-04-28 17:44:02 143.028][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 255 us. [2022-04-28 17:44:02 173.251][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 825 us. [2022-04-28 17:44:02 174.039][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 320 us. [2022-04-28 17:44:02 202.637][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 715 us. [2022-04-28 17:44:02 245.204][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 335 us. [2022-04-28 17:44:02 275.930][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 955 us. [2022-04-28 17:44:02 276.780][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 920 us. [2022-04-28 17:44:02 305.340][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 335 us. [2022-04-28 17:44:02 346.875][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 720 us. [2022-04-28 17:44:02 376.990][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 29 ms 320 us. [2022-04-28 17:44:02 377.672][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 240 us. [2022-04-28 17:44:02 406.416][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 450 us. [2022-04-28 17:44:02 447.903][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 195 us. [2022-04-28 17:44:02 478.259][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 15 us. [2022-04-28 17:44:02 478.945][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 925 us. [2022-04-28 17:44:02 507.511][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 345 us. [2022-04-28 17:44:02 549.126][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 955 us. [2022-04-28 17:44:02 578.949][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 29 ms 825 us. [2022-04-28 17:44:02 579.633][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 365 us. [2022-04-28 17:44:02 608.172][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 855 us. [2022-04-28 17:44:02 650.507][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 455 us. [2022-04-28 17:44:02 680.743][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 105 us. [2022-04-28 17:44:02 681.429][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 620 us. [2022-04-28 17:44:02 709.895][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 995 us. [2022-04-28 17:44:02 752.961][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 730 us. [2022-04-28 17:44:02 783.158][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 600 us. [2022-04-28 17:44:02 783.845][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 885 us. [2022-04-28 17:44:02 812.118][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 25 us. [2022-04-28 17:44:02 854.308][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 625 us. [2022-04-28 17:44:02 885.009][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 670 us. [2022-04-28 17:44:02 885.753][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 170 us. [2022-04-28 17:44:02 914.381][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 15 us. [2022-04-28 17:44:02 956.523][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 120 us. [2022-04-28 17:44:02 986.671][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 665 us. [2022-04-28 17:44:02 987.366][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 875 us. [2022-04-28 17:44:03 015.852][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 915 us. [2022-04-28 17:44:03 057.990][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 655 us. [2022-04-28 17:44:03 088.190][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 925 us. [2022-04-28 17:44:03 088.873][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 805 us. [2022-04-28 17:44:03 117.190][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 800 us. [2022-04-28 17:44:03 159.169][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 115 us. [2022-04-28 17:44:03 189.846][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 685 us. [2022-04-28 17:44:03 190.557][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 85 us. [2022-04-28 17:44:03 219.153][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 495 us. [2022-04-28 17:44:03 261.196][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 30 us. [2022-04-28 17:44:03 291.418][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 725 us. [2022-04-28 17:44:03 292.128][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 935 us. [2022-04-28 17:44:03 320.719][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 135 us. [2022-04-28 17:44:03 362.983][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 580 us. [2022-04-28 17:44:03 393.157][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 880 us. [2022-04-28 17:44:03 393.907][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 935 us. [2022-04-28 17:44:03 422.383][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 0 us. [2022-04-28 17:44:03 518.561][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 15 us. [2022-04-28 17:44:03 609.015][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 35 ms 770 us. [2022-04-28 17:44:03 666.161][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 585 us. [2022-04-28 17:44:03 763.731][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 40 ms 195 us. [2022-04-28 17:44:03 817.190][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 795 us. [2022-04-28 17:44:03 853.640][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 36 ms 885 us. [2022-04-28 17:44:03 855.050][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 380 us. [2022-04-28 17:44:03 886.012][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 30 ms 995 us. [2022-04-28 17:44:03 931.826][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 490 us. [2022-04-28 17:44:03 962.387][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 710 us. [2022-04-28 17:44:03 963.150][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 245 us. [2022-04-28 17:44:03 992.393][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 29 ms 490 us. [2022-04-28 17:44:04 034.612][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 395 us. [2022-04-28 17:44:04 064.923][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 715 us. [2022-04-28 17:44:04 065.642][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 835 us. [2022-04-28 17:44:04 094.260][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 450 us. [2022-04-28 17:44:04 136.126][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 315 us. [2022-04-28 17:44:04 166.386][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 745 us. [2022-04-28 17:44:04 167.078][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 385 us. [2022-04-28 17:44:04 195.572][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 480 us. [2022-04-28 17:44:04 238.629][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 25 us. [2022-04-28 17:44:04 268.790][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 805 us. [2022-04-28 17:44:04 269.487][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 40 us. [2022-04-28 17:44:04 297.815][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 350 us. [2022-04-28 17:44:04 338.499][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 665 us. [2022-04-28 17:44:04 368.751][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 85 us. [2022-04-28 17:44:04 369.479][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 30 us. [2022-04-28 17:44:04 398.026][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 425 us. [2022-04-28 17:44:04 438.907][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 210 us. [2022-04-28 17:44:04 469.203][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 455 us. [2022-04-28 17:44:04 469.950][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 970 us. [2022-04-28 17:44:04 498.897][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 20 us. [2022-04-28 17:44:04 539.838][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 225 us. [2022-04-28 17:44:04 569.548][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 29 ms 925 us. [2022-04-28 17:44:04 570.289][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 70 us. [2022-04-28 17:44:04 598.621][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 165 us. [2022-04-28 17:44:04 639.239][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 245 us. [2022-04-28 17:44:04 669.562][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 145 us. [2022-04-28 17:44:04 670.314][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 285 us. [2022-04-28 17:44:04 698.877][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 440 us. [2022-04-28 17:44:04 739.503][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 355 us. [2022-04-28 17:44:04 769.293][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 29 ms 995 us. [2022-04-28 17:44:04 770.067][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 915 us. [2022-04-28 17:44:04 798.622][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 150 us. [2022-04-28 17:44:04 839.169][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 185 us. [2022-04-28 17:44:04 868.976][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 29 ms 570 us. [2022-04-28 17:44:04 869.661][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 930 us. [2022-04-28 17:44:04 898.051][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 545 us. [2022-04-28 17:44:04 938.565][v4l2halapi_cap][callback_process][313]:/dev/video2 copy size 1280 cost: 0 ms 810 us. [2022-04-28 17:44:04 968.780][v4l2halapi_cap][callback_process][313]:/dev/video0 copy size 3932160 cost: 30 ms 180 us. [2022-04-28 17:44:04 969.468][v4l2halapi_cap][callback_process][313]:/dev/video3 copy size 1280 cost: 0 ms 915 us. [2022-04-28 17:44:04 998.033][v4l2halapi_cap][callback_process][313]:/dev/video1 copy size 3932160 cost: 28 ms 565 us.
please help!thank!