dt-bindings: convert timing + panel-dpi to DT schema
Subsystems (4)
v2 cover dt-bindings: convert timing + panel-dpi to DT schema
This set of patches convert display-timing.txt to DT schema.
To do that add a panel-timing.yaml file that include all the panel-timing properties and use this in panel-common and in display-timings.
panel-dpi was also converted so we have no .txt users left of panel-timing in panel/
Everything passed dt_binding_check - and the trivial errors I tried in the examples was all catched during validation.
This work was triggered by a patch-set from Oleksandr Suvorov aiming at updating panel-lvds to support panel-dpi too.
This will make it simple to add additional properties to panel-dpi.
Thanks for the quick responses on v2 and likewise the quick feedback on the request for the license change!
Highlights from v2 - see individual patches for details.
- Got acks for the license change
- Simplfied panel-timings bindings
- panel-dpi can now be used without a panel specific compatible So panel-dpi can be used as a generic binding for dumb panels
Feedback welcome!
Sam
Sam Ravnborg (3):
dt-bindings: display: add panel-timing.yaml
dt-bindings: display: convert display-timings to DT schema
dt-bindings: display: convert panel-dpi to DT schema
.../bindings/display/panel/display-timing.txt | 124 +---------- .../bindings/display/panel/display-timings.yaml | 68 ++++++ .../bindings/display/panel/panel-common.yaml | 7 +- .../bindings/display/panel/panel-dpi.txt | 50 ----- .../bindings/display/panel/panel-dpi.yaml | 71 +++++++ .../bindings/display/panel/panel-timing.yaml | 227 +++++++++++++++++++++ 6 files changed, 370 insertions(+), 177 deletions(-)
PATCH v2 1/3 dt-bindings: display: add panel-timing.yaml
Add meta-schema variant of panel-timing and
reference it from panel-common.yaml.
Part of this came form other files with other
licenses - original commits:
cc3f414cf2e4 ("video: add of helper for display timings/videomode")86f46565dff3 ("dt-bindings: display: display-timing: Add property to configure sync drive edge") 9cad9c95d7e8 ("Documentation: DocBook DRM framework documentation")
The original authors acked the license change to:
(GPL-2.0-only OR BSD-2-Clause)
v2:
- Got OK from original authors for re-license
Huge thanks for the quick replies!
- Typo fixes (Oleksandr)
- Drop -array variant when not needed (Maxime)
- Replace oneOf:... with enum (Maxime)
- Drop type from clock-frequency (Rob)
- Drop "|" when not needed (Rob)
--- .../bindings/display/panel/panel-common.yaml | 7 +- .../bindings/display/panel/panel-timing.yaml | 227 ++++++++++++++++++ 2 files changed, 230 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/panel/panel-timing.yaml
Documentation/devicetree/bindings/display/panel/panel-common.yaml +3 -4
@@ -54,13 +54,12 @@ properties: # Display Timings panel-timing: - type: object description: Most display panels are restricted to a single resolution and require specific display timings. The panel-timing subnode expresses those - timings as specified in the timing subnode section of the display timing - bindings defined in - Documentation/devicetree/bindings/display/panel/display-timing.txt. + timings. + allOf: + - $ref: panel-timing.yaml# # Connectivity port:
Documentation/devicetree/bindings/display/panel/panel-timing.yaml new file +227 -0
227 lines not on this page · raw message
Signature · 1 line
2.20.1
Re: [PATCH v2 1/3] dt-bindings: display: add panel-timing.yaml
Quoted 33 lines · Sam Ravnborg
Add meta-schema variant of panel-timing and
reference it frompanel-common.yaml.Part of this came form other files with other
licenses - original commits:
cc3f414cf2e4("video: add of helper for display timings/videomode")86f46565dff3("dt-bindings: display: display-timing: Add property to configure sync drive edge")9cad9c95d7e8("Documentation: DocBook DRM framework documentation")The original authors acked the license change to:
(GPL-2.0-only OR BSD-2-Clause)v2:
- Got OK from original authors for re-license
Huge thanks for the quick replies!
- Typo fixes (Oleksandr)
- Drop -array variant when not needed (Maxime)
- Replace oneOf:... with enum (Maxime)
- Drop type from clock-frequency (Rob)
- Drop "|" when not needed (Rob)Signed-off-by Sam Ravnborg <[email protected]>Acked-by Laurent Pinchart <[email protected]>Acked-by Peter Ujfalusi <[email protected]>Acked-by Steffen Trumtrar <[email protected]>Acked-by Philipp Zabel <[email protected]>Cc Rob Herring <[email protected]>Cc Thierry Reding <[email protected]>Cc Oleksandr Suvorov <[email protected]>Cc Maxime Ripard <[email protected]>
Quoted 5 lines
--- .../bindings/display/panel/panel-common.yaml | 7 +- .../bindings/display/panel/panel-timing.yaml | 227 ++++++++++++++++++ 2 files changed, 230 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/panel/panel-timing.yaml
PATCH v2 2/3 dt-bindings: display: convert display-timings to DT schema
In reply to Sam RavnborgAdd display-timings.yaml - that references panel-timings.yaml. display-timings.yaml will be used for display bindings when they are converted to meta-schema format.
For now the old display-timing.txt points to the new display-timings.yaml - and all users are left as-is.
v2:
- Updated native-mode description
--- .../bindings/display/panel/display-timing.txt | 124 +----------------- .../display/panel/display-timings.yaml | 68 ++++++++++ 2 files changed, 69 insertions(+), 123 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/panel/display-timings.yaml
Documentation/devicetree/bindings/display/panel/display-timing.txt +1 -123
@@ -1,123 +1 @@ -display-timing bindings -======================= - -display-timings node --------------------- - -required properties: - - none - -optional properties: - - native-mode: The native mode for the display, in case multiple modes are - provided. When omitted, assume the first node is the native. - -timing subnode --------------- - -required properties: - - hactive, vactive: display resolution - - hfront-porch, hback-porch, hsync-len: horizontal display timing parameters - in pixels - vfront-porch, vback-porch, vsync-len: vertical display timing parameters in - lines - - clock-frequency: display clock in Hz - -optional properties: - - hsync-active: hsync pulse is active low/high/ignored - - vsync-active: vsync pulse is active low/high/ignored - - de-active: data-enable pulse is active low/high/ignored - - pixelclk-active: with - - active high = drive pixel data on rising edge/ - sample data on falling edge - - active low = drive pixel data on falling edge/ - sample data on rising edge - - ignored = ignored - - syncclk-active: with - - active high = drive sync on rising edge/ - sample sync on falling edge of pixel - clock - - active low = drive sync on falling edge/ - sample sync on rising edge of pixel - clock - - omitted = same configuration as pixelclk-active - - interlaced (bool): boolean to enable interlaced mode - - doublescan (bool): boolean to enable doublescan mode - - doubleclk (bool): boolean to enable doubleclock mode - -All the optional properties that are not bool follow the following logic: - <1>: high active - <0>: low active - omitted: not used on hardware - -There are different ways of describing the capabilities of a display. The -devicetree representation corresponds to the one commonly found in datasheets -for displays. If a display supports multiple signal timings, the native-mode -can be specified. - -The parameters are defined as: - - +----------+-------------------------------------+----------+-------+ - | | ^ | | | - | | |vback_porch | | | - | | v | | | - +----------#######################################----------+-------+ - | # ^ # | | - | # | # | | - | hback # | # hfront | hsync | - | porch # | hactive # porch | len | - |<-------->#<-------+--------------------------->#<-------->|<----->| - | # | # | | - | # |vactive # | | - | # | # | | - | # v # | | - +----------#######################################----------+-------+ - | | ^ | | | - | | |vfront_porch | | | - | | v | | | - +----------+-------------------------------------+----------+-------+ - | | ^ | | | - | | |vsync_len | | | - | | v | | | - +----------+-------------------------------------+----------+-------+ - -Note: In addition to being used as subnode(s) of display-timings, the timing - subnode may also be used on its own. This is appropriate if only one mode - need be conveyed. In this case, the node should be named 'panel-timing'. - - -Example: - - display-timings { - native-mode = <&timing0>; - timing0: 1080p24 { - /* 1920x1080p24 */ - clock-frequency = <52000000>; - hactive = <1920>; - vactive = <1080>; - hfront-porch = <25>; - hback-porch = <25>; - hsync-len = <25>; - vback-porch = <2>; - vfront-porch = <2>; - vsync-len = <2>; - hsync-active = <1>; - }; - }; - -Every required property also supports the use of ranges, so the commonly used -datasheet description with minimum, typical and maximum values can be used. - -Example: - - timing1: timing { - /* 1920x1080p24 */ - clock-frequency = <148500000>; - hactive = <1920>; - vactive = <1080>; - hsync-len = <0 44 60>; - hfront-porch = <80 88 95>; - hback-porch = <100 148 160>; - vfront-porch = <0 4 6>; - vback-porch = <0 36 50>; - vsync-len = <0 5 6>; - }; +See display-timings.yaml in this directory.
Documentation/devicetree/bindings/display/panel/display-timings.yaml new file +68 -0
68 lines not on this page · raw message
Signature · 1 line
2.20.1
Re: [PATCH v2 2/3] dt-bindings: display: convert display-timings to DT schema
Quoted 46 lines · Sam Ravnborg
Add
display-timings.yaml- that referencespanel-timings.yaml.display-timings.yamlwill be used for display bindings when they are converted to meta-schema format.For now the old display-timing.txt points to the new
display-timings.yaml- and all users are left as-is.v2:
- Updated native-mode descriptionSigned-off-by Sam Ravnborg <[email protected]>Cc Rob Herring <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Thierry Reding <[email protected]>Cc Oleksandr Suvorov <[email protected]>--- .../bindings/display/panel/display-timing.txt | 124 +----------------- .../display/panel/display-timings.yaml | 68 ++++++++++ 2 files changed, 69 insertions(+), 123 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/panel/display-timings.yamlDocumentation/devicetree/bindings/display/panel/display-timings.yaml new file +16
-0@@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/display-timings.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: display timing bindings + +maintainers: + - Thierry Reding <[email protected]> + - Laurent Pinchart <[email protected]> + - Sam Ravnborg <[email protected]> + +properties: + $nodename: + const: display-timings
Documentation/devicetree/bindings/display/panel/display-timings.yaml line 26
Quoted 10 lines
Documentation/devicetree/bindings/display/panel/display-timings.yaml new file +10
-0+ + native-mode: + $ref: /schemas/types.yaml#/definitions/phandle + description: | + The default dispaly timing is the one specified as native-mode. + If no native-mode is specified then the first node is assume the + native mode. + +patternProperties: + "^timing.*$":
'.*$' can be omitted.
Probably should have a 'type: object' here too.
With that,
Documentation/devicetree/bindings/display/panel/display-timings.yaml line 28
Quoted 2 lines
Documentation/devicetree/bindings/display/panel/display-timings.yaml new file +2
-0+ allOf: + - $ref: panel-timing.yaml#
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 3/3 dt-bindings: display: convert panel-dpi to DT schema
In reply to Sam RavnborgWith panel-timing converted, now convert the single remaining .txt user in panel/ of panel-timing to DT schema.
v2:
- Drop Thierry as maintainer, as this is not a general panel binding and I have no acks.
- Drop requirement for a panel- specific binding - "panel-dpi" is enough
- Updated example
--- .../bindings/display/panel/panel-dpi.txt | 50 ------------- .../bindings/display/panel/panel-dpi.yaml | 71 +++++++++++++++++++ 2 files changed, 71 insertions(+), 50 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/panel/panel-dpi.txt create mode 100644 Documentation/devicetree/bindings/display/panel/panel-dpi.yaml
Documentation/devicetree/bindings/display/panel/panel-dpi.txt deleted +0 -50
@@ -1,50 +0,0 @@ -Generic MIPI DPI Panel -====================== - -Required properties: -- compatible: "panel-dpi" - -Optional properties: -- label: a symbolic name for the panel -- enable-gpios: panel enable gpio -- reset-gpios: GPIO to control the RESET pin -- vcc-supply: phandle of regulator that will be used to enable power to the display -- backlight: phandle of the backlight device - -Required nodes: -- "panel-timing" containing video timings - (Documentation/devicetree/bindings/display/panel/display-timing.txt) -- Video port for DPI input - -Example -------- - -lcd0: display@0 { - compatible = "samsung,lte430wq-f0c", "panel-dpi"; - label = "lcd"; - - backlight = <&backlight>; - - port { - lcd_in: endpoint { - remote-endpoint = <&dpi_out>; - }; - }; - - panel-timing { - clock-frequency = <9200000>; - hactive = <480>; - vactive = <272>; - hfront-porch = <8>; - hback-porch = <4>; - hsync-len = <41>; - vback-porch = <2>; - vfront-porch = <4>; - vsync-len = <10>; - - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <1>; - }; -};
Documentation/devicetree/bindings/display/panel/panel-dpi.yaml new file +71 -0
71 lines not on this page · raw message
Signature · 1 line
2.20.1
Rob Herring
maintainerRe: [PATCH v2 3/3] dt-bindings: display: convert panel-dpi to DT schema
Quoted 97 lines · Sam Ravnborg
With panel-timing converted, now convert the single remaining .txt user in panel/ of panel-timing to DT schema.
v2:
- Drop Thierry as maintainer, as this is not a general panel binding and I have no acks.
- Drop requirement for a panel- specific binding - "panel-dpi" is enough
- Updated exampleSigned-off-by Sam Ravnborg <[email protected]>Cc Rob Herring <[email protected]>Cc Thierry Reding <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Maxime Ripard <[email protected]>--- .../bindings/display/panel/panel-dpi.txt | 50 ------------- .../bindings/display/panel/panel-dpi.yaml | 71 +++++++++++++++++++ 2 files changed, 71 insertions(+), 50 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/panel/panel-dpi.txt create mode 100644 Documentation/devicetree/bindings/display/panel/panel-dpi.yamlDocumentation/devicetree/bindings/display/panel/panel-dpi.txt deleted +0
-50@@ -1,50 +0,0 @@ -Generic MIPI DPI Panel -====================== - -Required properties: -- compatible: "panel-dpi" - -Optional properties: -- label: a symbolic name for the panel -- enable-gpios: panel enable gpio -- reset-gpios: GPIO to control the RESET pin -- vcc-supply: phandle of regulator that will be used to enable power to the display -- backlight: phandle of the backlight device - -Required nodes: -- "panel-timing" containing video timings - (Documentation/devicetree/bindings/display/panel/display-timing.txt) -- Video port for DPI input - -Example -------- - -lcd0: display@0 { - compatible = "samsung,lte430wq-f0c", "panel-dpi"; - label = "lcd"; - - backlight = <&backlight>; - - port { - lcd_in: endpoint { - remote-endpoint = <&dpi_out>; - }; - }; - - panel-timing { - clock-frequency = <9200000>; - hactive = <480>; - vactive = <272>; - hfront-porch = <8>; - hback-porch = <4>; - hsync-len = <41>; - vback-porch = <2>; - vfront-porch = <4>; - vsync-len = <10>; - - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <1>; - }; -};Documentation/devicetree/bindings/display/panel/panel-dpi.yaml new file +13
-0@@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/panel-dpi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic MIPI DPI Panel + +maintainers: + - Sam Ravnborg <[email protected]> + +allOf: + - $ref: panel-common.yaml#
Documentation/devicetree/bindings/display/panel/panel-dpi.yaml line 23
Quoted 10 lines
Documentation/devicetree/bindings/display/panel/panel-dpi.yaml new file +10
-0+ +properties: + compatible: + contains: + const: panel-dpi + description: + Shall contain "panel-dpi" in addition to an optional panel-specific + compatible string defined in individual panel bindings. + "panel-dpi" can be used alone, thus no dedicated binding file + is required for each and every panel.
While this has occurred, I don't think the schema should allow it. I think a 'minItems: 2' should be added here.
AFAIK, MIPI DPI just defines a spec for what already existed. Maybe it constrains things somewhat, but to the extent why we require a panel specific compatible in the first place? Doubtful...
Rob
Quoted 39 lines
Documentation/devicetree/bindings/display/panel/panel-dpi.yaml new file +38
-1+ port: true + +required: + - panel-timing + +additionalProperties: false + +examples: + - | + panel@0 { + compatible = "panel-dpi"; + label = "lcd"; + vcc-supply = <&vcc_supply>; + + backlight = <&backlight>; + + port { + lcd_in: endpoint { + remote-endpoint = <&dpi_out>; + }; + }; + panel-timing { + clock-frequency = <9200000>; + hactive = <800>; + vactive = <480>; + hfront-porch = <8>; + hback-porch = <4>; + hsync-len = <41>; + vback-porch = <2>; + vfront-porch = <4>; + vsync-len = <10>; + + hsync-active = <0>; + vsync-active = <0>; + de-active = <1>; + pixelclk-active = <1>; + }; + }; --
Quoted 2 lines
2.20.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 3/3] dt-bindings: display: convert panel-dpi to DT schema
Hi Rob.
Quoted 14 lines
Documentation/devicetree/bindings/display/panel/panel-dpi.yaml line 23
Quoted 10 lines
Documentation/devicetree/bindings/display/panel/panel-dpi.yaml new file +10
-0+ +properties: + compatible: + contains: + const: panel-dpi + description: + Shall contain "panel-dpi" in addition to an optional panel-specific + compatible string defined in individual panel bindings. + "panel-dpi" can be used alone, thus no dedicated binding file + is required for each and every panel.While this has occurred, I don't think the schema should allow it. I think a 'minItems: 2' should be added here.
Quoted 3 lines
AFAIK, MIPI DPI just defines a spec for what already existed. Maybe it constrains things somewhat, but to the extent why we require a panel specific compatible in the first place? Doubtful...
You triggered me to re-read some old thread about this. And I think I got it now.
Based on a proposal you made some weeks ago I did it like this:
properties:
compatible:
description:
Shall contain a panel specific compatible and "panel-dpi" in that order.
items:
- {}
- const: panel-dpi
So no constraints on the panel specific compatible, expect that it is present. And panel-dpi must be listed as the second compatible.
Updated the example too.
Will post a v3.
Thanks!
Sam
Hi all.
Quoted 14 lines · Sam Ravnborg
This set of patches convert display-timing.txt to DT schema.
To do that add apanel-timing.yamlfile that include all the panel-timing properties and use this in panel-common and in display-timings.panel-dpi was also converted so we have no .txt users left of panel-timing in panel/
Everything passed
dt_binding_check- and the trivial errors I tried in the examples was all catched during validation.This work was triggered by a patch-set from Oleksandr Suvorov aiming at updating panel-lvds to support panel-dpi too.
This will make it simple to add additional properties to panel-dpi.
Quoted 8 lines
Thanks for the quick responses on v2 and likewise the quick feedback on the request for the license change!
Highlights from v2 - see individual patches for details.
- Got acks for the license change
- Simplfied panel-timings bindings
- panel-dpi can now be used without a panel specific compatible So panel-dpi can be used as a generic binding for dumb panels
Any feedback on this patchset?
Sam