Skip to contentSkip to conversation

arm64: boot: dts: qcom: sm8150: enable framebuffer for Surface Duo

PATCH In review Felipe Balbi 3 participants 11 messages Dec 17, 2021 – Dec 18, 2021 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover arm64: boot: dts: qcom: sm8150: enable framebuffer for Surface Duo

From: Felipe Balbi <[email protected]>

Hi folks,

I'm trying to enable the framebuffer on Microsoft Surface Duo. Looking through some internal docs, it came to my attention that the bootloader will fill up the framebuffer address and size to a memory node names splash_region. Adding the node, I can see the address of the framebuffer. Creating the relevant framebuffer device using simple-framebuffer, I can't see it working. Tried dd if=/dev/urandom of=/dev/fb0 and fb-test. None of which manage to get rid of what's already on the screen, put there by the bootloader (platform Logo).

Wondering if any of you have seen a behavior such as this and how did you manage to get framebuffer working on SM8150 (I see at least Sony Xperia has the node).

Felipe Balbi (2):
arm64: boot: dts: qcom: sm8150: add a label for reserved-memory
arm64: boot: dts: qcom: surface duo: add minimal framebuffer

 .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 arm64: boot: dts: qcom: sm8150: add a label for reserved-memory

From: Felipe Balbi <[email protected]>

With this label, we can let boards append board-specific memory regions which should not be mapped.

---
 arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +1 -1
index 15348512cf9e..26f9eb8e9b42 100644
@@ -660,7 +660,7 @@ CLUSTER_PD: cpu-cluster0 {
 		};
 	};
 
-	reserved-memory {
+	reserved_memory: reserved-memory {
 		#address-cells = <2>;
 		#size-cells = <2>;
 		ranges;
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/2 arm64: boot: dts: qcom: surface duo: add minimal framebuffer

In reply to Felipe Balbi

From: Felipe Balbi <[email protected]>

Add a minimal framebuffer device so we can use the display on the Surface Duo device.

---
 .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +19 -0
index a73317e1a824..c629ec115fec 100644
@@ -25,6 +25,17 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	framebuffer0: framebuffer@9c000000 {
+		compatible = "simple-framebuffer";
+		reg = <0 0x9c000000 0 0x02400000>;
+		status = "okay";
+
+		height = <1800>;
+		width = <1350>;
+		stride = <(1350 * 4)>;
+		format = "a8r8g8b8";
+	};
+
 	vph_pwr: vph-pwr-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vph_pwr";
@@ -472,6 +483,14 @@ &pon_resin {
 	linux,code = <KEY_VOLUMEDOWN>;
 };
 
+&reserved_memory {
+	splash_region: splash_region@9c000000 {
+		/* We expect the bootloader to fill in the size */
+		reg = <0x0 0x9c000000 0x0 0x0>;
+		no-map;
+	};
+};
+
 &tlmm {
 	gpio-reserved-ranges = <126 4>;
 
Signature · 1 line
2.34.1
#3 lore raw

Re: [RFC/patch 2/2] arm64: boot: dts: qcom: surface duo: add minimal framebuffer

Quoted 15 lines · Felipe Balbi

From: Felipe Balbi <[email protected]>

Add a minimal framebuffer device so we can use the display on the Surface Duo device.

---
 .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +0 -0
index a73317e1a824..c629ec115fec 100644

arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts chosen { · line 30

Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +3 -0
@@ -25,6 +25,17 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	framebuffer0: framebuffer@9c000000 {
+		compatible = "simple-framebuffer";
+		reg = <0 0x9c000000 0 0x02400000>;

You can remove the leading 0 in the size cell.

arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts chosen { · line 31

Quoted 1 line
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +1 -0
+		status = "okay";

This line is unnecessary, as it's enabled by default

Quoted 11 lines
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +7 -0
+
+		height = <1800>;
+		width = <1350>;
+		stride = <(1350 * 4)>;
+		format = "a8r8g8b8";
+	};
+
 	vph_pwr: vph-pwr-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vph_pwr";

arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts &pon_resin { · line 488

Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +3 -0
@@ -472,6 +483,14 @@ &pon_resin {
 	linux,code = <KEY_VOLUMEDOWN>;
 };
 
+&reserved_memory {
+	splash_region: splash_region@9c000000 {
+		/* We expect the bootloader to fill in the size */

Would it be different than the framebuffer size?

arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts &pon_resin { · line 496

Quoted 8 lines
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +5 -0
+		reg = <0x0 0x9c000000 0x0 0x0>;
+		no-map;
+	};
+};
+
 &tlmm {
 	gpio-reserved-ranges = <126 4>;
 

Konrad

#4 lore raw

Re: [RFC/patch 2/2] arm64: boot: dts: qcom: surface duo: add minimal framebuffer

Hi,

Quoted 19 lines · Konrad Dybcio
Quoted 18 lines · Felipe Balbi

From: Felipe Balbi <[email protected]>

Add a minimal framebuffer device so we can use the display on the Surface Duo device.

---
 .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +0 -0
index a73317e1a824..c629ec115fec 100644
@@ -25,6 +25,17 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
Quoted 5 lines

arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts chosen { · line 30

Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +3 -0
+	framebuffer0: framebuffer@9c000000 {
+		compatible = "simple-framebuffer";
+		reg = <0 0x9c000000 0 0x02400000>;

You can remove the leading 0 in the size cell.

okay

Quoted 3 lines

arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts chosen { · line 31

Quoted 1 line
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +1 -0
+		status = "okay";

This line is unnecessary, as it's enabled by default

understood

Quoted 9 lines

arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts &pon_resin { · line 488

Quoted 7 lines
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +3 -0
@@ -472,6 +483,14 @@ &pon_resin {
 	linux,code = <KEY_VOLUMEDOWN>;
 };
 
+&reserved_memory {
+	splash_region: splash_region@9c000000 {
+		/* We expect the bootloader to fill in the size */

Would it be different than the framebuffer size?

honestly, I used this mainly to get the correct base address and size. I had 0 everywhere and bootloader filled the entire thing for me. I can just hardcode with the expected values anyway.

Signature · 1 line
balbi

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Re: [RFC/patch 2/2] arm64: boot: dts: qcom: surface duo: add minimal framebuffer

Hi,

Quoted 10 lines · Alexey Minnekhanov
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +4 -0
@@ -472,6 +483,14 @@ &pon_resin {
 	linux,code = <KEY_VOLUMEDOWN>;
 };
 
+&reserved_memory {
+	splash_region: splash_region@9c000000 {
+		/* We expect the bootloader to fill in the size */
+		reg = <0x0 0x9c000000 0x0 0x0>;
 

0x2400000 should be here as size, maybe?

bootloader is filling that up, but sure I only used this to get the size and base address from bootloader. I could just hardcode the values now that I know them :-)

Quoted 8 lines
	 cont_splash_mem: memory@9c000000 {
		reg = <0x0 0x9c000000 0x0 0x2400000>;
		no-map;
	};

FWIW, example above (with similar simple-framebuffer node) worked fine for my sm8150 based device.

Oh okay. So it's likely to be something specific to our bootloader.

Signature · 1 line
balbi
#7 lore raw
In reply to Felipe Balbi
Quoted 17 lines · Felipe Balbi

From: Felipe Balbi <[email protected]>

Hi folks,

I'm trying to enable the framebuffer on Microsoft Surface Duo. Looking through some internal docs, it came to my attention that the bootloader will fill up the framebuffer address and size to a memory node names splash_region. Adding the node, I can see the address of the framebuffer. Creating the relevant framebuffer device using simple-framebuffer, I can't see it working. Tried dd if=/dev/urandom of=/dev/fb0 and fb-test. None of which manage to get rid of what's already on the screen, put there by the bootloader (platform Logo).

Wondering if any of you have seen a behavior such as this and how did you manage to get framebuffer working on SM8150 (I see at least Sony Xperia has the node).

Quoted 7 lines

Felipe Balbi (2):
arm64: boot: dts: qcom: sm8150: add a label for reserved-memory
arm64: boot: dts: qcom: surface duo: add minimal framebuffer

 .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

Hi,

this issue is totally unique to the Duo and your bootloader configuration.

Gus (CCd, co-author of Lumia 950/XL patches) and I were dissecting this precise

issue (albeit for a different usecase) and in our testing it turned out that XBL likely

kills the display stack upon exiting Boot Services and jumping to LinuxLoader. This may

be a bug that comes from the legacy of this device, as exiting Boot Services would

be rather undesirable in that scenario..

One fix would be to ask the bootloader team to look into it and fix it from there,

otherwise you'd have to bring up the display using the DPU1 driver, or perhaps in a

third-stage-bootloader (pls don't do it for the sanity of us all :D)

You can see the thing happening during the boot animation when the Microsoft

logo goes black for a split second and then it reappears with the "Powered by Android"

splash a short while after.

P.S I don't have this device and I'm only speaking on behalf of what we discovered

on Gus's one.

Konrad

#8 lore raw

Hi Konrad,

Quoted 32 lines · Konrad Dybcio
Quoted 17 lines · Felipe Balbi

From: Felipe Balbi <[email protected]>

Hi folks,

I'm trying to enable the framebuffer on Microsoft Surface Duo. Looking through some internal docs, it came to my attention that the bootloader will fill up the framebuffer address and size to a memory node names splash_region. Adding the node, I can see the address of the framebuffer. Creating the relevant framebuffer device using simple-framebuffer, I can't see it working. Tried dd if=/dev/urandom of=/dev/fb0 and fb-test. None of which manage to get rid of what's already on the screen, put there by the bootloader (platform Logo).

Wondering if any of you have seen a behavior such as this and how did you manage to get framebuffer working on SM8150 (I see at least Sony Xperia has the node).

Quoted 7 lines

Felipe Balbi (2):
arm64: boot: dts: qcom: sm8150: add a label for reserved-memory
arm64: boot: dts: qcom: surface duo: add minimal framebuffer

 .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

Hi,

this issue is totally unique to the Duo and your bootloader configuration.

Quoted 6 lines

Gus (CCd, co-author of Lumia 950/XL patches) and I were dissecting this precise issue (albeit for a different usecase) and in our testing it turned out that XBL likely kills the display stack upon exiting Boot Services and jumping to LinuxLoader. This may be a bug that comes from the legacy of this device, as exiting Boot Services would be rather undesirable in that scenario..

This is very nice background information which I didn't have. Thanks :-)

Quoted 3 lines

One fix would be to ask the bootloader team to look into it and fix it from there, otherwise you'd have to bring up the display using the DPU1 driver, or perhaps in a third-stage-bootloader (pls don't do it

I'll give DPU1 a shot, thanks for the pointer

Quoted 1 line

for the sanity of us all :D)

no 3rd stages :-)

Signature · 1 line
balbi
#9 lore raw
Quoted 41 lines · Felipe Balbi

Hi Konrad,

Quoted 31 lines · Konrad Dybcio
Quoted 17 lines · Felipe Balbi

From: Felipe Balbi <[email protected]>

Hi folks,

I'm trying to enable the framebuffer on Microsoft Surface Duo. Looking through some internal docs, it came to my attention that the bootloader will fill up the framebuffer address and size to a memory node names splash_region. Adding the node, I can see the address of the framebuffer. Creating the relevant framebuffer device using simple-framebuffer, I can't see it working. Tried dd if=/dev/urandom of=/dev/fb0 and fb-test. None of which manage to get rid of what's already on the screen, put there by the bootloader (platform Logo).

Wondering if any of you have seen a behavior such as this and how did you manage to get framebuffer working on SM8150 (I see at least Sony Xperia has the node).

Quoted 7 lines

Felipe Balbi (2):
arm64: boot: dts: qcom: sm8150: add a label for reserved-memory
arm64: boot: dts: qcom: surface duo: add minimal framebuffer

 .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

Hi,

this issue is totally unique to the Duo and your bootloader configuration.

Quoted 6 lines

Gus (CCd, co-author of Lumia 950/XL patches) and I were dissecting this precise issue (albeit for a different usecase) and in our testing it turned out that XBL likely kills the display stack upon exiting Boot Services and jumping to LinuxLoader. This may be a bug that comes from the legacy of this device, as exiting Boot Services would be rather undesirable in that scenario..

Quoted 6 lines

This is very nice background information which I didn't have. Thanks :-)

Quoted 3 lines

One fix would be to ask the bootloader team to look into it and fix it from there, otherwise you'd have to bring up the display using the DPU1 driver, or perhaps in a third-stage-bootloader (pls don't do it

I'll give DPU1 a shot, thanks for the pointer

Won't work yet. Your display (well, displays.. hehe) are CMD mode and

have DSC. Both of which are unsupported on SM8150. DSC patches by Vinod

seem to only work on 845 (or at least don't work on 8250 for me) and Marijn

from SoMainline (added to CC) is working on cleaning up CMD mode

support, as Qualcomm moved the pingpong functionality (basically

the way of SoC telling the panel HEY IT'S TIME TO DRAW A FRAME)

to a different hardware block and that needs some care in code).

Quoted 3 lines
Quoted 1 line

for the sanity of us all :D)

no 3rd stages :-)

Good :P

Konrad

#10 lore raw
In reply to Felipe Balbi

Hi,

Quoted 14 lines · Felipe Balbi

From: Felipe Balbi <[email protected]>

Hi folks,

I'm trying to enable the framebuffer on Microsoft Surface Duo. Looking through some internal docs, it came to my attention that the bootloader will fill up the framebuffer address and size to a memory node names splash_region. Adding the node, I can see the address of the framebuffer. Creating the relevant framebuffer device using simple-framebuffer, I can't see it working. Tried dd if=/dev/urandom of=/dev/fb0 and fb-test. None of which manage to get rid of what's already on the screen, put there by the bootloader (platform Logo).

Quoted 3 lines

Wondering if any of you have seen a behavior such as this and how did you manage to get framebuffer working on SM8150 (I see at least Sony Xperia has the node).

What issues do you have with the DRM_MSM/DPU1 driver? I think it supports 8150.

Quoted 11 lines

Felipe Balbi (2):
arm64: boot: dts: qcom: sm8150: add a label for reserved-memory
arm64: boot: dts: qcom: surface duo: add minimal framebuffer

 .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

--
2.34.1

Signature · 2 lines
With best wishes
Dmitry
#11 lore raw

Hi,

Quoted 17 lines · Dmitry Baryshkov

Hi,

Quoted 14 lines · Felipe Balbi

From: Felipe Balbi <[email protected]>

Hi folks,

I'm trying to enable the framebuffer on Microsoft Surface Duo. Looking through some internal docs, it came to my attention that the bootloader will fill up the framebuffer address and size to a memory node names splash_region. Adding the node, I can see the address of the framebuffer. Creating the relevant framebuffer device using simple-framebuffer, I can't see it working. Tried dd if=/dev/urandom of=/dev/fb0 and fb-test. None of which manage to get rid of what's already on the screen, put there by the bootloader (platform Logo).

Quoted 5 lines
Quoted 3 lines

Wondering if any of you have seen a behavior such as this and how did you manage to get framebuffer working on SM8150 (I see at least Sony Xperia has the node).

What issues do you have with the DRM_MSM/DPU1 driver? I think it supports 8150.

I haven't tried using it. I'll give it a shot next week.

Signature · 1 line
balbi