Skip to contentSkip to conversation

arm64: dts: qcom: sdm845: add framebuffer reserved memory

PATCH In review Caleb Connolly 2 participants 3 messages Mar 15, 2023 – Apr 4, 2023

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

PATCH v2 1/2 arm64: dts: qcom: sdm845: add framebuffer reserved memory

The bootloader configures a framebuffer in memory to display splash screens or other information. This configuration is overriden when the display pipeline probes, but never unmapped from the SMMU. To prevent issues from the kernel trying to allocate in this region and to allow using the framebuffer for debugging, many devices already reserve this region.

All devices follow MTP and use the same address for this region, Cheza is a likely exception though I'm not able to validate that.

Some devices only reserve the size needed to store the actual framebuffer, this is incorrect as on all devices I've checked the full 0x2400000 bytes are mapped.

This patch moves the framebuffer region to sdm845.dtsi and removes it from each individual device. This ensures that the correct size is always reserved and prevents having the add the region for each individual device.

This patch specifically ensures that this region is now reserved on the OnePlus 6, where it wasn't before.

---

Changes since v1:
* Offer more context and justification for this change
* Make sure Cheza doesn't inherit the node.

---
 arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi              | 6 ------
 arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts     | 5 -----
 arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts           | 5 -----
 arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi       | 6 ------
 .../arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi | 6 ------
 arch/arm64/boot/dts/qcom/sdm845.dtsi                        | 5 +++++
 arch/arm64/boot/dts/qcom/sdm850.dtsi                        | 2 ++
 7 files changed, 7 insertions(+), 28 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi +0 -6
index f942c5afea9b..6a1c674a015b 100644
@@ -93,12 +93,6 @@ spss_mem: memory@99000000 {
 			no-map;
 		};
 
-		/* Framebuffer region */
-		memory@9d400000 {
-			reg = <0x0 0x9d400000 0x0 0x2400000>;
-			no-map;
-		};
-
 		/* rmtfs lower guard */
 		memory@f0800000 {
 			reg = <0 0xf0800000 0 0x1000>;
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +0 -5
index d37a433130b9..7c2457948a32 100644
@@ -55,11 +55,6 @@ vreg_s4a_1p8: pm8998-smps4 {
 	};
 
 	reserved-memory {
-		memory@9d400000 {
-			reg = <0x0 0x9d400000 0x0 0x02400000>;
-			no-map;
-		};
-
 		memory@a1300000 {
 			compatible = "ramoops";
 			reg = <0x0 0xa1300000 0x0 0x100000>;
arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +0 -5
index b54e304abf71..4f6b1053c15b 100644
@@ -60,11 +60,6 @@ key-vol-up {
 	};
 
 	reserved-memory {
-		framebuffer_region@9d400000 {
-			reg = <0x0 0x9d400000 0x0 (1080 * 2160 * 4)>;
-			no-map;
-		};
-
 		ramoops: ramoops@b0000000 {
 			compatible = "ramoops";
 			reg = <0 0xb0000000 0 0x00400000>;
arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi +0 -6
index 4984c7496c31..7e273cc0158d 100644
@@ -79,12 +79,6 @@ vreg_s4a_1p8: pm8998-smps4 {
 	};
 
 	reserved-memory {
-		/* SONY was cool and didn't diverge from MTP this time, yay! */
-		cont_splash_mem: memory@9d400000 {
-			reg = <0x0 0x9d400000 0x0 0x2400000>;
-			no-map;
-		};
-
 		ramoops@ffc00000 {
 			compatible = "ramoops";
 			reg = <0x0 0xffc00000 0x0 0x100000>;
arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi +0 -6
index e0fda4d754fe..191c2664f721 100644
@@ -98,12 +98,6 @@ spss_mem: memory@97f00000 {
 			no-map;
 		};
 
-		/* Cont splash region set up by the bootloader */
-		cont_splash_mem: framebuffer@9d400000 {
-			reg = <0 0x9d400000 0 0x2400000>;
-			no-map;
-		};
-
 		rmtfs_mem: memory@f6301000 {
 			compatible = "qcom,rmtfs-mem";
 			reg = <0 0xf6301000 0 0x200000>;
arch/arm64/boot/dts/qcom/sdm845.dtsi +5 -0
index 479859bd8ab3..ecec2ee46683 100644
@@ -865,6 +865,11 @@ spss_mem: spss@97b00000 {
 			no-map;
 		};
 
+		cont_splash_mem: framebuffer@9d400000 {
+			reg = <0 0x9d400000 0 0x2400000>;
+			no-map;
+		};
+
 		mdata_mem: mpss-metadata {
 			alloc-ranges = <0 0xa0000000 0 0x20000000>;
 			size = <0 0x4000>;
arch/arm64/boot/dts/qcom/sdm850.dtsi +2 -0
index da9f6fbe32f6..b787575c77a5 100644
@@ -7,6 +7,8 @@
 
 #include "sdm845.dtsi"
 
+/delete-node/ &cont_splash_mem;
+
 &cpu4_opp_table {
 	cpu4_opp33: opp-2841600000 {
 		opp-hz = /bits/ 64 <2841600000>;
Signature · 1 line
2.39.2
#1 lore raw

PATCH v2 2/2 arm64: dts: qcom: sdm850: commonise framebuffer memory

This region needs to be reserved as it's mapped by the bootloader and the kernel doesn't currently have a way of unmapping it.

Both the Galaxy Book2 and C630 use the same address and size for the framebuffer reserved memory region. Move the definition to sdm850.dtsi.

The c630 was missing this region, this patch ensures that it's reserved there too.

---
 arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts | 6 ------
 arch/arm64/boot/dts/qcom/sdm850.dtsi             | 9 +++++++++
 2 files changed, 9 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts +0 -6
index 9850140514ba..6e36ad2f2d3e 100644
@@ -61,12 +61,6 @@ aliases {
 
 	/* Reserved memory changes */
 	reserved-memory {
-		/* Bootloader display framebuffer region */
-		cont_splash_mem: memory@80400000 {
-			reg = <0x0 0x80400000 0x0 0x960000>;
-			no-map;
-		};
-
 		qseecom_mem: memory@8b500000 {
 			reg = <0 0x8b500000 0 0xa00000>;
 			no-map;
arch/arm64/boot/dts/qcom/sdm850.dtsi +9 -0
index b787575c77a5..89eda97daa57 100644
@@ -9,6 +9,15 @@
 
 /delete-node/ &cont_splash_mem;
 
+/ {
+	reserved-memory {
+		cont_splash_mem: framebuffer@80400000 {
+			reg = <0x0 0x80400000 0x0 0x960000>;
+			no-map;
+		};
+	};
+};
+
 &cpu4_opp_table {
 	cpu4_opp33: opp-2841600000 {
 		opp-hz = /bits/ 64 <2841600000>;
Signature · 1 line
2.39.2
maintainer
#2 lore raw
In reply to Caleb Connolly
Quoted 3 lines · Caleb Connolly

The bootloader configures a framebuffer in memory to display splash screens or other information. This configuration is overriden when the display pipeline probes, but never unmapped from the SMMU.

Are you saying that as the SMMU driver clears the register content, this mapping remains?

Quoted 5 lines

To prevent
issues from the kernel trying to allocate in this region and to allow using the framebuffer for debugging, many devices already reserve this region.

What kind of issues do you see?

Regards,
Bjorn

Quoted 146 lines

All devices follow MTP and use the same address for this region, Cheza is a likely exception though I'm not able to validate that.

Some devices only reserve the size needed to store the actual framebuffer, this is incorrect as on all devices I've checked the full 0x2400000 bytes are mapped.

This patch moves the framebuffer region to sdm845.dtsi and removes it from each individual device. This ensures that the correct size is always reserved and prevents having the add the region for each individual device.

This patch specifically ensures that this region is now reserved on the OnePlus 6, where it wasn't before.

---

Changes since v1:
* Offer more context and justification for this change
* Make sure Cheza doesn't inherit the node.

---
 arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi              | 6 ------
 arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts     | 5 -----
 arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts           | 5 -----
 arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi       | 6 ------
 .../arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi | 6 ------
 arch/arm64/boot/dts/qcom/sdm845.dtsi                        | 5 +++++
 arch/arm64/boot/dts/qcom/sdm850.dtsi                        | 2 ++
 7 files changed, 7 insertions(+), 28 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi +0 -6
index f942c5afea9b..6a1c674a015b 100644
@@ -93,12 +93,6 @@ spss_mem: memory@99000000 {
 			no-map;
 		};
 
-		/* Framebuffer region */
-		memory@9d400000 {
-			reg = <0x0 0x9d400000 0x0 0x2400000>;
-			no-map;
-		};
-
 		/* rmtfs lower guard */
 		memory@f0800000 {
 			reg = <0 0xf0800000 0 0x1000>;
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts +0 -5
index d37a433130b9..7c2457948a32 100644
@@ -55,11 +55,6 @@ vreg_s4a_1p8: pm8998-smps4 {
 	};
 
 	reserved-memory {
-		memory@9d400000 {
-			reg = <0x0 0x9d400000 0x0 0x02400000>;
-			no-map;
-		};
-
 		memory@a1300000 {
 			compatible = "ramoops";
 			reg = <0x0 0xa1300000 0x0 0x100000>;
arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +0 -5
index b54e304abf71..4f6b1053c15b 100644
@@ -60,11 +60,6 @@ key-vol-up {
 	};
 
 	reserved-memory {
-		framebuffer_region@9d400000 {
-			reg = <0x0 0x9d400000 0x0 (1080 * 2160 * 4)>;
-			no-map;
-		};
-
 		ramoops: ramoops@b0000000 {
 			compatible = "ramoops";
 			reg = <0 0xb0000000 0 0x00400000>;
arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi +0 -6
index 4984c7496c31..7e273cc0158d 100644
@@ -79,12 +79,6 @@ vreg_s4a_1p8: pm8998-smps4 {
 	};
 
 	reserved-memory {
-		/* SONY was cool and didn't diverge from MTP this time, yay! */
-		cont_splash_mem: memory@9d400000 {
-			reg = <0x0 0x9d400000 0x0 0x2400000>;
-			no-map;
-		};
-
 		ramoops@ffc00000 {
 			compatible = "ramoops";
 			reg = <0x0 0xffc00000 0x0 0x100000>;
arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi +0 -6
index e0fda4d754fe..191c2664f721 100644
@@ -98,12 +98,6 @@ spss_mem: memory@97f00000 {
 			no-map;
 		};
 
-		/* Cont splash region set up by the bootloader */
-		cont_splash_mem: framebuffer@9d400000 {
-			reg = <0 0x9d400000 0 0x2400000>;
-			no-map;
-		};
-
 		rmtfs_mem: memory@f6301000 {
 			compatible = "qcom,rmtfs-mem";
 			reg = <0 0xf6301000 0 0x200000>;
arch/arm64/boot/dts/qcom/sdm845.dtsi +5 -0
index 479859bd8ab3..ecec2ee46683 100644
@@ -865,6 +865,11 @@ spss_mem: spss@97b00000 {
 			no-map;
 		};
 
+		cont_splash_mem: framebuffer@9d400000 {
+			reg = <0 0x9d400000 0 0x2400000>;
+			no-map;
+		};
+
 		mdata_mem: mpss-metadata {
 			alloc-ranges = <0 0xa0000000 0 0x20000000>;
 			size = <0 0x4000>;
arch/arm64/boot/dts/qcom/sdm850.dtsi +2 -0
index da9f6fbe32f6..b787575c77a5 100644
@@ -7,6 +7,8 @@
 
 #include "sdm845.dtsi"
 
+/delete-node/ &cont_splash_mem;
+
 &cpu4_opp_table {
 	cpu4_opp33: opp-2841600000 {
 		opp-hz = /bits/ 64 <2841600000>;
Signature · 1 line
2.39.2