TX2i tegra_nvdisp_head_enable fails if HDMI is connected after boot

I have a custom carrier board with two HDMI outputs, following the recommended schematic.
R32.3.1

The first HDMI output initializes as expected if the monitor is connected before boot.
The splash screen, console and finally getty prompt are displayed.
The graphical environment is disabled.

The relevant dmesg output is
[ 0.446153] iommu: Adding device 15210000.nvdisplay to group 30
[ 0.446261] platform 15210000.nvdisplay: OF IOVA linear map 0x9607d000 size (0x800000)
[ 0.446301] platform 15210000.nvdisplay: OF IOVA linear map 0x9607a000 size (0x2008)
[ 1.150645] tegradc 15210000.nvdisplay: disp0 connected to head1->/host1x/sor1
[ 1.150777] tegradc 15210000.nvdisplay: DT parsed successfully
[ 1.150804] tegradc 15210000.nvdisplay: Display dc.ffffff800b690000 registered with id=0
[ 1.158587] tegradc 15210000.nvdisplay: vblank syncpt # 8 for dc 1
[ 1.158598] tegradc 15210000.nvdisplay: vpulse3 syncpt # 9 for dc 1
[ 1.162642] tegradc 15210000.nvdisplay: Bootloader disp_param detected. Detected mode: 1920x1080 (on 0x0mm) pclk=148350937
[ 1.166991] tegradc 15210000.nvdisplay: hdmi: invalid prod list prod_list_hdmi_board
[ 1.167001] tegradc 15210000.nvdisplay: hdmi: tegra_hdmi_tmds_range_read(bd) failed
[ 1.170908] tegradc 15210000.nvdisplay: probed
[ 1.182370] tegradc 15210000.nvdisplay: fb registered
[ 1.254157] tegradc 15210000.nvdisplay: hdmi: tmds rate:148351K prod-setting:prod_c_hdmi_111m_223m
[ 1.254612] tegradc 15210000.nvdisplay: hdmi: get RGB quant from REG programmed by BL.
[ 1.254621] tegradc 15210000.nvdisplay: hdmi: get YCC quant from REG programmed by BL.
[ 2.512094] tegradc 15210000.nvdisplay: blank - powerdown
[ 2.582665] tegradc 15210000.nvdisplay: unblank
[ 2.585870] tegradc 15210000.nvdisplay: hdmi: tmds rate:148500K prod-setting:prod_c_hdmi_111m_223m
[ 2.587045] tegradc 15210000.nvdisplay: hdmi: get RGB quant from EDID.
[ 2.587052] tegradc 15210000.nvdisplay: hdmi: get YCC quant from EDID.
[ 4.635969] tegradc 15210000.nvdisplay: hdmi: plugged

The monitor can then be disconnected and reconnected without any issues.

The HDMI output fails to ever be established if the monitor is connected after the TX2i is booted.
The initial dmesg is

[ 1.176981] tegradc 15210000.nvdisplay: vblank syncpt # 8 for dc 1
[ 1.176987] tegradc 15210000.nvdisplay: vpulse3 syncpt # 9 for dc 1
[ 1.178617] tegradc 15210000.nvdisplay: Bootloader disp_param detected. Detected mode: 1920x1080 (on 0x0mm) pclk=148350937
[ 1.186408] tegradc 15210000.nvdisplay: hdmi: invalid prod list prod_list_hdmi_board
[ 1.186417] tegradc 15210000.nvdisplay: hdmi: tegra_hdmi_tmds_range_read(bd) failed
[ 1.191488] tegradc 15210000.nvdisplay: probed
[ 1.205860] tegradc 15210000.nvdisplay: fb registered

The following is logged when the monitor is connected
55.409218] edid invalid
[ 55.440289] edid invalid
[ 56.043085] edid invalid
[ 56.181441] tegradc 15210000.nvdisplay: blank - powerdown
[ 56.198725] tegradc 15210000.nvdisplay: unblank
[ 56.198805] tegra_nvdisp_handle_pd_enable: Unpowergated Head1 pd
[ 56.199270] Parent Clock set for DC plld2
[ 56.251524] tegradc 15210000.nvdisplay: dc_poll_register 0x41: timeout
[ 56.251527] tegradc 15210000.nvdisplay: dc timeout waiting for DC to stop
[ 56.303517] tegradc 15210000.nvdisplay: dc_poll_register 0x41: timeout
[ 56.303520] tegradc 15210000.nvdisplay: dc timeout waiting for DC to stop
[ 56.355511] tegradc 15210000.nvdisplay: dc_poll_register 0x41: timeout
[ 56.355514] tegradc 15210000.nvdisplay: timeout waiting for postcomp init state to promote
[ 56.407515] tegradc 15210000.nvdisplay: dc_poll_register 0x41: timeout
[ 56.407518] tegradc 15210000.nvdisplay: timeout waiting for win assignments to promote
[ 56.407578] tegradc 15210000.nvdisplay: tegra_nvdisp_head_enable, failed head enable
[ 56.407592] tegradc 15210000.nvdisplay: update windows ret = -14
[ 56.407595] tegradc 15210000.nvdisplay: sync windows ret = -14
[ 56.481656] extcon-disp-state external-connection:disp-state: cable 51 state 1
[ 56.481659] Extcon HDMI: HPD enabled
[ 56.481741] tegradc 15210000.nvdisplay: hdmi: plugged

The TX2i is detectign hot plug, generating the following when the monitor is disconnected
62.019523] extcon-disp-state external-connection:disp-state: cable 51 state 0
[ 62.019537] Extcon HDMI: HPD disabled
[ 62.019655] tegradc 15210000.nvdisplay: hdmi: unplugged
[ 62.655768] tegradc 15210000.nvdisplay: blank - powerdown
[ 62.673237] tegradc 15210000.nvdisplay: unblank

The full dmesg and device tree are attached.

dmesg.txt (59.7 KB) dts.txt (501.6 KB) dmesg.txt (59.7 KB)

Hi,

Let me clarify your problem again and please help share the answer for me.

  1. Custom carrier with 2 HDMI outputs. Do both HDMI ports have this problem?

  2. HDMI hotplug can work if your firstly connect hdmi cable to the board and boot up. It cannot work if you hotplug after boot up.

  3. Does this HDMI monitor have problem if it runs on nvidia devkit?

  4. Do you have other HDMI monitor to do the test?

  5. Could you past the full dmesg for connected + boot up case (working case)?

  1. The second HDMI is connected to integral HDMI extender.
    That presents as a permanently connected monitor, so the issue does not arise
  2. The dmesg indicates the presence of the monitor is being detected
    [ 56.481659] Extcon HDMI: HPD enabled
    [ 56.481741] tegradc 15210000.nvdisplay: hdmi: plugged
    [ 62.019523] extcon-disp-state external-connection:disp-state: cable 51 state 0
    [ 62.019537] Extcon HDMI: HPD disabled
    [ 62.019655] tegradc 15210000.nvdisplay: hdmi: unplugged
    [ 62.655768] tegradc 15210000.nvdisplay: blank - powerdown
    [ 62.673237] tegradc 15210000.nvdisplay: unblank
  3. I have used the same monitor on several other Jetsons: devkit TX2, devkit TX2i and custom carrier TX2is
  4. I have seen the same problem on a second custom carrier with a second monitor (same model)
    I can try different models of monitor
  5. I will gather that information.

I am WFH today, so it will take awhile to get the additional information.
Thanks

Relevant extract from dmesg for system booted with monitor connected
[ 0.447778] iommu: Adding device 15210000.nvdisplay to group 33
[ 0.447887] platform 15210000.nvdisplay: OF IOVA linear map 0x9607d000 size (0x800000)
[ 0.447931] platform 15210000.nvdisplay: OF IOVA linear map 0x9607a000 size (0x2008)
[ 1.125734] tegradc 15210000.nvdisplay: disp0 connected to head1->/host1x/sor1
[ 1.125864] tegradc 15210000.nvdisplay: DT parsed successfully
[ 1.125891] tegradc 15210000.nvdisplay: Display dc.ffffff800b690000 registered with id=0
[ 1.137136] tegradc 15210000.nvdisplay: vblank syncpt # 8 for dc 1
[ 1.137147] tegradc 15210000.nvdisplay: vpulse3 syncpt # 9 for dc 1
[ 1.138918] tegradc 15210000.nvdisplay: Bootloader disp_param detected. Detected mode: 1920x1080 (on 0x0mm) pclk=148350937
[ 1.144643] tegradc 15210000.nvdisplay: hdmi: invalid prod list prod_list_hdmi_board
[ 1.144652] tegradc 15210000.nvdisplay: hdmi: tegra_hdmi_tmds_range_read(bd) failed
[ 1.148919] tegradc 15210000.nvdisplay: probed
[ 1.191418] tegradc 15210000.nvdisplay: fb registered
[ 1.264125] tegradc 15210000.nvdisplay: hdmi: tmds rate:148351K prod-setting:prod_c_hdmi_111m_223m
[ 1.264615] tegradc 15210000.nvdisplay: hdmi: get RGB quant from REG programmed by BL.
[ 1.264624] tegradc 15210000.nvdisplay: hdmi: get YCC quant from REG programmed by BL.
[ 2.508039] tegradc 15210000.nvdisplay: blank - powerdown
[ 2.579958] tegradc 15210000.nvdisplay: unblank
[ 2.584843] tegradc 15210000.nvdisplay: hdmi: tmds rate:148500K prod-setting:prod_c_hdmi_111m_223m
[ 2.586175] tegradc 15210000.nvdisplay: hdmi: get RGB quant from EDID.
[ 2.586183] tegradc 15210000.nvdisplay: hdmi: get YCC quant from EDID.
[ 4.799213] tegradc 15210000.nvdisplay: hdmi: plugged

Complete dmesg attached as good_dmesg.txtgood_dmesg.txt (62.6 KB)

I solved the problem by changing the DTB to add TEGRA_DC_OUT_HOTPLUG_HIGH

nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-1000-a00-00-base.dts

sor {
             hdmi-display {
                       disp-default-out {
                                nvidia,out-flags = <TEGRA_DC_OUT_HOTPLUG_HIGH>;
                       };
            }

However, I had thought sor was the fiber output and sor1 the copper.
So the above change should have had no impact.
Still investigating

1 Like

The following sequence of commands

echo 4 > blank && echo 0x0 > device/win_mask && echo 0x3f > device/win_mask && echo 0 >blank

Caused the driver to crash

[ 529.261173] tegradc 15210000.nvdisplay: blank - powerdown
[ 529.263424] tegradc 15210000.nvdisplay: unblank
[ 529.264399] Parent Clock set for DC plld2
[ 529.317733] tegradc 15210000.nvdisplay: dc_poll_register 0x41: timeout
[ 529.317752] tegradc 15210000.nvdisplay: dc timeout waiting for DC to stop
[ 529.369714] tegradc 15210000.nvdisplay: dc_poll_register 0x41: timeout
[ 529.369730] tegradc 15210000.nvdisplay: dc timeout waiting for DC to stop
[ 529.421737] tegradc 15210000.nvdisplay: dc_poll_register 0x41: timeout
[ 529.421755] tegradc 15210000.nvdisplay: timeout waiting for postcomp init state to promote
[ 529.473759] tegradc 15210000.nvdisplay: dc_poll_register 0x41: timeout
[ 529.473777] tegradc 15210000.nvdisplay: timeout waiting for win assignments to promote
[ 529.473793] tegradc 15210000.nvdisplay: tegra_nvdisp_head_enable, failed head enable
[ 529.474520] ignoring invalid window 0 request
[ 529.474526] ------------[ cut here ]------------
[ 529.474577] WARNING: CPU: 2 PID: 7212 at /home/lab/work/l4t/kernel_build/kernel/nvidia/drivers/video/tegra/dc/window.c:1045 tegra_dc_update_windows+0x304/0x540
[ 529.474671] Modules linked in: iptable_filter zram nvgpu bluedroid_pm fbtft_device© fb_ssd1351© fbtft© ip_tables x_tables

[ 529.474707] CPU: 2 PID: 7212 Comm: bash Tainted: G C 4.9.140 #1
[ 529.474719] Hardware name: storm (DT)
[ 529.474737] task: ffffffc19e639c00 task.stack: ffffffc19e1cc000
[ 529.474775] PC is at tegra_dc_update_windows+0x304/0x540
[ 529.474882] LR is at tegra_dc_update_windows+0x304/0x540
[ 529.474906] pc : [] lr : [] pstate: 20400045
[ 529.474917] sp : ffffffc19e1cf800
[ 529.474950] x29: ffffffc19e1cf800 x28: ffffff800a16fef0
[ 529.474977] x27: ffffffc1ac563000 x26: 0000000000000000
[ 529.475000] x25: 0000000000000001 x24: 0000000000000000
[ 529.475026] x23: ffffffc19e1cf8c8 x22: 0000000000000001
[ 529.475051] x21: ffffffc1aa528e38 x20: ffffffc1aa4f8000
[ 529.475074] x19: 0000000000000000 x18: 0000000000000001
[ 529.475096] x17: 0000000000000001 x16: 0000000000000000
[ 529.475123] x15: ffffffffffffffff x14: ffffff800a128260
[ 529.475150] x13: ffffff800a127e99 x12: 0000005800000094
[ 529.475176] x11: 00001a4ea257d980 x10: ffffffc1b6790540
[ 529.475204] x9 : 0000000000000001 x8 : 7365757165722030
[ 529.475229] x7 : 20776f646e697720 x6 : ffffff800a127141
[ 529.475253] x5 : 0000000000000000 x4 : 0000000000000000
[ 529.475281] x3 : ffffffffffffffff x2 : 00000041acf97000
[ 529.475306] x1 : ffffffc19e639c00 x0 : 0000000000000021

[ 529.475327] —[ end trace 6963c2030ad96c15 ]—
[ 529.475336] Call trace:
[ 529.475369] [] tegra_dc_update_windows+0x304/0x540
[ 529.475429] [] tegra_fb_pan_display+0xcc/0x100
[ 529.475457] [] fb_pan_display+0x9c/0x120
[ 529.475485] [] bit_update_start+0x28/0x50
[ 529.475510] [] fbcon_switch+0x35c/0x590
[ 529.475536] [] redraw_screen+0x144/0x248
[ 529.475582] [] fbcon_blank+0x124/0x2b8
[ 529.475607] [] do_unblank_screen+0xa4/0x198
[ 529.475630] [] fbcon_event_notify+0x9ec/0xa10
[ 529.475661] [] notifier_call_chain+0x5c/0xa0
[ 529.475684] [] blocking_notifier_call_chain+0x64/0x88
[ 529.475707] [] fb_notifier_call_chain+0x30/0x40
[ 529.475726] [] fb_blank+0x88/0xc0
[ 529.475746] [] store_blank+0x5c/0x90
[ 529.475767] [] dev_attr_store+0x44/0x60
[ 529.475873] [] sysfs_kf_write+0x58/0x80
[ 529.475896] [] kernfs_fop_write+0xfc/0x1e0
[ 529.475920] [] __vfs_write+0x48/0x118
[ 529.475942] [] vfs_write+0xac/0x1b0
[ 529.475964] [] SyS_write+0x54/0xb0
[ 529.475987] [] el0_svc_naked+0x34/0x38

The custom board has HDMI switches in front of the first HDMI output
Those were being inappropriately toggled as the Tegra HDMI driver was initializing.
That appears to trigger the crashes and other odd behavior.

Waiting until the driver is initialized before changing the switch state resolved the problem