aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.10/950-0718-overlays-Set-CMA-to-512MB-on-Pi-4-for-vc4.patch
blob: 43a2775af8b85a6340f118041c83d6e04f773907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
From aa4e10d677dfe14c7e3132595558bcbf2fc25aca Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Mon, 26 Jul 2021 11:05:18 +0100
Subject: [PATCH] overlays: Set CMA to 512MB on Pi 4 for vc4

Pi 4s have at least 1GB, and there are advantages to having more CMA
available (HEVC works out of the box, support for more complex video
setups, etc.) without significant disadvantages.

Can be overridden by appending a parameter to the dtoverlay line, e.g.
dtoverlay=vc4-fkms-v3d,cma-256

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
 arch/arm/boot/dts/overlays/Makefile           |  1 +
 arch/arm/boot/dts/overlays/README             | 17 +++++++
 arch/arm/boot/dts/overlays/overlay_map.dts    |  9 ++++
 .../dts/overlays/upstream-pi4-overlay.dts     |  2 +-
 .../dts/overlays/vc4-fkms-v3d-pi4-overlay.dts | 44 +++++++++++++++++++
 .../dts/overlays/vc4-kms-v3d-pi4-overlay.dts  |  6 ++-
 6 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/overlays/vc4-fkms-v3d-pi4-overlay.dts

--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -220,6 +220,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
 	upstream.dtbo \
 	upstream-pi4.dtbo \
 	vc4-fkms-v3d.dtbo \
+	vc4-fkms-v3d-pi4.dtbo \
 	vc4-kms-dpi-at056tn53v1.dtbo \
 	vc4-kms-dsi-7inch.dtbo \
 	vc4-kms-dsi-lt070me05000.dtbo \
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -3268,6 +3268,23 @@ Params: cma-512                 CMA is 5
         cma-default             Use upstream's default value
 
 
+Name:   vc4-fkms-v3d-pi4
+Info:   Enable Eric Anholt's DRM VC4 V3D driver on top of the dispmanx
+        display stack.
+Load:   dtoverlay=vc4-fkms-v3d-pi4,<param>
+Params: cma-512                 CMA is 512MB (needs 1GB)
+        cma-448                 CMA is 448MB (needs 1GB)
+        cma-384                 CMA is 384MB (needs 1GB)
+        cma-320                 CMA is 320MB (needs 1GB)
+        cma-256                 CMA is 256MB (needs 1GB)
+        cma-192                 CMA is 192MB (needs 1GB)
+        cma-128                 CMA is 128MB
+        cma-96                  CMA is 96MB
+        cma-64                  CMA is 64MB
+        cma-size                CMA size in bytes, 4MB aligned
+        cma-default             Use upstream's default value
+
+
 Name:   vc4-kms-dpi-at056tn53v1
 Info:   Enable an Innolux 5.6in VGA TFT connected to DPI interface under KMS.
         Requires vc4-kms-v3d to be loaded.
--- a/arch/arm/boot/dts/overlays/overlay_map.dts
+++ b/arch/arm/boot/dts/overlays/overlay_map.dts
@@ -138,6 +138,15 @@
 		bcm2711;
 	};
 
+	vc4-fkms-v3d {
+		bcm2835;
+		bcm2711 = "vc4-fkms-v3d-pi4";
+	};
+
+	vc4-fkms-v3d-pi4 {
+		bcm2711;
+	};
+
 	vc4-kms-v3d {
 		bcm2835;
 		bcm2711 = "vc4-kms-v3d-pi4";
--- a/arch/arm/boot/dts/overlays/upstream-pi4-overlay.dts
+++ b/arch/arm/boot/dts/overlays/upstream-pi4-overlay.dts
@@ -6,7 +6,7 @@
 #include <dt-bindings/clock/bcm2835.h>
 
 / {
-	compatible = "brcm,bcm2835";
+	compatible = "brcm,bcm2711";
 	fragment@0 {
 		target = <&ddc0>;
 		__overlay__ {
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-pi4-overlay.dts
@@ -0,0 +1,44 @@
+/*
+ * vc4-fkms-v3d-overlay.dts
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include "cma-overlay.dts"
+
+&frag0 {
+       size = <(512*1024*1024)>;
+};
+
+/ {
+	compatible = "brcm,bcm2711";
+
+	fragment@1 {
+		target = <&fb>;
+		__overlay__  {
+			status = "disabled";
+		};
+	};
+
+	fragment@2 {
+		target = <&firmwarekms>;
+		__overlay__  {
+			status = "okay";
+		};
+	};
+
+	fragment@3 {
+		target = <&v3d>;
+		__overlay__  {
+			status = "okay";
+		};
+	};
+
+	fragment@4 {
+		target = <&vc4>;
+		__overlay__  {
+			status = "okay";
+		};
+	};
+};
--- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-pi4-overlay.dts
+++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-pi4-overlay.dts
@@ -9,8 +9,12 @@
 
 #include "cma-overlay.dts"
 
+&frag0 {
+       size = <(512*1024*1024)>;
+};
+
 / {
-	compatible = "brcm,bcm2835";
+	compatible = "brcm,bcm2711";
 
 	fragment@1 {
 		target = <&ddc0>;