Skip to content

Commit 2b6433f

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
dt-bindings: display: mediatek: Add OF graph support for board path
The display IPs in MediaTek SoCs support being interconnected with different instances of DDP IPs (for example, merge0 or merge1) and/or with different DDP IPs (for example, rdma can be connected with either color, dpi, dsi, merge, etc), forming a full Display Data Path that ends with an actual display. The final display pipeline is effectively board specific, as it does depend on the display that is attached to it, and eventually on the sensors supported by the board (for example, Adaptive Ambient Light would need an Ambient Light Sensor, otherwise it's pointless!), other than the output type. Add support for OF graphs to most of the MediaTek DDP (display) bindings to add flexibility to build custom hardware paths, hence enabling board specific configuration of the display pipeline and allowing to finally migrate away from using hardcoded paths. Please note that - while this commit retains retro-compatibility with old device trees - it will break the ABI for mediatek,dsi and for mediatek,dpi for the sake of consistency between the `ports` in all MediaTek DRM drivers versus DRM bridge drivers as in the previous binding, MediaTek was using `port` (implicitly, port@0) as an OUTPUT, while now the first port is an INPUT, and the second one is an OUTPUT, which is consistent with other DRM drivers which can be chained to drm/mediatek. As for maintainability concerns, I am aware that the old device tree will not be actively tested anymore, but retrocompatibility breakages will *not* be more likely to happen in the future because any addition to the graph (new drivers) will be done only for features present on newer SoCs, keeping the old ones (and their default pipeline) untouched. Reviewed-by: Rob Herring (Arm) <[email protected]> Reviewed-by: Alexandre Mergnat <[email protected]> Tested-by: Alexandre Mergnat <[email protected]> Reviewed-by: CK Hu <[email protected]> Tested-by: Michael Walle <[email protected]> # on kontron-sbc-i1200 Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 9852d85 commit 2b6433f

16 files changed

+372
-3
lines changed

Documentation/devicetree/bindings/display/mediatek/mediatek,aal.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,27 @@ properties:
6262
$ref: /schemas/types.yaml#/definitions/phandle-array
6363
maxItems: 1
6464

65+
ports:
66+
$ref: /schemas/graph.yaml#/properties/ports
67+
description:
68+
Input and output ports can have multiple endpoints, each of those
69+
connects to either the primary, secondary, etc, display pipeline.
70+
71+
properties:
72+
port@0:
73+
$ref: /schemas/graph.yaml#/properties/port
74+
description: AAL input port
75+
76+
port@1:
77+
$ref: /schemas/graph.yaml#/properties/port
78+
description:
79+
AAL output to the next component's input, for example could be one
80+
of many gamma, overdrive or other blocks.
81+
82+
required:
83+
- port@0
84+
- port@1
85+
6586
required:
6687
- compatible
6788
- reg
@@ -89,5 +110,24 @@ examples:
89110
power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
90111
clocks = <&mmsys CLK_MM_DISP_AAL>;
91112
mediatek,gce-client-reg = <&gce SUBSYS_1401XXXX 0x5000 0x1000>;
113+
114+
ports {
115+
#address-cells = <1>;
116+
#size-cells = <0>;
117+
118+
port@0 {
119+
reg = <0>;
120+
aal0_in: endpoint {
121+
remote-endpoint = <&ccorr0_out>;
122+
};
123+
};
124+
125+
port@1 {
126+
reg = <1>;
127+
aal0_out: endpoint {
128+
remote-endpoint = <&gamma0_in>;
129+
};
130+
};
131+
};
92132
};
93133
};

Documentation/devicetree/bindings/display/mediatek/mediatek,ccorr.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,27 @@ properties:
5757
$ref: /schemas/types.yaml#/definitions/phandle-array
5858
maxItems: 1
5959

60+
ports:
61+
$ref: /schemas/graph.yaml#/properties/ports
62+
description:
63+
Input and output ports can have multiple endpoints, each of those
64+
connects to either the primary, secondary, etc, display pipeline.
65+
66+
properties:
67+
port@0:
68+
$ref: /schemas/graph.yaml#/properties/port
69+
description: CCORR input port
70+
71+
port@1:
72+
$ref: /schemas/graph.yaml#/properties/port
73+
description:
74+
CCORR output to the input of the next desired component in the
75+
display pipeline, usually only one of the available AAL blocks.
76+
77+
required:
78+
- port@0
79+
- port@1
80+
6081
required:
6182
- compatible
6283
- reg

Documentation/devicetree/bindings/display/mediatek/mediatek,color.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,28 @@ properties:
6565
$ref: /schemas/types.yaml#/definitions/phandle-array
6666
maxItems: 1
6767

68+
ports:
69+
$ref: /schemas/graph.yaml#/properties/ports
70+
description:
71+
Input and output ports can have multiple endpoints, each of those
72+
connects to either the primary, secondary, etc, display pipeline.
73+
74+
properties:
75+
port@0:
76+
$ref: /schemas/graph.yaml#/properties/port
77+
description: COLOR input port
78+
79+
port@1:
80+
$ref: /schemas/graph.yaml#/properties/port
81+
description:
82+
COLOR output to the input of the next desired component in the
83+
display pipeline, for example one of the available CCORR or AAL
84+
blocks.
85+
86+
required:
87+
- port@0
88+
- port@1
89+
6890
required:
6991
- compatible
7092
- reg

Documentation/devicetree/bindings/display/mediatek/mediatek,dither.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,28 @@ properties:
5656
$ref: /schemas/types.yaml#/definitions/phandle-array
5757
maxItems: 1
5858

59+
ports:
60+
$ref: /schemas/graph.yaml#/properties/ports
61+
description:
62+
Input and output ports can have multiple endpoints, each of those
63+
connects to either the primary, secondary, etc, display pipeline.
64+
65+
properties:
66+
port@0:
67+
$ref: /schemas/graph.yaml#/properties/port
68+
description: DITHER input, usually from a POSTMASK or GAMMA block.
69+
70+
port@1:
71+
$ref: /schemas/graph.yaml#/properties/port
72+
description:
73+
DITHER output to the input of the next desired component in the
74+
display pipeline, for example one of the available DSC compressors,
75+
DP_INTF, DSI, LVDS or others.
76+
77+
required:
78+
- port@0
79+
- port@1
80+
5981
required:
6082
- compatible
6183
- reg

Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,34 @@ properties:
7171
Output port node. This port should be connected to the input port of an
7272
attached HDMI, LVDS or DisplayPort encoder chip.
7373

74+
ports:
75+
$ref: /schemas/graph.yaml#/properties/ports
76+
77+
properties:
78+
port@0:
79+
$ref: /schemas/graph.yaml#/properties/port
80+
description: DPI input port
81+
82+
port@1:
83+
$ref: /schemas/graph.yaml#/properties/port
84+
description: DPI output to an HDMI, LVDS or DisplayPort encoder input
85+
86+
required:
87+
- port@0
88+
- port@1
89+
7490
required:
7591
- compatible
7692
- reg
7793
- interrupts
7894
- clocks
7995
- clock-names
80-
- port
96+
97+
oneOf:
98+
- required:
99+
- port
100+
- required:
101+
- ports
81102

82103
allOf:
83104
- if:
@@ -100,7 +121,7 @@ examples:
100121
#include <dt-bindings/interrupt-controller/arm-gic.h>
101122
#include <dt-bindings/clock/mt8173-clk.h>
102123
103-
dpi0: dpi@1401d000 {
124+
dpi: dpi@1401d000 {
104125
compatible = "mediatek,mt8173-dpi";
105126
reg = <0x1401d000 0x1000>;
106127
interrupts = <GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>;

Documentation/devicetree/bindings/display/mediatek/mediatek,dsc.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,30 @@ properties:
4949
$ref: /schemas/types.yaml#/definitions/phandle-array
5050
maxItems: 1
5151

52+
ports:
53+
$ref: /schemas/graph.yaml#/properties/ports
54+
description:
55+
Input and output ports can have multiple endpoints, each of those
56+
connects to either the primary, secondary, etc, display pipeline.
57+
58+
properties:
59+
port@0:
60+
$ref: /schemas/graph.yaml#/properties/port
61+
description:
62+
Display Stream Compression input, usually from one of the DITHER
63+
or MERGE blocks.
64+
65+
port@1:
66+
$ref: /schemas/graph.yaml#/properties/port
67+
description:
68+
Display Stream Compression output to the input of the next desired
69+
component in the display pipeline, for example to MERGE, DP_INTF,
70+
DPI or DSI.
71+
72+
required:
73+
- port@0
74+
- port@1
75+
5276
required:
5377
- compatible
5478
- reg

Documentation/devicetree/bindings/display/mediatek/mediatek,dsi.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,26 @@ properties:
7777
Output port node. This port should be connected to the input
7878
port of an attached DSI panel or DSI-to-eDP encoder chip.
7979

80+
ports:
81+
$ref: /schemas/graph.yaml#/properties/ports
82+
description:
83+
Input ports can have multiple endpoints, each of those connects
84+
to either the primary, secondary, etc, display pipeline.
85+
86+
properties:
87+
port@0:
88+
$ref: /schemas/graph.yaml#/properties/port
89+
description: DSI input port, usually from DITHER, DSC or MERGE
90+
91+
port@1:
92+
$ref: /schemas/graph.yaml#/properties/port
93+
description:
94+
DSI output to an attached DSI panel, or a DSI-to-X encoder chip
95+
96+
required:
97+
- port@0
98+
- port@1
99+
80100
required:
81101
- compatible
82102
- reg
@@ -86,7 +106,12 @@ required:
86106
- clock-names
87107
- phys
88108
- phy-names
89-
- port
109+
110+
oneOf:
111+
- required:
112+
- port
113+
- required:
114+
- ports
90115

91116
unevaluatedProperties: false
92117

Documentation/devicetree/bindings/display/mediatek/mediatek,ethdr.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,28 @@ properties:
110110
include/dt-bindings/gce/<chip>-gce.h, mapping to the register of display
111111
function block.
112112

113+
ports:
114+
$ref: /schemas/graph.yaml#/properties/ports
115+
description:
116+
Input and output ports can have multiple endpoints, each of those
117+
connects to either the primary, secondary, etc, display pipeline.
118+
119+
properties:
120+
port@0:
121+
$ref: /schemas/graph.yaml#/properties/port
122+
description: ETHDR input, usually from one of the MERGE blocks.
123+
124+
port@1:
125+
$ref: /schemas/graph.yaml#/properties/port
126+
description:
127+
ETHDR output to the input of the next desired component in the
128+
display pipeline, for example one of the available MERGE blocks,
129+
or others.
130+
131+
required:
132+
- port@0
133+
- port@1
134+
113135
required:
114136
- compatible
115137
- reg

Documentation/devicetree/bindings/display/mediatek/mediatek,gamma.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@ properties:
6565
$ref: /schemas/types.yaml#/definitions/phandle-array
6666
maxItems: 1
6767

68+
ports:
69+
$ref: /schemas/graph.yaml#/properties/ports
70+
71+
properties:
72+
port@0:
73+
$ref: /schemas/graph.yaml#/properties/port
74+
description: GAMMA input, usually from one of the AAL blocks.
75+
76+
port@1:
77+
$ref: /schemas/graph.yaml#/properties/port
78+
description:
79+
GAMMA output to the input of the next desired component in the
80+
display pipeline, for example one of the available DITHER or
81+
POSTMASK blocks.
82+
83+
required:
84+
- port@0
85+
- port@1
86+
6887
required:
6988
- compatible
7089
- reg

Documentation/devicetree/bindings/display/mediatek/mediatek,merge.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,29 @@ properties:
7777
$ref: /schemas/types.yaml#/definitions/phandle-array
7878
maxItems: 1
7979

80+
ports:
81+
$ref: /schemas/graph.yaml#/properties/ports
82+
description:
83+
Input and output ports can have multiple endpoints, each of those
84+
connects to either the primary, secondary, etc, display pipeline.
85+
86+
properties:
87+
port@0:
88+
$ref: /schemas/graph.yaml#/properties/port
89+
description:
90+
MERGE input port, usually from DITHER, DPI, DSC, DSI, MDP_RDMA,
91+
ETHDR or even from a different MERGE block
92+
93+
port@1:
94+
$ref: /schemas/graph.yaml#/properties/port
95+
description:
96+
MERGE output to a DSC, DPI, DP_INTF, DSI, ETHDR, Write DMA, or
97+
a different MERGE block, or others.
98+
99+
required:
100+
- port@0
101+
- port@1
102+
80103
resets:
81104
description: reset controller
82105
See Documentation/devicetree/bindings/reset/reset.txt for details.

0 commit comments

Comments
 (0)