recentlly we have a driver tc358743 requirement
I have following the doc about https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3271/#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera_sensor_prog.48.1.html#
and implement the v4l2 driver v1
I have successfully get the /dev/video0 and check the hdmi input are succesfully capture
mmc@ubuntu:~$ sudo v4l2-ctl --log-status -d /dev/video0
[sudo] password for mmc:
Status Log:
[ 1796.285802] tegra194-vi5 15c10000.vi: ================= START STATUS =================
[ 1796.293047] tc358743 2-000f: tc358743_get_edid i2c_rd return 0
[ 1796.293057] tc358743 2-000f: tc358743_get_edid done
[ 1796.293064] tc358743 2-000f: -----Chip status-----
[ 1796.293282] tc358743 2-000f: Chip ID:0x00
[ 1796.293500] tc358743 2-000f: Chip revision:0x00
[ 1796.293546] tc358743 2-000f: Reset: IR: 1, CEC: 1, CSI TX: 0, HDMI: 0
[ 1796.293552] tc358743 2-000f: Sleep mode: off
[ 1796.293558] tc358743 2-000f: Cable detected (+5V power): yes
[ 1796.293743] tc358743 2-000f: DDC lines enabled: yes
[ 1796.293927] tc358743 2-000f: Hotplug enabled: yes
[ 1796.294143] tc358743 2-000f: CEC enabled: no
[ 1796.294150] tc358743 2-000f: -----Signal status-----
[ 1796.294155] tc358743 2-000f: TMDS signal detected: yes
[ 1796.294161] tc358743 2-000f: Stable sync signal: yes
[ 1796.294166] tc358743 2-000f: PHY PLL locked: yes
[ 1796.294172] tc358743 2-000f: PHY DE detected: yes
[ 1796.296605] tc358743 2-000f: 458:tc358743_get_detected_timings: width 1920 heigh 1080 interlaced 0
[ 1796.296619] tc358743 2-000f: Detected format: 1920x1080p60.0 (2200x1125)
[ 1796.296627] tc358743 2-000f: horizontal: fp = 0, -sync = 280, bp = 0
[ 1796.296634] tc358743 2-000f: vertical: fp = 0, -sync = 45, bp = 0
[ 1796.296642] tc358743 2-000f: pixelclock: 148500000
[ 1796.296652] tc358743 2-000f: flags (0x0):
[ 1796.296659] tc358743 2-000f: standards (0x0):
[ 1796.296667] tc358743 2-000f: Configured format: 1920x1080p60.0 (2200x1125)
[ 1796.296674] tc358743 2-000f: horizontal: fp = 88, +sync = 44, bp = 148
[ 1796.296680] tc358743 2-000f: vertical: fp = 4, +sync = 5, bp = 36
[ 1796.296687] tc358743 2-000f: pixelclock: 148500000
[ 1796.296696] tc358743 2-000f: flags (0x12): CAN_REDUCE_FPS CE_VIDEO
[ 1796.296702] tc358743 2-000f: standards (0x3): CEA DMT
[ 1796.296708] tc358743 2-000f: -----CSI-TX status-----
[ 1796.296715] tc358743 2-000f: Lanes needed: 2
[ 1796.296981] tc358743 2-000f: Lanes in use: 2
[ 1796.297192] tc358743 2-000f: Waiting for particular sync signal: no
[ 1796.297401] tc358743 2-000f: Transmit mode: no
[ 1796.297611] tc358743 2-000f: Receive mode: no
[ 1796.297821] tc358743 2-000f: Stopped: no
[ 1796.297828] tc358743 2-000f: Color space: YCbCr 422 16-bit
[ 1796.298014] tc358743 2-000f: -----HDMI status-----
[ 1796.298020] tc358743 2-000f: HDCP encrypted content: no
[ 1796.298027] tc358743 2-000f: Input color space: RGB limited range
[ 1796.298211] tc358743 2-000f: AV Mute: off
[ 1796.298402] tc358743 2-000f: Deep color mode: 8-bits per channel
[ 1796.299201] tc358743 2-000f: HDMI infoframe: Auxiliary Video Information (AVI), version 2, length 13
[ 1796.299212] tc358743 2-000f: colorspace: RGB
[ 1796.299220] tc358743 2-000f: scan mode: Underscan
[ 1796.299227] tc358743 2-000f: colorimetry: No Data
[ 1796.299234] tc358743 2-000f: picture aspect: 16:9
[ 1796.299241] tc358743 2-000f: active aspect: Same as Picture
[ 1796.299248] tc358743 2-000f: itc: IT Content
[ 1796.299256] tc358743 2-000f: extended colorimetry: xvYCC 601
[ 1796.299264] tc358743 2-000f: quantization range: Default
[ 1796.299274] tc358743 2-000f: nups: Unknown Non-uniform Scaling
[ 1796.299281] tc358743 2-000f: video code: 16
[ 1796.299289] tc358743 2-000f: ycc quantization range: Limited
[ 1796.299296] tc358743 2-000f: hdmi content type: Graphics
[ 1796.299309] tc358743 2-000f: pixel repeat: 0
[ 1796.299316] tc358743 2-000f: bar top 0, bottom 0, left 0, right 0
[ 1796.299324] tegra194-vi5 15c10000.vi: ================== END STATUS ==================
but we I try to capture video . it same trigger the kernel oops
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG12 --stream-mmap --stream-count=100 -d /dev/video0
[ 145.778114] tc358743 2-000f: Calling tc358743_g_input_status
[ 145.778495] tc358743 2-000f: tc358743_g_input_status: status =0x0
[ 145.778501] tc358743 2-000f: Now getting and setting dv timings
[ 145.778502] tc358743 2-000f: Calling tc358743_query_dv_timings
[ 145.780846] tc358743 2-000f: 458:tc358743_get_detected_timings: width 1920 heigh 1080 interlaced 0
[ 145.780851] tc358743 2-000f: tc358743_query_dv_timings: 1920x1080p60.0 (2200x1125)
[ 145.780854] tc358743 2-000f: 1111 tc358743_s_dv_timings
[ 145.780856] tc358743 2-000f: tc358743_s_dv_timings: no change
[ 145.780865] tc358743 2-000f: Calling tc358743_query_dv_timings
[ 145.783328] tc358743 2-000f: 458:tc358743_get_detected_timings: width 1920 heigh 1080 interlaced 0
[ 145.783334] tc358743 2-000f: tc358743_query_dv_timings: 1920x1080p60.0 (2200x1125)
[ 145.783348] tc358743 2-000f: Calling tc358743_g_dv_timings
[ 145.794676] extcon-disp-state external-connection:disp-state: cable 47 state 0
[ 145.794681] Extcon AUX1(HDMI) disable
[ 145.796625] Unable to handle kernel NULL pointer dereference at virtual address 000000a0
[ 145.796628] Mem abort info:
[ 145.796632] ESR = 0x96000005
[ 145.796635] Exception class = DABT (current EL), IL = 32 bits
[ 145.796660] SET = 0, FnV = 0
[ 145.796664] EA = 0, S1PTW = 0
[ 145.796666] Data abort info:
[ 145.796669] ISV = 0, ISS = 0x00000005
[ 145.796671] CM = 0, WnR = 0
[ 145.796676] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc1cf365000
[ 145.796685] [00000000000000a0] *pgd=0000000000000000, *pud=0000000000000000
[ 145.796690] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 145.796695] Modules linked in:
[ 145.796711] CPU: 2 PID: 17296 Comm: v4l2-ctl Not tainted 4.9.253 #15
[ 145.796713] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[ 145.796715] task: ffffffc1cc190000 task.stack: ffffffc1cf2d4000
[ 145.796726] PC is at tegra_camera_update_clknbw+0x28/0x2a8
[ 145.796733] LR is at tegra_channel_set_stream+0x1a8/0x4f0
[ 145.796736] pc : [<ffffff8008527b58>] lr : [<ffffff8008b3c7d0>] pstate: 20400045
[ 145.796738] sp : ffffffc1cf2d79e0
[ 145.796745] x29: ffffffc1cf2d79e0 x28: ffffffc1f25f1018
[ 145.796751] x27: ffffffc1e0f6d800 x26: 0000000000000001
[ 145.796756] x25: ffffff8009ffe158 x24: 0000000000000001
[ 145.796763] x23: ffffffc1f25f1018 x22: ffffffc1cf2d7d10
[ 145.796769] x21: 0000000000000001 x20: 0000000000000000
[ 145.796775] x19: ffffffc1f25f1018 x18: 0000000000000400
[ 145.796781] x17: 0000007f7a912328 x16: 0000000000000000
[ 145.796787] x15: 000000000000011f x14: 00000000000003ea
[ 145.796793] x13: 000000000000000f x12: 0000000000000038
[ 145.796798] x11: 0101010101010101 x10: 00000000000000a6
[ 145.796807] x9 : 0000000000000002 x8 : 0000000000000000
[ 145.796813] x7 : 00000000000003ea x6 : ffffffc1f5b80e40
[ 145.796819] x5 : 0000000000000002 x4 : 0000000000000000
[ 145.796825] x3 : ffffff8009e9b2c0 x2 : 0000000000000040
[ 145.796831] x1 : 0000000000000001 x0 : 0000000000000000
[ 145.796832]
[ 145.796836] Process v4l2-ctl (pid: 17296, stack limit = 0xffffffc1cf2d4000)
[ 145.796839] Call trace:
[ 145.796845] [<ffffff8008527b58>] tegra_camera_update_clknbw+0x28/0x2a8
[ 145.796849] [<ffffff8008b3c7d0>] tegra_channel_set_stream+0x1a8/0x4f0
[ 145.796855] [<ffffff8008b4748c>] vi5_channel_start_streaming+0x2dc/0x4c8
[ 145.796861] [<ffffff8008b3905c>] tegra_channel_start_streaming+0x3c/0x50
[ 145.796866] [<ffffff8008b310f4>] vb2_start_streaming+0x6c/0x158
[ 145.796871] [<ffffff8008b32ecc>] vb2_core_streamon+0x16c/0x1a0
[ 145.796876] [<ffffff8008b35fac>] vb2_streamon+0x54/0x88
[ 145.796880] [<ffffff8008b36034>] vb2_ioctl_streamon+0x54/0x60
[ 145.796885] [<ffffff8008b0fbdc>] v4l_streamon+0x3c/0x50
[ 145.796890] [<ffffff8008b14cdc>] __video_do_ioctl+0x204/0x2c8
[ 145.796896] [<ffffff8008b14688>] video_usercopy+0x2a0/0x6a0
[ 145.796903] [<ffffff8008b14ac4>] video_ioctl2+0x3c/0x50
[ 145.796907] [<ffffff8008b0e528>] v4l2_ioctl+0x88/0x118
[ 145.796914] [<ffffff8008271830>] do_vfs_ioctl+0xb0/0x8d8
[ 145.796917] [<ffffff80082720e4>] SyS_ioctl+0x8c/0xa8
[ 145.796924] [<ffffff8008083900>] el0_svc_naked+0x34/0x38
also when I use v4l2-compliance tool to scan the driver it also trigger crash
mmc@ubuntu:~$ sudo v4l2-compliance -d /dev/video0
v4l2-compliance SHA : not available
Driver Info:
Driver name : tegra-video
Card type : vi-output, tc358743 2-000f
Bus info : platform:15c10000.vi:4
Driver version: 4.9.253
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Compliance test for device /dev/video0 (not using libv4l2):
Required ioctls:
test VIDIOC_QUERYCAP: OK
Allow for multiple opens:
test second video open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
[ 419.037080] tc358743 2-000f: tc358743_query_dv_timings: @@@@@ timings detected error
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
[ 419.052819] tc358743 2-000f: tc358743_query_dv_timings: @@@@@ timings detected error
test VIDIOC_G/S/ENUMINPUT: OK
[ 419.055674] tc358743 2-000f: tc358743_query_dv_timings: @@@@@ timings detected error
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
[ 419.094580] tc358743 2-000f: tc358743_query_dv_timings: @@@@@ timings detected error
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
[ 419.107088] tc358743 2-000f: tc358743_query_dv_timings: @@@@@ timings detected error
[ 419.644686] tc358743 2-000f: tc358743_s_dv_timings: timings out of range
fail: v4l2-test-io-config.cpp(221): doioctl(node, VIDIOC_S_DV_TIMINGS, &timings)
fail: v4l2-test-io-config.cpp(253): Timings check failed for input 0.
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: FAIL
[ 419.648648] tc358743 2-000f: tc358743_query_dv_timings: @@@@@ timings detected error
test VIDIOC_DV_TIMINGS_CAP: OK
[ 419.651710] tc358743 2-000f: tc358743_query_dv_timings: @@@@@ timings detected error
fail: v4l2-test-io-config.cpp(361): !ret && check_0(edid.reserved, sizeof(edid.reserved))
fail: v4l2-test-io-config.cpp(431): EDID check failed for input 0.
test VIDIOC_G/S_EDID: FAIL
Test input 0:
[ 419.654605] tc358743 2-000f: tc358743_query_dv_timings: @@@@@ timings detected error
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
[ 419.657729] Unable to handle kernel NULL pointer dereference at virtual address 000001e8
[ 419.658660] Mem abort info:
[ 419.659500] ESR = 0x96000005
[ 419.660282] Exception class = DABT (current EL), IL = 32 bits
[ 419.661340] SET = 0, FnV = 0
[ 419.661916] EA = 0, S1PTW = 0
[ 419.663358] Data abort info:
[ 419.666368] ISV = 0, ISS = 0x00000005
[ 419.669961] CM = 0, WnR = 0
[ 419.673180] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc1d35ff000
[ 419.679315] [00000000000001e8] *pgd=0000000000000000, *pud=0000000000000000
[ 419.686878] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 419.692375] Modules linked in:
[ 419.695203] CPU: 1 PID: 25835 Comm: v4l2-compliance Not tainted 4.9.253 #6
[ 419.701735] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[ 419.707865] task: ffffffc1cb766200 task.stack: ffffffc1d3588000
[ 419.714080] PC is at tegra_vi5_g_volatile_ctrl+0x48/0x120
[ 419.719499] LR is at tegra_vi5_g_volatile_ctrl+0x2c/0x120
[ 419.724666] pc : [<ffffff8008b47808>] lr : [<ffffff8008b477ec>] pstate: 40400145
[ 419.732448] sp : ffffffc1d358bac0
[ 419.735777] x29: ffffffc1d358bac0 x28: ffffffc1e092aa00
[ 419.741710] x27: 000000000f000000 x26: 0000000000000000
[ 419.747488] x25: ffffff8009ffe7f8 x24: 0000000000000047
[ 419.752921] x23: 0000000000000001 x22: 0000000000000018
[ 419.758535] x21: ffffffc1d358bb60 x20: ffffffc1f4d9c420
[ 419.764225] x19: ffffffc1e092aa00 x18: 0000000000000001
[ 419.769854] x17: 0000007f95706600 x16: ffffff8008272058
[ 419.775284] x15: ffffffffffffffff x14: ffffffc1d358bac0
[ 419.781236] x13: ffffffc1d358b9c5 x12: 0000000000000000
[ 419.786679] x11: ffffffc1d358b980 x10: ffffffc1d358b980
[ 419.792634] x9 : 0000000000000002 x8 : 0000000000000002
[ 419.798161] x7 : ffffff8008fd7180 x6 : 0000000000000090
[ 419.803670] x5 : 000000000000008d x4 : 0000000000000001
[ 419.809022] x3 : 00000000009a2033 x2 : 0000000000000000
[ 419.814622] x1 : ffffffc1cb766200 x0 : 00000000009a2032
[ 419.819969]
[ 419.820736] Process v4l2-compliance (pid: 25835, stack limit = 0xffffffc1d3588000)
[ 419.827913] Call trace:
[ 419.830197] [<ffffff8008b47808>] tegra_vi5_g_volatile_ctrl+0x48/0x120
[ 419.836317] [<ffffff8008b1e16c>] v4l2_g_ext_ctrls+0x22c/0x2f0
[ 419.841913] [<ffffff8008b16538>] v4l_g_ext_ctrls+0xa0/0xd8
[ 419.846729] [<ffffff8008b14c64>] __video_do_ioctl+0x204/0x2c8
[ 419.852327] [<ffffff8008b14610>] video_usercopy+0x2a0/0x6a0
[ 419.857405] [<ffffff8008b14a4c>] video_ioctl2+0x3c/0x50
[ 419.862475] [<ffffff8008b0e4b0>] v4l2_ioctl+0x88/0x118
[ 419.867033] [<ffffff8008271830>] do_vfs_ioctl+0xb0/0x8d8
[ 419.872364] [<ffffff80082720e4>] SyS_ioctl+0x8c/0xa8
[ 419.876918] [<ffffff8008083900>] el0_svc_naked+0x34/0x38
[ 419.881991] ---[ end trace 83dd3ffb111130ce ]---
I have read the document that v4l2 have two version driver . and v1 is no support right now ?
and I try to porting the driver to v2 version but more problem show .
the doc say
V4L2 Control Ops
V4L2 control ops communicate with the V4L2 framework. These operations are handled automatically in the Jetson V4L2 Camera Framework, and need not be added to individual sensor driver:
•v4l2_ctrl_ops
•v4l2_subdev_ops
•v4l2_subdev_video_ops
•v4l2_subdev_core_ops
•v4l2_subdev_pad_ops
for one example how can I implement the log_status ops function now ?
any help would be appreciate