[Solved] Display only works if it is plugged in on boot

Post Reply
alpe
Posts: 79
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 20 times
Been thanked: 6 times
Contact:

[Solved] Display only works if it is plugged in on boot

Unread post by alpe » Sun Dec 08, 2019 6:59 am

I use ubuntu minimal.
My TV only has one HDMI input, so I have to share that with multiple devices.
The problem is, if I boot the N2 while it's not plugged to the TV, when I plug it, the TV will not detect a signal.
It only works if it's plugged when boot occurs.
But if it boots with HDMI plugged in I can plugout/in whenever I want after the boot process that it will work.
But I can't guarantee that the TV will be plugged everytime it boots. And rebooting the N2 when I eventually need the display is a pain.
So I'm searching for a solution.

My boot.ini:

Code: Select all

ODROIDN2-UBOOT-CONFIG

# Default Console Device Setting
setenv condev "console=ttyS0,115200n8 consoleblank=0"   # on both

# Auto Detection of Monitor settings based on your Screen information
setenv display_autodetect "false"

# HDMI Mode
# Resolution Configuration
#    Symbol             | Resolution
# ----------------------+-------------
#    "480x272p60hz"     | 480x272 Progressive 60Hz
#    "480x320p60hz"     | 480x320 Progressive 60Hz
#    "480p60hz"         | 720x480 Progressive 60Hz
#    "576p50hz"         | 720x576 Progressive 50Hz
#    "720p60hz"         | 1280x720 Progressive 60Hz
#    "720p50hz"         | 1280x720 Progressive 50Hz
#    "1080p60hz"        | 1920x1080 Progressive 60Hz
#    "1080p50hz"        | 1920x1080 Progressive 50Hz
#    "1080p30hz"        | 1920x1080 Progressive 30Hz
#    "1080p24hz"        | 1920x1080 Progressive 24Hz
#    "1080i60hz"        | 1920x1080 Interlaced 60Hz
#    "1080i50hz"        | 1920x1080 Interlaced 50Hz
#    "2160p60hz"        | 3840x2160 Progressive 60Hz
#    "2160p50hz"        | 3840x2160 Progressive 50Hz
#    "2160p30hz"        | 3840x2160 Progressive 30Hz
#    "2160p25hz"        | 3840x2160 Progressive 25Hz
#    "2160p24hz"        | 3840x2160 Progressive 24Hz
#    "smpte24hz"        | 3840x2160 Progressive 24Hz SMPTE
#    "2160p60hz420"     | 3840x2160 Progressive 60Hz YCbCr 4:2:0
#    "2160p50hz420"     | 3840x2160 Progressive 50Hz YCbCr 4:2:0
#    "640x480p60hz"     | 640x480 Progressive 60Hz
#    "800x480p60hz"     | 800x480 Progressive 60Hz
#    "800x600p60hz"     | 800x600 Progressive 60Hz
#    "1024x600p60hz"    | 1024x600 Progressive 60Hz
#    "1024x768p60hz"    | 1024x768 Progressive 60Hz
#    "1280x800p60hz"    | 1280x800 Progressive 60Hz
#    "1280x1024p60hz"   | 1280x1024 Progressive 60Hz
#    "1360x768p60hz"    | 1360x768 Progressive 60Hz
#    "1440x900p60hz"    | 1440x900 Progressive 60Hz
#    "1600x900p60hz"    | 1600x900 Progressive 60Hz
#    "1600x1200p60hz"   | 1600x1200 Progressive 60Hz
#    "1680x1050p60hz"   | 1680x1050 Progressive 60Hz
#    "1920x1200p60hz"   | 1920x1200 Progressive 60Hz
#    "2560x1080p60hz"   | 2560x1080 Progressive 60Hz
#    "2560x1440p60hz"   | 2560x1440 Progressive 60Hz
#    "2560x1600p60hz"   | 2560x1600 Progressive 60Hz
#    "3440x1440p60hz"   | 3440x1440 Progressive 60Hz
setenv hdmimode "1080p60hz"

# Monitor output
# Controls if HDMI PHY should output anything to the monitor
setenv monitor_onoff "false" # true or false

# Overscan percentage
# This value scales down the actual screen size by the percentage below
# valid range is 80 to 100
setenv overscan "100"

### voutmode : hdmi or dvi
setenv voutmode "hdmi"
# setenv voutmode "dvi"

# HPD enable/disable option
setenv disablehpd "false"

# Enable/Disable CEC
setenv cec "true"

# Hardkernel ODROID-VU7 support
# By default VU7 support is disabled
setenv disable_vu7 "true"
# setenv disable_vu7 "false"

# max cpu frequency for big core, A73 in MHz unit
# setenv max_freq_a73 "2004"  # 2.004 GHz
# setenv max_freq_a73 "1992"  # 1.992 GHz
# setenv max_freq_a73 "1908"  # 1.908 GHz
setenv max_freq_a73 "1800"  # 1.8 GHz, default value
# setenv max_freq_a73 "1704"  # 1.704 GHz
 
# max cpu frequency for little core, A53 in MHz unit
# setenv max_freq_a53 "1992"  # 1.992 GHz
setenv max_freq_a53 "1896"  # 1.896 GHz, default value
# setenv max_freq_a53 "1704"  # 1.704 GHz


# max cpu-cores
# Note:
# CPU's 0 and 1 are the A53 (small cores)
# CPU's 2 to 5 are the A73 (big cores)
# Lowering this value disables only the bigger cores (the last cores).
# setenv maxcpus "4"
# setenv maxcpus "5"
setenv maxcpus "6"

### Normal HDMI Monitors
if test "${display_autodetect}" = "true"; then hdmitx edid; fi
if test "${hdmimode}" = "custombuilt"; then setenv cmode "modeline=${modeline}"; fi
if test "${cec}" = "true"; then setenv cec_enable "hdmitx=cec3f"; fi

# VU7 Settings
if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi

# Boot Args
setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw ${condev} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} ${cmode} disablehpd=${disablehpd} cvbscable=${cvbscable} overscan=${overscan} ${hid_quirks} monitor_onoff=${monitor_onoff} logo=osd0,loaded ${cec_enable}"

# Set load addresses
setenv dtb_loadaddr "0x1000000"
setenv k_addr "0x1100000"
setenv loadaddr "0x1B00000"
setenv initrd_loadaddr "0x3700000"

# Load kernel, dtb and initrd
fatload mmc ${devno}:1 ${k_addr} Image.gz
fatload mmc ${devno}:1 ${dtb_loadaddr} meson64_odroidn2.dtb
fatload mmc ${devno}:1 ${initrd_loadaddr} uInitrd
fdt addr ${dtb_loadaddr}
# unzip the kernel
unzip ${k_addr} ${loadaddr}

# boot
booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}
I already tried multiple combinations of: display_autodetect, hdmimode, monitor_onoff, disablehpd
I also tried to bring up the TV with:

Code: Select all

echo 0 > /sys/class/amhdmitx/amhdmitx0/phy
echo 1 > /sys/class/amhdmitx/amhdmitx0/phy
No luck

By the way, apparently Kodi starts just fine. Like for it's point of view there's a display.
But the TV keeps trying to find a signal and fail.
Last edited by alpe on Sat Dec 21, 2019 9:42 pm, edited 2 times in total.

User avatar
rooted
Posts: 7143
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 393 times
Been thanked: 110 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by rooted » Mon Dec 09, 2019 4:27 am

What an odd issue. Are you certain there isn't some sort of auto blanking happening on the OS side?

I will try to reproduce it.

I will say I have a really old LCD TV in the closet that behaves similarly to all HDMI devices, it has multiple HDMI but still the same behavior you describe.

User avatar
rooted
Posts: 7143
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 393 times
Been thanked: 110 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by rooted » Mon Dec 09, 2019 5:11 am

I can confirm the same behavior (without changing boot.ini) but on a TV with multiple HDMI switching sources and switching back fixes it. That doesn't help you but does verify the issue.
These users thanked the author rooted for the post:
alpe (Mon Dec 09, 2019 8:24 am)

alpe
Posts: 79
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 20 times
Been thanked: 6 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by alpe » Mon Dec 09, 2019 8:31 am

rooted wrote:
Mon Dec 09, 2019 5:11 am
I can confirm the same behavior (without changing boot.ini) but on a TV with multiple HDMI switching sources and switching back fixes it. That doesn't help you but does verify the issue.
Thanks.
It helps to know that someone could replicate it.
More chances of finding a fix, I guess. XD

User avatar
odroid
Site Admin
Posts: 33061
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 305 times
Been thanked: 419 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by odroid » Mon Dec 09, 2019 1:45 pm

Change the following two options to "true" by editing boot.ini file and let us know what happens with your monitor.

Code: Select all

# Auto Detection of Monitor settings based on your Screen information
setenv display_autodetect "false"
# HPD enable/disable option
setenv disablehpd "false"

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by joy » Mon Dec 09, 2019 2:50 pm

odroid wrote:
Mon Dec 09, 2019 1:45 pm
Change the following two options to "true" by editing boot.ini file and let us know what happens with your monitor.

Code: Select all

# Auto Detection of Monitor settings based on your Screen information
setenv display_autodetect "false"
# HPD enable/disable option
setenv disablehpd "false"
@odroid,
As I checked, there is no option of "disablehpd" in related driver of the latest kernel.
Sorry for my too late checking. :(
viewtopic.php?f=101&t=29929&p=272921#p272921
I will look into this this week.

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by joy » Mon Dec 09, 2019 2:57 pm

alpe wrote:
Sun Dec 08, 2019 6:59 am
My TV only has one HDMI input, so I have to share that with multiple devices.
The problem is, if I boot the N2 while it's not plugged to the TV, when I plug it, the TV will not detect a signal.
It only works if it's plugged when boot occurs.
But if it boots with HDMI plugged in I can plugout/in whenever I want after the boot process that it will work.
But I can't guarantee that the TV will be plugged everytime it boots. And rebooting the N2 when I eventually need the display is a pain.
So I'm searching for a solution.
Hi alpe,
To make sure, could you check one thing?

As I understand, you use a HDMI selector, right?
How is the result when you connect your TV to N2 directly without the selector?

Also I will reproduce the issue here with my environment and check related drivers.
I think it may be related abnormal hdmi detection timing as @odroid mentioned.

User avatar
rooted
Posts: 7143
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 393 times
Been thanked: 110 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by rooted » Mon Dec 09, 2019 3:36 pm


joy wrote: As I understand, you use a HDMI selector, right?
How is the result when you connect your TV to N2 directly without the selector?
They are not using a selector, they are unplugging/plugging each device into a single HDMI input.

I'm using a 4 Port HDMI switch, if I change ports then change back then I get proper output.
These users thanked the author rooted for the post:
joy (Mon Dec 09, 2019 3:46 pm)

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by joy » Mon Dec 09, 2019 3:49 pm

rooted wrote:
Mon Dec 09, 2019 3:36 pm
joy wrote: As I understand, you use a HDMI selector, right?
How is the result when you connect your TV to N2 directly without the selector?
They are not using a selector, they are unplugging/plugging each device into a single HDMI input.

I'm using a 4 Port HDMI switch, if I change ports then change back then I get proper output.
Oh! Sorry! I misunderstood.

The issue sumarry is....
(1) Before booting, hdmi plug is detached from N2.
(2) booting start
(3) then, connecting hdmi plug to N2 -> In this case, no display is shown.
Right?

User avatar
rooted
Posts: 7143
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 393 times
Been thanked: 110 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by rooted » Mon Dec 09, 2019 6:45 pm

joy wrote:
rooted wrote:
Mon Dec 09, 2019 3:36 pm
joy wrote: As I understand, you use a HDMI selector, right?
How is the result when you connect your TV to N2 directly without the selector?
They are not using a selector, they are unplugging/plugging each device into a single HDMI input.

I'm using a 4 Port HDMI switch, if I change ports then change back then I get proper output.
Oh! Sorry! I misunderstood.

The issue sumarry is....
(1) Before booting, hdmi plug is detached from N2.
(2) booting start
(3) then, connecting hdmi plug to N2 -> In this case, no display is shown.
Right?
Correct

alpe
Posts: 79
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 20 times
Been thanked: 6 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by alpe » Mon Dec 09, 2019 10:05 pm

odroid wrote:
Mon Dec 09, 2019 1:45 pm
Change the following two options to "true" by editing boot.ini file and let us know what happens with your monitor.
Will try.
Edit: Didn't work.
joy wrote:
Mon Dec 09, 2019 3:49 pm
rooted wrote:
Mon Dec 09, 2019 3:36 pm
joy wrote: As I understand, you use a HDMI selector, right?
How is the result when you connect your TV to N2 directly without the selector?
They are not using a selector, they are unplugging/plugging each device into a single HDMI input.

I'm using a 4 Port HDMI switch, if I change ports then change back then I get proper output.
Oh! Sorry! I misunderstood.

The issue sumarry is....
(1) Before booting, hdmi plug is detached from N2.
(2) booting start
(3) then, connecting hdmi plug to N2 -> In this case, no display is shown.
Right?
Not using an HDMI selector. Correct.
Worth pointing out again that if it's plugged to the TV during boot I can plugin/plugout whenever I want afterwards that it will work.

alpe
Posts: 79
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 20 times
Been thanked: 6 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by alpe » Mon Dec 09, 2019 10:20 pm

The problem is in petitboot.
Sorry. I haven't thought about testing it before.

Aaargh, and it is already listed as known issue in it. Sorry. :roll:
He says that the "fix" is to change display_autodetect to false. Didn't work for me. Or petitboot itself has another boot.ini someplace?

User avatar
rooted
Posts: 7143
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 393 times
Been thanked: 110 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by rooted » Tue Dec 10, 2019 5:19 am

alpe wrote:The problem is in petitboot.
Sorry. I haven't thought about testing it before.

Aaargh, and it is already listed as known issue in it. Sorry. :roll:
He says that the "fix" is to change display_autodetect to false. Didn't work for me. Or petitboot itself has another boot.ini someplace?
It could have a boot.scr but I'm not sure if it has this by default.

Just do a search "petitboot boot.scr"

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by joy » Tue Dec 10, 2019 10:12 am

alpe wrote:
Mon Dec 09, 2019 10:20 pm
The problem is in petitboot.
Sorry. I haven't thought about testing it before.

Aaargh, and it is already listed as known issue in it. Sorry. :roll:
He says that the "fix" is to change display_autodetect to false. Didn't work for me. Or petitboot itself has another boot.ini someplace?
Hi alpe,

To clarify if it's caused by petitboot logic, can you check the following? :)
Please check if you do NOT have the same issue when the boot mode switch is set as MMC
and with boot.ini.

Code: Select all

# Auto Detection of Monitor settings based on your Screen information
setenv display_autodetect "false"
setenv hdmimode "1080p60hz"
With MMC boot mode, petitboot is excluded from boot sequence.

If it works normally with display_autodetect = false, it depends on display autodetect logic.
Petitboot run display_autodetect option as true by default and it's not petitboot issue but display init sequence issue,
so, display init based on the option and petitboot should be adjusted.

Could you check it and share the result for us?
Thanks!
Last edited by joy on Tue Dec 10, 2019 10:24 am, edited 1 time in total.

alpe
Posts: 79
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 20 times
Been thanked: 6 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by alpe » Tue Dec 10, 2019 10:21 am

joy wrote:
Tue Dec 10, 2019 10:12 am
alpe wrote:
Mon Dec 09, 2019 10:20 pm
The problem is in petitboot.
Sorry. I haven't thought about testing it before.

Aaargh, and it is already listed as known issue in it. Sorry. :roll:
He says that the "fix" is to change display_autodetect to false. Didn't work for me. Or petitboot itself has another boot.ini someplace?
Hi alpe,

To clarify if it's caused by petitboot logic, can you check the following? :)
Please check if you do NOT have the same issue when the boot mode switch is set as MMC.
With MMC boot mode, petitboot is excluded from boot sequence.
Tested earlier today, and on MMC mode the issue didn't happen. :x
With petit the issue happens regardless of display_autodetect.

Will test again tomorrow just to be sure. Going to bed now.

Edit: Tested again. On MMC mode no issue. On SPI it happens.
Last edited by alpe on Tue Dec 10, 2019 7:47 pm, edited 1 time in total.

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by joy » Tue Dec 10, 2019 10:27 am

alpe wrote:
Tue Dec 10, 2019 10:21 am
[On MMC mode the issue doesn't happen. :x
With petit the issue happens regardless of display_autodetect.
OK. Thank you for your confirmation.
I Will check display sequence from petitboot.
Sorry for the inconvenience.
These users thanked the author joy for the post:
alpe (Tue Dec 10, 2019 10:31 am)

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by joy » Mon Dec 16, 2019 1:53 pm

Hi alpe, rooted,

I've been trying to reproduce no display issue but so far, still I couldn't see the issue by my side. :(
Can you share the version of kernel package and petitboot?

Code: Select all

$ uname -a
These users thanked the author joy for the post:
rooted (Mon Dec 16, 2019 2:30 pm)

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by joy » Mon Dec 16, 2019 2:29 pm

@alpe, @rooted,
Now I can reproduce the same issue by my side.
It looks it depends on petitboot version, not related to boot.ini or display options as rooted mentioned.
Please let me look into it more.
These users thanked the author joy for the post (total 2):
rooted (Mon Dec 16, 2019 2:30 pm) • alpe (Mon Dec 16, 2019 8:56 pm)

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by joy » Fri Dec 20, 2019 2:22 pm

Hi @alpe, @rooted,

Sorry for late update.
It took a bit long time to setup a test condition with petitboot.

I've made a kernel patch to fix this issue.
It's not a petitboot issue, but related to a hdmi logic problem, and it's just shown from petitboot condition.

If you're available and you can build N2 kernel with your environment, could you check this patch?
Or I will share kernel and related images including this patch.
Please let me know if you need. :)

1. Kernel patch
Please find an attachment, 0001_N2_kernel_add_forced_hpd_control.diff.zip.

Code: Select all

diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c
index 90e7641..29c722e 100644
--- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c
+++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c
@@ -130,6 +130,19 @@
 	return 0;
 }
 __setup("voutmode=", vout_setup);
+
+static bool disableHPD;
+
+static  int __init disableHPD_setup(char *s)
+{
+	if (!(strcmp(s, "true")))
+		disableHPD = true;
+	else
+		disableHPD = false;
+
+	return 0;
+}
+__setup("disablehpd=", disableHPD_setup);
 #endif
 
 int hdmitx_hpd_hw_op(enum hpd_op cmd)
@@ -149,7 +162,12 @@
 	case MESON_CPU_ID_G12A:
 	case MESON_CPU_ID_G12B:
 	case MESON_CPU_ID_SM1:
-		return hdmitx_hpd_hw_op_g12a(cmd);
+#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
+		if ((cmd == HPD_READ_HPD_GPIO) && (disableHPD))
+			return 1;
+		else
+#endif
+			return hdmitx_hpd_hw_op_g12a(cmd);
 	default:
 		break;
 	}
@@ -173,6 +191,11 @@
 	case MESON_CPU_ID_G12A:
 	case MESON_CPU_ID_G12B:
 	case MESON_CPU_ID_SM1:
+#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
+		if (disableHPD)
+			return 1;
+		else
+#endif
 		return read_hpd_gpio_txlx();
 	default:
 		break;
@@ -691,6 +714,16 @@
 		else
 			dat_top &= ~(1 << 1);
 	}
+
+#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
+	if (disableHPD) {
+		hdev->hdmitx_event |= HDMI_TX_HPD_PLUGIN;
+		hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGOUT;
+		hdmitx_wr_reg(HDMITX_TOP_INTR_STAT_CLR, dat_top | 0x6);
+		return IRQ_HANDLED;
+	}
+#endif
+
 	/* HPD rising */
 	if (dat_top & (1 << 1)) {
 		hdev->hdmitx_event |= HDMI_TX_HPD_PLUGIN;
@@ -2886,6 +2919,16 @@
 	r = request_irq(phdev->irq_hpd, &intr_handler,
 			IRQF_SHARED, "hdmitx",
 			(void *)phdev);
+
+#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
+	if (disableHPD)	{
+		phdev->hdmitx_event |= HDMI_TX_HPD_PLUGIN;
+		phdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGOUT;
+		phdev->rhpd_state = 1;
+		queue_delayed_work(phdev->hdmi_wq,
+			&phdev->work_hpd_plugin, HZ/3);
+	}
+#endif
 }
 
 static void hdmitx_uninit(struct hdmitx_dev *phdev)
2. After kernel build, change Image.gz in your 2nd boot storage. ( ex) emmc, sd card or usb storage )
I have been checking and testing kernel side of petitboot, too.
but, as I tested so far, it's not needed to change petitboot image. Just keep it in your SPI flash as the latest one. (20191127)

3. Change an option in boot.ini
Please change the following value to true.
https://github.com/mdrjr/n2_bootini/blo ... ot.ini#L66

Code: Select all

# HPD enable/disable option
setenv disablehpd "true"
I will keep checking different kinds of tests.
If you can confirm this patch can fix the issue, it will be very helpful. :D
Attachments
0001_N2_kernel_add_forced_hpd_control.diff.zip
(1.23 KiB) Downloaded 9 times
These users thanked the author joy for the post (total 2):
rooted (Fri Dec 20, 2019 4:16 pm) • alpe (Sat Dec 21, 2019 7:13 am)

alpe
Posts: 79
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 20 times
Been thanked: 6 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by alpe » Sat Dec 21, 2019 7:13 am

joy wrote:
Fri Dec 20, 2019 2:22 pm
Or I will share kernel and related images including this patch.
If possible, that would be great.
I've only build the kernel when I was using Armbian. I would have to do some search to build Odroid itself.

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by joy » Sat Dec 21, 2019 4:22 pm

Hi alpe,

Sure!
Please find an attachment, n2_nodisplay_test_20191221.tar.gz from this link.
https://drive.google.com/open?id=1sOn1t ... zZL0whUukR

1. Drop it in a folder of your N2 card and extract files.

Code: Select all

$ tar xvfz n2_nodisplay_test_20191221.tar.gz 
n2_nodisplay_test_20191221/Image.gz
n2_nodisplay_test_20191221/linux-image-4.9.205+_4.9.205+-1_arm64.deb
n2_nodisplay_test_20191221/meson64_odroidn2.dtb
2. Copy Image.gz and meson64_odroidn2.dtb in /media/boot/ folder.

3. Install linux-image-4.9.205+_4.9.205+-1_arm64.deb on N2 card.

Code: Select all

$ sudo dpkg -i linux-image-4.9.205+_4.9.205+-1_arm64.deb
4. Modify boot.ini
Please make sure your boot.ini should be modified.

Code: Select all

# Auto Detection of Monitor settings based on your Screen information
setenv display_autodetect "false"
setenv hdmimode "1080p60hz"

# HPD enable/disable option
setenv disablehpd "true
I need to keep modifying one more for the case of display_autodetect=true with this forced hpd option when hdmi cable is detached.
This issue is only shown from 2nd storage booting after petitboot. It seems a display_autodetect exception logic is needed in petitboot.

Code: Select all

[    0.000000@0] Kernel command line: root=/dev/mmcblk0p2 rootwait rw console=ttyS0,115200n8  no_console_suspend fsck.re
pair=yes net.ifnames=0 elevator=noop hdmimode=custombuilt cvbsmode=576cvbs max_freq_a53=1896 max_freq_a73=1800 maxcpus=6
 voutmode= modeline= disablehpd=true cvbscable= overscan=100  monitor_onoff=false usb-xhci.tablesize=2 logo=osd0,loaded
So please use manual mode 1080p60hz with display_autodetect=false for this test. ;)
I'm planning to add an exception logic in display drivers and I will share the status once I'm done.

5. Then, Reboot N2 system.

When you're available, please check if you have normal display.
Thanks!!! :D
These users thanked the author joy for the post (total 3):
alpe (Sat Dec 21, 2019 9:42 pm) • rooted (Sat Dec 21, 2019 9:57 pm) • odroid (Mon Dec 23, 2019 9:21 am)

alpe
Posts: 79
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 20 times
Been thanked: 6 times
Contact:

Re: Display only works if it is plugged in on boot

Unread post by alpe » Sat Dec 21, 2019 9:41 pm

That solved it.
Many thanks. ;)

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: [Solved] Display only works if it is plugged in on boot

Unread post by joy » Mon Dec 23, 2019 7:32 am

Hi @alpe,
Thank you for your confirmation. :D
The patch will be included in a next release once I'm done testing with other various cases.

alpe
Posts: 79
Joined: Sat Apr 12, 2014 1:21 pm
languages_spoken: portuguese, english
ODROIDs: C1, N2 4GB
Location: Rio de Janeiro, Brazil
Has thanked: 20 times
Been thanked: 6 times
Contact:

Re: [Solved] Display only works if it is plugged in on boot

Unread post by alpe » Mon Jan 13, 2020 9:00 pm

joy wrote:
Mon Dec 23, 2019 7:32 am
Hi @alpe,
Thank you for your confirmation. :D
The patch will be included in a next release once I'm done testing with other various cases.
Will it be included on https://github.com/hardkernel/linux ?
Or being included directly on Petitboot is enough?

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: [Solved] Display only works if it is plugged in on boot

Unread post by joy » Tue Jan 14, 2020 7:36 am

alpe wrote:
Mon Jan 13, 2020 9:00 pm
Will it be included on https://github.com/hardkernel/linux ?
Or being included directly on Petitboot is enough?
Hi @alpe,
The patch will be included on the hardkerne linux github and a next kernel package release.
I will check the schedule with the team and let the commit be pushed in the github.
These users thanked the author joy for the post:
alpe (Tue Jan 14, 2020 7:51 am)

joy
Posts: 997
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Has thanked: 43 times
Been thanked: 95 times
Contact:

Re: [Solved] Display only works if it is plugged in on boot

Unread post by joy » Thu Jan 16, 2020 6:12 pm

Hi @alpe,
The commit has been included in Hardkernel linux github today.
https://github.com/hardkernel/linux/com ... 6c02bb9fe7

And it's included in a new kernel package, 4.9.210-65. :)

(updated)
There was an issue with version update and it's fixed.
You will have a new version 4.9.210-66 today. ;)
These users thanked the author joy for the post:
alpe (Thu Jan 16, 2020 9:16 pm)

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 2 guests