Dsi pwm backlight off after hdmi unplugged

Hi,

we had a customized HW carrior board for jetson nano BO1 and had a DSI lcd using pwm backlight.

Boot up with DSI lcd and HDMI screen will be ok.
The issue was DSI backlight off after HDMI unplugged and if re-plug the HDMI then DSI backlight will on again.
Seems the action of plug/unplug will affect the pwm0.

Anyone help ?
tks.

Which pwm is in use for your backlight?

Do you also write corresponding config in your dts for this pwm?

Hi,

PM3_PWM0 was used. DTS configed, now backlight work well if no HDMI.
One more issue is the HDMI plug/unplug will lead to the pwm on/off.

Unplug HDMI dmesg info:
[ +0.000336] tegradc tegradc.1: unblank
[1月29 00:08] extcon-disp-state extcon:disp-state: cable 47 state 0
[ +0.000041] Extcon AUX1(HDMI) disable
[ +0.018458] tegradc tegradc.0: blank - powerdown
[ +0.000110] extcon-disp-state extcon:disp-state: cable 51 state 0
[ +0.000003] Extcon HDMI: HPD disabled
[ +0.000021] tegradc tegradc.0: hdmi: unplugged
[ +0.073417] tegradc tegradc.0: blank - powerdown
[ +0.000044] tegradc tegradc.0: unblank
[ +0.000045] tegradc tegradc.0: unblank
[ +0.000370] tegradc tegradc.1: unblank
[ +0.068531] tegradc tegradc.1: unblank
[ +0.000037] tegradc tegradc.0: blank - powerdown
[ +0.083122] tegradc tegradc.1: unblank
[ +0.000047] tegradc tegradc.0: blank - powerdown

and can see pwm duty = 0,
root@jetson-desktop:/sys/class/backlight/backlight# cat /sys/kernel/debug/pwm
platform/70110000.pwm, 1 PWM device
pwm-0 (pwm-regulator ): requested enabled period: 2500 ns duty: 0 ns polarity: normal

platform/7000a000.pwm, 4 PWM devices
pwm-0 (backlight ): requested period: 40161 ns duty: 0 ns polarity: normal
pwm-1 (pwm-regulator ): requested period: 8000 ns duty: 1440 ns polarity: normal
pwm-2 ((null) ): period: 0 ns duty: 0 ns polarity: normal
pwm-3 (pwm-fan ): requested enabled period: 45334 ns duty: 0 ns polarity: normal
root@jetson-desktop:/sys/class/backlight/backlight#

then re-plug HDMI,
[1月29 00:10] tegradc tegradc.0: blank - powerdown
[ +0.000218] tegradc tegradc.0: unblank
[ +0.020531] tegradc tegradc.0: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[ +0.000089] tegradc tegradc.0: hdmi: tmds rate:148500K prod-setting:prod_c_hdmi_75m_150m
[ +0.000995] tegradc tegradc.0: hdmi: get RGB quant from EDID.
[ +0.000006] tegradc tegradc.0: hdmi: get YCC quant from EDID.
[ +0.035603] extcon-disp-state extcon:disp-state: cable 47 state 1
[ +0.000007] Extcon AUX1(HDMI) enable
[ +0.005871] extcon-disp-state extcon:disp-state: cable 51 state 1
[ +0.000004] Extcon HDMI: HPD enabled
[ +0.000022] tegradc tegradc.0: hdmi: plugged
[ +0.004072] tegradc tegradc.1: unblank
[ +0.000191] tegradc tegradc.0: blank - powerdown
[ +0.054610] extcon-disp-state extcon:disp-state: cable 47 state 0
[ +0.000004] Extcon AUX1(HDMI) disable
[ +0.134135] tegradc tegradc.1: unblank
[ +0.000040] tegradc tegradc.0: blank - powerdown
[ +0.048265] tegradc tegradc.0: blank - powerdown
[ +0.000083] tegradc tegradc.0: unblank
[ +0.012384] tegradc tegradc.0: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[ +0.000086] tegradc tegradc.0: hdmi: tmds rate:148500K prod-setting:prod_c_hdmi_75m_150m
[ +0.001019] tegradc tegradc.0: hdmi: get RGB quant from EDID.
[ +0.000006] tegradc tegradc.0: hdmi: get YCC quant from EDID.
[ +0.036712] extcon-disp-state extcon:disp-state: cable 47 state 1
[ +0.000005] Extcon AUX1(HDMI) enable
[ +0.011571] tegradc tegradc.0: unblank
[ +0.000294] tegradc tegradc.1: unblank

and see pwm duty ok,
root@jetson-desktop:/sys/class/backlight/backlight# cat /sys/kernel/debug/pwm
platform/70110000.pwm, 1 PWM device
pwm-0 (pwm-regulator ): requested enabled period: 2500 ns duty: 0 ns polarity: normal

platform/7000a000.pwm, 4 PWM devices
pwm-0 (backlight ): requested enabled period: 40161 ns duty: 32128 ns polarity: normal
pwm-1 (pwm-regulator ): requested period: 8000 ns duty: 1440 ns polarity: normal
pwm-2 ((null) ): period: 0 ns duty: 0 ns polarity: normal
pwm-3 (pwm-fan ): requested enabled period: 45334 ns duty: 0 ns polarity: normal
root@jetson-desktop:/sys/class/backlight/backlight#

any suggests ?
tks

Do you configure any backlight stuff in your dts? If you have, please share your full dmesg and dts file with us.

0001-BL-pwm.patch (6.1 KB)
dmesg.txt (90.2 KB)

@WayneWWW
attachments maybe what u want. please ignore pcie error.

@WayneWWW
Hi, do you got the attachment?
tks.

Could you add stack dump or print function in pwm disable function and see if it gets called and how it gets called when hdmi removal?

I don’t have a nano with DSI to help check, need you to do this work. Thanks.

@WayneWWW

Hi,
could you help check below dts patch is right?

host1x {
/* DSI mapped to tegradc.1 /
dc@54240000 {
status = “okay”;
nvidia,dc-or-node = “/host1x/dsi”;
nvidia,dc-connector = <&dsi>;
/
DSI supplies /
avdd_dsi_csi-supply = <&max77620_sd3>;
avdd_lcd-supply = <&battery_reg>;
dvdd_lcd-supply = <&battery_reg>;
vdd_lcd_bl_en-supply = <&battery_reg>;
vdd_lcd_bl-supply = <&battery_reg>;
};
dsi {
nvidia,dsi-controller-vs = <DSI_VS_1>;
status = “okay”;
nvidia,active-panel = <&panel_a_wxga_8_0>;
nvidia,dsi-csi-loopback;
panel-a-wxga-8-0 {
status = “okay”;
/
Only 2 lanes used on Porg */
nvidia,dsi-n-data-lanes = <2>;
nvidia,panel-rst-gpio = <&gpio TEGRA_GPIO(Z, 0) 0>;
nvidia,panel-bl-pwm-gpio = <&gpio TEGRA_GPIO(V, 0) 0>;
};
};
};

i will do the print in pwm disable function later.
i can reproduce it without DSI lcd on Jetson Nano for just to measure the waves by num 32 pin in 40-pin header.
tks.

I guess the stack dump could help more than reviewing the dts. What is the function of pin32 here?
lcd_pwm? If so, do you write anything related to pwm in your dts?

@WayneWWW
Hi,
now a new issue, DP display can’t work when DSI lcd is ok.
and ignore pwm bl first using a gpio to turn on bl now.
but after remove ’ nvidia,dc-connector = <&dsi>;’ under host1x node above dts, DP work and as thought the DSI do not work.
any suggests?
btw, dsi mapped to tegradc.1, right? or should map to tegradc0?

and noted below:

could we use DSI/DP/HDMI at the same time?

tks

The document already told you there is only 2 head. So not possible to use 3 heads case

@WayneWWW
tks.
i’m new about display.
a question: what’s the relationship of controller/heads/windows(A,B, and C) ?

Hi,

The controller and head is one to one mapping.

Each “tegradc@” in you device tree represent a display controller (tegra DC)

There are only 2 display controller in tx1 series, thus, only 2 display are able to run.

As for window A/B/C, you can consider this as a frame buffer to let gpu render on. If the display head has no window on it, then it will not able to draw anything so monitor will not be enabled.

@WayneWWW
tks very much.

@WayneWWW
Hi,
come back the topic, I tested,

startup DSI and HDMI work well.

then unplugged HDMI, DSI brightness will be 0, as below:

[2月28 18:06] extcon-disp-state extcon:disp-state: cable 47 state 0
[ +0.000041] Extcon AUX1(HDMI) disable
[ +0.018726] tegradc tegradc.0: blank - powerdown
[ +0.000031] +++ pwm_backlight_update_status
[ +0.000005] CPU: 3 PID: 709 Comm: kworker/3:1 Tainted: G W 4.9.140-tegra #77
[ +0.000002] Hardware name: NVIDIA Jetson Nano Developer Kit (DT)
[ +0.000013] Workqueue: events tegra_hdmi_hpd_worker
[ +0.000002] Call trace:
[ +0.000006] [] dump_backtrace+0x0/0x198
[ +0.000004] [] show_stack+0x24/0x30
[ +0.000004] [] dump_stack+0x98/0xc0
[ +0.000006] [] pwm_backlight_update_status+0x34/0x1d8
[ +0.000004] [] fb_notifier_callback+0x110/0x138
[ +0.000003] [] notifier_call_chain+0x5c/0xa0
[ +0.000004] [] blocking_notifier_call_chain+0x64/0x88
[ +0.000002] [] fb_notifier_call_chain+0x30/0x40
[ +0.000003] [] fb_blank+0x88/0xc0
[ +0.000003] [] tegra_fb_update_monspecs+0x228/0x318
[ +0.000004] [] tegra_hdmi_hotplug_notify+0x70/0xd0
[ +0.000003] [] tegra_hdmi_disable+0x44/0x88
[ +0.000003] [] tegra_hdmi_hpd_worker+0xec/0x360
[ +0.000004] [] process_one_work+0x1e4/0x4b0
[ +0.000003] [] worker_thread+0x50/0x4c8
[ +0.000002] [] kthread+0xec/0xf0
[ +0.000003] [] ret_from_fork+0x10/0x30
[ +0.000002] +++ pwm_backlight_update_status, brightness:0
[ +0.000078] extcon-disp-state extcon:disp-state: cable 51 state 0
[ +0.000003] Extcon HDMI: HPD disabled
[ +0.000023] tegradc tegradc.0: hdmi: unplugged
[ +0.008767] tegradc tegradc.0: blank - powerdown
[ +0.000040] tegradc tegradc.0: unblank
[ +0.000017] +++ pwm_backlight_update_status
[ +0.000006] CPU: 1 PID: 5197 Comm: Xorg Tainted: G W 4.9.140-tegra #77
[ +0.000001] Hardware name: NVIDIA Jetson Nano Developer Kit (DT)
[ +0.000002] Call trace:
[ +0.000008] [] dump_backtrace+0x0/0x198
[ +0.000005] [] show_stack+0x24/0x30
[ +0.000004] [] dump_stack+0x98/0xc0
[ +0.000007] [] pwm_backlight_update_status+0x34/0x1d8
[ +0.000003] [] fb_notifier_callback+0x110/0x138
[ +0.000004] [] notifier_call_chain+0x5c/0xa0
[ +0.000003] [] blocking_notifier_call_chain+0x64/0x88
[ +0.000003] [] fb_notifier_call_chain+0x30/0x40
[ +0.000003] [] fb_blank+0x88/0xc0
[ +0.000003] [] do_fb_ioctl+0x198/0x6e0
[ +0.000002] [] fb_ioctl+0x58/0x70
[ +0.000004] [] do_vfs_ioctl+0xb0/0x8d8
[ +0.000002] [] SyS_ioctl+0x8c/0xa8
[ +0.000003] [] el0_svc_naked+0x34/0x38
[ +0.000002] +++ pwm_backlight_update_status, brightness:255
[ +0.000001] +++ pwm duty_cycle:10241055
[ +0.000025] tegradc tegradc.0: unblank
[ +0.000051] tegradc tegradc.1: unblank
[ +0.047976] tegradc tegradc.0: blank - powerdown
[ +0.000029] +++ pwm_backlight_update_status
[ +0.000005] CPU: 0 PID: 5197 Comm: Xorg Tainted: G W 4.9.140-tegra #77
[ +0.000002] Hardware name: NVIDIA Jetson Nano Developer Kit (DT)
[ +0.000001] Call trace:
[ +0.000008] [] dump_backtrace+0x0/0x198
[ +0.000004] [] show_stack+0x24/0x30
[ +0.000003] [] dump_stack+0x98/0xc0
[ +0.000005] [] pwm_backlight_update_status+0x34/0x1d8
[ +0.000004] [] fb_notifier_callback+0x110/0x138
[ +0.000003] [] notifier_call_chain+0x5c/0xa0
[ +0.000003] [] blocking_notifier_call_chain+0x64/0x88
[ +0.000002] [] fb_notifier_call_chain+0x30/0x40
[ +0.000002] [] fb_blank+0x88/0xc0
[ +0.000003] [] do_fb_ioctl+0x198/0x6e0
[ +0.000002] [] fb_ioctl+0x58/0x70
[ +0.000003] [] do_vfs_ioctl+0xb0/0x8d8
[ +0.000002] [] SyS_ioctl+0x8c/0xa8
[ +0.000002] [] el0_svc_naked+0x34/0x38
[ +0.000002] +++ pwm_backlight_update_status, brightness:0
[ +0.000011] tegradc tegradc.1: blank - powerdown
[ +0.054156] tegradc tegradc.1: IRQ when DC not powered!
[ +0.001916] tegradc tegradc.0: blank - powerdown
[ +0.000037] tegradc tegradc.1: blank - powerdown
[ +0.023609] tegradc tegradc.1: blank - powerdown
[ +0.000061] tegradc tegradc.1: unblank
[ +0.292062] tegradc tegradc.1: updating CMU cmu_dirty=1
[ +0.009710] tegradc tegradc.1: nominal-pclk:1666000 parent:9995947 div:6.0 pclk:1665991 1649340~1815940
[ +0.000587] tegradc tegradc.1: DSI: HS clock rate is 409500
[ +0.017821] tegradc tegradc.1: Link compression not supported by the panel
[ +0.366814] tegradc tegradc.1: unblank
[ +0.000321] tegradc tegradc.0: blank - powerdown

and last plug HDMI again, DSI backlight will be ok again, brightness is 255, as below

[2月28 18:10] tegradc tegradc.0: blank - powerdown
[ +0.000214] +++ + FB_BLANK_POWERDOWN
[ +0.000114] tegradc tegradc.0: unblank
[ +0.016729] tegradc tegradc.0: updating CMU cmu_dirty=1
[ +0.007165] tegradc tegradc.0: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[ +0.000102] tegradc tegradc.0: hdmi: tmds rate:148500K prod-setting:prod_c_hdmi_75m_150m
[ +0.002926] tegradc tegradc.0: hdmi: get RGB quant from EDID.
[ +0.000007] tegradc tegradc.0: hdmi: get YCC quant from EDID.
[ +0.036462] extcon-disp-state extcon:disp-state: cable 47 state 1
[ +0.000005] Extcon AUX1(HDMI) enable
[ +0.000185] tegradc tegradc.0: Link compression not supported by the panel
[ +0.000066] +++ pwm_backlight_update_status
[ +0.000009] CPU: 3 PID: 709 Comm: kworker/3:1 Tainted: G W 4.9.140-tegra #77
[ +0.000004] Hardware name: NVIDIA Jetson Nano Developer Kit (DT)
[ +0.000029] Workqueue: events tegra_hdmi_hpd_worker
[ +0.000004] Call trace:
[ +0.000013] [] dump_backtrace+0x0/0x198
[ +0.000009] [] show_stack+0x24/0x30
[ +0.000008] [] dump_stack+0x98/0xc0
[ +0.000010] [] pwm_backlight_update_status+0x34/0x1d8
[ +0.000004] [] fb_notifier_callback+0x110/0x138
[ +0.000005] [] notifier_call_chain+0x5c/0xa0
[ +0.000004] [] blocking_notifier_call_chain+0x64/0x88
[ +0.000003] [] fb_notifier_call_chain+0x30/0x40
[ +0.000003] [] fb_blank+0x88/0xc0
[ +0.000003] [] tegra_fbcon_set_fb_mode+0x98/0xb8
[ +0.000003] [] tegra_fb_update_monspecs+0x184/0x318
[ +0.000003] [] tegra_hdmi_hotplug_notify+0x70/0xd0
[ +0.000003] [] tegra_hdmi_edid_eld_setup+0x1b4/0x240
[ +0.000003] [] tegra_hdmi_hpd_worker+0x160/0x360
[ +0.000005] [] process_one_work+0x1e4/0x4b0
[ +0.000002] [] worker_thread+0x50/0x4c8
[ +0.000002] [] kthread+0xec/0xf0
[ +0.000003] [] ret_from_fork+0x10/0x30
[ +0.000003] +++ pwm_backlight_update_status, brightness:255
[ +0.000001] +++ pwm duty_cycle:10241055
[ +0.000005] +++ + FB_BLANK_UNBLANK
[ +0.000088] extcon-disp-state extcon:disp-state: cable 51 state 1
[ +0.000003] Extcon HDMI: HPD enabled
[ +0.000026] tegradc tegradc.0: hdmi: plugged
[ +0.015708] tegradc tegradc.1: unblank
[ +0.000037] tegradc tegradc.0: blank - powerdown
[ +0.064590] extcon-disp-state extcon:disp-state: cable 47 state 0
[ +0.000008] Extcon AUX1(HDMI) disable
[ +0.020075] +++ pwm_backlight_update_status
[ +0.000006] CPU: 0 PID: 5197 Comm: Xorg Tainted: G W 4.9.140-tegra #77
[ +0.000002] Hardware name: NVIDIA Jetson Nano Developer Kit (DT)
[ +0.000002] Call trace:
[ +0.000009] [] dump_backtrace+0x0/0x198
[ +0.000005] [] show_stack+0x24/0x30
[ +0.000004] [] dump_stack+0x98/0xc0
[ +0.000007] [] pwm_backlight_update_status+0x34/0x1d8
[ +0.000003] [] fb_notifier_callback+0x110/0x138
[ +0.000004] [] notifier_call_chain+0x5c/0xa0
[ +0.000003] [] blocking_notifier_call_chain+0x64/0x88
[ +0.000002] [] fb_notifier_call_chain+0x30/0x40
[ +0.000003] [] fb_blank+0x88/0xc0
[ +0.000003] [] do_fb_ioctl+0x198/0x6e0
[ +0.000002] [] fb_ioctl+0x58/0x70
[ +0.000004] [] do_vfs_ioctl+0xb0/0x8d8
[ +0.000002] [] SyS_ioctl+0x8c/0xa8
[ +0.000003] [] el0_svc_naked+0x34/0x38
[ +0.000002] +++ pwm_backlight_update_status, brightness:0
[ +0.057038] tegradc tegradc.0: blank - powerdown
[ +0.000046] tegradc tegradc.0: unblank
[ +0.000295] tegradc tegradc.0: updating CMU cmu_dirty=1
[ +0.009472] tegradc tegradc.0: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[ +0.000086] tegradc tegradc.0: hdmi: tmds rate:148500K prod-setting:prod_c_hdmi_75m_150m
[ +0.001057] tegradc tegradc.0: hdmi: get RGB quant from EDID.
[ +0.000007] tegradc tegradc.0: hdmi: get YCC quant from EDID.
[ +0.035276] extcon-disp-state extcon:disp-state: cable 47 state 1
[ +0.000006] Extcon AUX1(HDMI) enable
[ +0.001515] tegradc tegradc.0: Link compression not supported by the panel
[ +0.000037] +++ pwm_backlight_update_status
[ +0.000005] CPU: 3 PID: 5197 Comm: Xorg Tainted: G W 4.9.140-tegra #77
[ +0.000002] Hardware name: NVIDIA Jetson Nano Developer Kit (DT)
[ +0.000001] Call trace:
[ +0.000009] [] dump_backtrace+0x0/0x198
[ +0.000004] [] show_stack+0x24/0x30
[ +0.000004] [] dump_stack+0x98/0xc0
[ +0.000005] [] pwm_backlight_update_status+0x34/0x1d8
[ +0.000004] [] fb_notifier_callback+0x110/0x138
[ +0.000003] [] notifier_call_chain+0x5c/0xa0
[ +0.000004] [] blocking_notifier_call_chain+0x64/0x88
[ +0.000002] [] fb_notifier_call_chain+0x30/0x40
[ +0.000002] [] fb_blank+0x88/0xc0
[ +0.000004] [] do_fb_ioctl+0x198/0x6e0
[ +0.000002] [] fb_ioctl+0x58/0x70
[ +0.000004] [] do_vfs_ioctl+0xb0/0x8d8
[ +0.000002] [] SyS_ioctl+0x8c/0xa8
[ +0.000003] [] el0_svc_naked+0x34/0x38
[ +0.000003] +++ pwm_backlight_update_status, brightness:255
[ +0.000001] +++ pwm duty_cycle:10241055
[ +0.008084] tegradc tegradc.0: unblank
[ +0.000337] tegradc tegradc.1: unblank
[ +0.042781] tegradc tegradc.0: unblank
[ +0.000267] tegradc tegradc.1: unblank

tks for your help.
any idea about those?

Hi

noted this:

/* hotplug_supported refers to the capability of the protocol

  • to support hotplug and should not be used to ascertain the
  • HW support for hotplug on the device
  • e.g. DP/HDMI: hotplug supported | EDP/DSI: hotplug not supported
  • for fake output types:
  • FAKE_DSI: hotplug not supported
  • FAKE_DP: hotplug supported if ext_dp_panel DT flag is set
  • */
    bool hotplug_supported;

which in dc_priv_defs.h ,
do we support hdmi hotplug when using dsi?

tks

Hi,

Yes, the dsi should work when hdmi is doing hotplug. This looks like an issue/bug here.

Actually, with my experience on TX2 case, when we hotplug the hdmi cable, the DSI panel should blank for a moment and then come back again. Thus, pwm totally gone is abnormal.

The issue here seems to be this part. When tegradc.1 (DSI) is called “unblank”, I am not sure why the flow of the stack dump does not happen. I mean the pwm_backlight_update_status should be called here and pwm should be back to 255 at this moment.
Could you help check why it is get called when tegradc.0 (HDMI) is unblanked but not called when tegradc.1 (DSI) is unblanked?

@WayneWWW

Hi,now I just do workround to avoid to pwm off in pwm_backlight_update_status.
Later if have enough time, will check again.

tks.

@WayneWWW
Hi,
now DSI LCD + HDMI can work well as below:

host1x {
/* DSI mapped to tegradc.1 /
dc@54240000 {
status = “okay”;
nvidia,dc-or-node = “/host1x/dsi”;
nvidia,dc-connector = <&dsi>;
/
DSI supplies /
avdd_dsi_csi-supply = <&max77620_sd3>;
avdd_lcd-supply = <&battery_reg>;
dvdd_lcd-supply = <&battery_reg>;
vdd_lcd_bl_en-supply = <&battery_reg>;
vdd_lcd_bl-supply = <&battery_reg>;
};

then just to map DSI to dc 0 to support DSI + eDP as below
==>
host1x {
/* DSI mapped to tegradc.0 */
dc@54200000 {
status = “okay”;
nvidia,dc-or-node = “/host1x/dsi”;
nvidia,dc-connector = <&dsi>;
/
DSI supplies /
avdd_dsi_csi-supply = <&max77620_sd3>;
avdd_lcd-supply = <&battery_reg>;
dvdd_lcd-supply = <&battery_reg>;
vdd_lcd_bl_en-supply = <&battery_reg>;
vdd_lcd_bl-supply = <&battery_reg>;
};

but saw the DSI LCD will blink sometimes,
could u give some suggests?
tks

When did dsi blink? When you hotplug HDMI or DP monitor cable?

BTW, I don’t know what did you change to make DSI no blank anymore. Could you share more detail?