Changed head and sor

Refer to this file
tegra194-p2822-disp.dtsi
tegra194-p2822-disp.dtsi (3.1 KB)

fb0: Head0->SOR2->HDMI
fb1: Head1->SOR0->DP0
fb2: Head2->SOR1->DP1

Change the two DP outputs to HDMI output
This shows three FBDEV devices

fb0: Head0->SOR2->HDMI
fb1: Head1->SOR0->HDMI
fb2: Head2->SOR1->HDMI

3.Adjusting the “NVIDIA, DC-Connector” setting of HEDA0 and Head2
fb0: Head0->SOR1->HDMI0
fb1: Head1->SOR0->HDMI1
fb2: Head2->SOR2->HDMI2

But will cause the system to crash…
hdmi_nofree.txt (5.5 KB)

tegradc 15220000.nvdisplay: No free extcon HDMI slot for DC 2

please refer to

  1. set
    fb0: Head0->SOR2->HDMI
    fb1: Head1->SOR0->HDMI
    fb2: Head2->SOR1->HDMI
    is ok

2.disable fb2 can display fb0 fb1
set ok
fb0: Head0->SOR1->HDMI0
fb1: Head1->SOR0->HDMI1

3.but set
fb0: Head0->SOR1->HDMI0
fb1: Head1->SOR0->HDMI1
fb2: Head2->SOR2->HDMI2

still system to crash

  1. only enable fb2 is ok, (fb0 fb1 disable)
    fb2: Head2->SOR2->HDMI2

Are there three examples where sor is all set to hdmi output?

Is “head” and “sor” interchangeable?

SOR is mapping to the hardware pin but nvdisplay is pure software concept.

You can let each nvdisplay pick any SOR. But the mapping to hardware is fixed.

For example sor0 is mapping to HDMI_DP0 pin and sor1 is mapping to HDMI_DP1 pin.

Why is there a problem if I just swap the head and sor?

fb0: Head0->SOR2->HDMI0
fb1: Head1->SOR0->HDMI1
fb2: Head2->SOR1->HDMI2
ok

fb0: Head0->SOR1->HDMI2
fb1: Head1->SOR0->HDMI1
fb2: Head2->SOR2->HDMI0
system crash

You can try to dump the log and share full device tree. It is impossible for other people to check your problem by such description…

Why is there a problem if I just swap the head and sor?

fb0: Head0->SOR2->HDMI0
fb1: Head1->SOR0->HDMI1
fb2: Head2->SOR1->HDMI2
ok
3hdmi_head02_ok_1029 (39.2 KB)
3hdmi_head02_ok.tegra194-p2888-0001-p2822-0000.dtb.dts_1029 (499.9 KB)

fb0: Head0->SOR1->HDMI2
fb1: Head1->SOR0->HDMI1
fb2: Head2->SOR2->HDMI0
system crash
3hdmi_head01_err_1029 (43.8 KB)
3hdmi_head01_err.tegra194-p2888-0001-p2822-0000.dtb.dts_1029 (499.9 KB)

Please use dtc tool to convert the dtb file back to dts and attach the dts. Not give out a patch…

Those two files are text files
The differences are as follows

iei@iei-Precision-3640-Tower:/home/share/NVDIA_DATA/me$ diff 3hdmi_head01_err.tegra194-p2888-0001-p2822-0000.dtb.dts_1029 3hdmi_head02_ok.tegra194-p2888-0001-p2822-0000.dtb.dts_1029
13005c13005
< nvidia,dtbbuildtime = “Oct 29 2021”, “09:42:05”;

nvidia,dtbbuildtime = “Oct 29 2021”, “11:11:29”;
20277,20282d20276
< # 55 “/home/share/NVDIA_DATA/Tegra186_git_3261_org/tegra186/Linux_for_Tegra/sources/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t19x/galen/kernel-dts/iei_psm_amb_gen3.dtsi”
< nvidia,dc-connector = <&sor1>;
< status = “okay”;
<
<
<
20283a20278,20280
nvidia,dc-connector = <&sor2>;
status = “okay”;

61 “/home/share/NVDIA_DATA/Tegra186_git_3261_org/tegra186/Linux_for_Tegra/sources/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t19x/galen/kernel-dts/iei_psm_amb_gen3.dtsi”

20307,20312d20303
< # 100 “/home/share/NVDIA_DATA/Tegra186_git_3261_org/tegra186/Linux_for_Tegra/sources/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t19x/galen/kernel-dts/iei_psm_amb_gen3.dtsi”
< status = “okay”;
< nvidia,dc-connector = <&sor2>;
<
<
<
20313a20305,20307

status = “okay”;
nvidia,dc-connector = <&sor1>;

106 “/home/share/NVDIA_DATA/Tegra186_git_3261_org/tegra186/Linux_for_Tegra/sources/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t19x/galen/kernel-dts/iei_psm_amb_gen3.dtsi”

iei@iei-Precision-3640-Tower:/home/share/NVDIA_DATA/me$

Yes, I know what you shared. That is not how to check device tree.

Use the dtc tool to convert the dtb file back to dts and share it here. Is there any problem to understand this?

fb0: Head0->SOR2->HDMI0
fb1: Head1->SOR0->HDMI1
fb2: Head2->SOR1->HDMI2
ok
head02_ok.dts_1029 (361.8 KB)

fb0: Head0->SOR1->HDMI2
fb1: Head1->SOR0->HDMI1
fb2: Head2->SOR2->HDMI0
system crash
head01_err.dts_1029 (361.8 KB)

Looks like it needs to take time to investigate. Let me check and give feedback to you later.

Could you help do a debug here with below scenario:

->Disable FB2, keep FB0/1 alive and see if this issue would happen.

fb0: Head0->SOR1->HDMI2
fb1: Head1->SOR0->HDMI1
It is ok!!

Do you mean you disable fb2 in device tree?

&head0 {
nvidia,dc-connector = <&sor1>;
status = “okay”;
};

&head1 {
nvidia,dc-connector = <&sor0>;
status = “okay”;
};

&head2 {
status = “disabled”;
nvidia,dc-connector = <&sor2>;
};

So this issue would 100% reproduce when you enable fb2 only?

fb0/1 → disabled
fb2 ->enabled.

It is ok …

&head0 {
nvidia,dc-connector = <&sor1>;
status = “disabled”;
};

&head1 {
nvidia,dc-connector = <&sor0>;
status = “disabled”;
};

&head2 {
status = “okay”;
nvidia,dc-connector = <&sor2>;
};

hmm… it is really a weird situation.

Could you apply below patch first? See if we can resolve that extcon error first.

These two under k4.9

iff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index f640483..7fe9a10 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -200,6 +200,21 @@
 		.id = EXTCON_DISP_DSIHPD,
 		.name = "DSIHPD",
 	},
+	[EXTCON_DISP_HDMI2] = {
+		.type = EXTCON_TYPE_DISP,
+		.id = EXTCON_DISP_HDMI2,
+		.name = "HDMI2",
+	},
+	[EXTCON_DISP_HDMI3] = {
+		.type = EXTCON_TYPE_DISP,
+		.id = EXTCON_DISP_HDMI3,
+		.name = "HDMI3",
+	},
+	[EXTCON_DISP_HDMI4] = {
+		.type = EXTCON_TYPE_DISP,
+		.id = EXTCON_DISP_HDMI4,
+		.name = "HDMI4",
+	},
 
 	/* Miscellaneous external connector */
 	[EXTCON_DOCK] = {

diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index 724c6fd..223b0c2 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -79,6 +79,9 @@
 #define EXTCON_DISP_AUDIO_AUX2	48	/* Audio for SOR 2 */
 #define EXTCON_DISP_AUDIO_AUX3	49	/* Audio for SOR 3 */
 #define EXTCON_DISP_DSIHPD	50	/* DSI with hotplug support */
+#define EXTCON_DISP_HDMI2	51	/* 2nd HDMI port */
+#define EXTCON_DISP_HDMI3	52	/* 3rd HDMI port */
+#define EXTCON_DISP_HDMI4	53	/* 4th HDMI port */
 
 /* Miscellaneous external connector */
 #define EXTCON_DOCK		60
diff --git a/drivers/extcon/extcon-disp-state.c b/drivers/extcon/extcon-disp-state.c
index 4a4a83d..a59eb02 100644
--- a/drivers/extcon/extcon-disp-state.c
+++ b/drivers/extcon/extcon-disp-state.c
@@ -45,6 +45,9 @@
 	EXTCON_DISP_AUDIO_AUX2,
 	EXTCON_DISP_AUDIO_AUX3,
 	EXTCON_DISP_DSIHPD,
+	EXTCON_DISP_HDMI2,
+	EXTCON_DISP_HDMI3,
+	EXTCON_DISP_HDMI4,
 	EXTCON_NONE,
 };

These two under kernel/nvidia

diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index 18d734c..ff7ad8a 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -3402,15 +3402,32 @@
 	[TEGRA_DC_OUT_DP] = "DP"
 };
 
+static const int hdmi_extcon_cable_id[] = {
+	EXTCON_DISP_HDMI,
+	EXTCON_DISP_HDMI2,
+	EXTCON_DISP_HDMI3,
+	EXTCON_DISP_HDMI4
+};

can fix “No free extcon HDMI slot for DC”
But there will still be system crashes

fb0: Head0->SOR2->HDMI0
fb1: Head1->SOR0->HDMI1
fb2: Head2->SOR1->HDMI2
ok

1102_ok.log (40.7 KB)
1102_ok_tegra194-p2888-0001-p2822-0000.dts (361.2 KB)

fb0: Head0->SOR1->HDMI2
fb1: Head1->SOR0->HDMI1
fb2: Head2->SOR2->HDMI0
system crash

1102_err.log (38.1 KB)

1102_err_tegra194-p2888-0001-p2822-0000.dts (361.2 KB)

cant fix “No free extcon HDMI slot for DC”

“cant” or “can”? I see the error log is gone.

And your error log is not complete. Not a full log.