* [PATCH v2 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file
2023-05-23 8:19 [PATCH v2 0/3] Support non-default LVDS data mapping for simple panel Johannes Zink
@ 2023-05-23 8:19 ` Johannes Zink
2023-05-23 17:16 ` Conor Dooley
2023-06-02 15:32 ` Laurent Pinchart
2023-05-23 8:19 ` [PATCH v2 2/3] dt-bindings: display: simple: support non-default data-mapping Johannes Zink
2023-05-23 8:19 ` [PATCH v2 3/3] drm/panel-simple: allow LVDS format override Johannes Zink
2 siblings, 2 replies; 13+ messages in thread
From: Johannes Zink @ 2023-05-23 8:19 UTC (permalink / raw)
To: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Laurent Pinchart, Thierry Reding, Neil Armstrong,
Sam Ravnborg
Cc: kernel test robot, Dan Carpenter, patchwork-jzi, kernel,
Laurent Pinchart, dri-devel, devicetree, linux-kernel,
Johannes Zink
As the LVDS data-mapping property is required in multiple bindings: move
it to separate file and include instead of duplicating it.
Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
---
Changes:
v1 -> v2: worked in Rob's review findings (thank you for reviewing my
work): extract common properties to
file and include it instead of duplicating it
---
.../bindings/display/lvds-data-mapping.yaml | 84 ++++++++++++++++++++++
.../devicetree/bindings/display/lvds.yaml | 75 +++----------------
2 files changed, 92 insertions(+), 67 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml b/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml
new file mode 100644
index 000000000000..17ef5c9a5a90
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/lvds-data-mapping.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LVDS Data Mapping
+
+maintainers:
+ - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+ - Thierry Reding <thierry.reding@gmail.com>
+
+description: |+
+ LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple
+ incompatible data link layers have been used over time to transmit image data
+ to LVDS devices. This bindings supports devices compatible with the following
+ specifications.
+
+ [JEIDA] "Digital Interface Standards for Monitor", JEIDA-59-1999, February
+ 1999 (Version 1.0), Japan Electronic Industry Development Association (JEIDA)
+ [LDI] "Open LVDS Display Interface", May 1999 (Version 0.95), National
+ Semiconductor
+ [VESA] "VESA Notebook Panel Standard", October 2007 (Version 1.0), Video
+ Electronics Standards Association (VESA)
+
+ Device compatible with those specifications have been marketed under the
+ FPD-Link and FlatLink brands.
+
+properties:
+ data-mapping:
+ enum:
+ - jeida-18
+ - jeida-24
+ - vesa-24
+ description: |
+ The color signals mapping order.
+
+ LVDS data mappings are defined as follows.
+
+ - "jeida-18" - 18-bit data mapping compatible with the [JEIDA], [LDI] and
+ [VESA] specifications. Data are transferred as follows on 3 LVDS lanes.
+
+ Slot 0 1 2 3 4 5 6
+ ________________ _________________
+ Clock \_______________________/
+ ______ ______ ______ ______ ______ ______ ______
+ DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
+ DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
+ DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
+
+ - "jeida-24" - 24-bit data mapping compatible with the [DSIM] and [LDI]
+ specifications. Data are transferred as follows on 4 LVDS lanes.
+
+ Slot 0 1 2 3 4 5 6
+ ________________ _________________
+ Clock \_______________________/
+ ______ ______ ______ ______ ______ ______ ______
+ DATA0 ><__G2__><__R7__><__R6__><__R5__><__R4__><__R3__><__R2__><
+ DATA1 ><__B3__><__B2__><__G7__><__G6__><__G5__><__G4__><__G3__><
+ DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B7__><__B6__><__B5__><__B4__><
+ DATA3 ><_CTL3_><__B1__><__B0__><__G1__><__G0__><__R1__><__R0__><
+
+ - "vesa-24" - 24-bit data mapping compatible with the [VESA] specification.
+ Data are transferred as follows on 4 LVDS lanes.
+
+ Slot 0 1 2 3 4 5 6
+ ________________ _________________
+ Clock \_______________________/
+ ______ ______ ______ ______ ______ ______ ______
+ DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
+ DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
+ DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
+ DATA3 ><_CTL3_><__B7__><__B6__><__G7__><__G6__><__R7__><__R6__><
+
+ Control signals are mapped as follows.
+
+ CTL0: HSync
+ CTL1: VSync
+ CTL2: Data Enable
+ CTL3: 0
+
+additionalProperties: true
+
+...
diff --git a/Documentation/devicetree/bindings/display/lvds.yaml b/Documentation/devicetree/bindings/display/lvds.yaml
index 7cd2ce7e9c33..2200f986c3cf 100644
--- a/Documentation/devicetree/bindings/display/lvds.yaml
+++ b/Documentation/devicetree/bindings/display/lvds.yaml
@@ -6,83 +6,24 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: LVDS Display Common Properties
+allOf:
+ - $ref: lvds-data-mapping.yaml#
+
maintainers:
- Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
- Thierry Reding <thierry.reding@gmail.com>
description: |+
- LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple
- incompatible data link layers have been used over time to transmit image data
- to LVDS devices. This bindings supports devices compatible with the following
- specifications.
-
- [JEIDA] "Digital Interface Standards for Monitor", JEIDA-59-1999, February
- 1999 (Version 1.0), Japan Electronic Industry Development Association (JEIDA)
- [LDI] "Open LVDS Display Interface", May 1999 (Version 0.95), National
- Semiconductor
- [VESA] "VESA Notebook Panel Standard", October 2007 (Version 1.0), Video
- Electronics Standards Association (VESA)
-
- Device compatible with those specifications have been marketed under the
- FPD-Link and FlatLink brands.
+ This binding extends the data mapping defined in lvds-data-mapping.yaml.
+ It supports reversing the bit order on the formats defined there in order
+ to accomodate for even more specialized data formats, since a variety of
+ data formats and layouts is used to drive LVDS displays.
properties:
- data-mapping:
- enum:
- - jeida-18
- - jeida-24
- - vesa-24
- description: |
- The color signals mapping order.
-
- LVDS data mappings are defined as follows.
-
- - "jeida-18" - 18-bit data mapping compatible with the [JEIDA], [LDI] and
- [VESA] specifications. Data are transferred as follows on 3 LVDS lanes.
-
- Slot 0 1 2 3 4 5 6
- ________________ _________________
- Clock \_______________________/
- ______ ______ ______ ______ ______ ______ ______
- DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
- DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
- DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
-
- - "jeida-24" - 24-bit data mapping compatible with the [DSIM] and [LDI]
- specifications. Data are transferred as follows on 4 LVDS lanes.
-
- Slot 0 1 2 3 4 5 6
- ________________ _________________
- Clock \_______________________/
- ______ ______ ______ ______ ______ ______ ______
- DATA0 ><__G2__><__R7__><__R6__><__R5__><__R4__><__R3__><__R2__><
- DATA1 ><__B3__><__B2__><__G7__><__G6__><__G5__><__G4__><__G3__><
- DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B7__><__B6__><__B5__><__B4__><
- DATA3 ><_CTL3_><__B1__><__B0__><__G1__><__G0__><__R1__><__R0__><
-
- - "vesa-24" - 24-bit data mapping compatible with the [VESA] specification.
- Data are transferred as follows on 4 LVDS lanes.
-
- Slot 0 1 2 3 4 5 6
- ________________ _________________
- Clock \_______________________/
- ______ ______ ______ ______ ______ ______ ______
- DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
- DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
- DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
- DATA3 ><_CTL3_><__B7__><__B6__><__G7__><__G6__><__R7__><__R6__><
-
- Control signals are mapped as follows.
-
- CTL0: HSync
- CTL1: VSync
- CTL2: Data Enable
- CTL3: 0
-
data-mirror:
type: boolean
description:
- If set, reverse the bit order described in the data mappings below on all
+ If set, reverse the bit order described in the data mappings on all
data lanes, transmitting bits for slots 6 to 0 instead of 0 to 6.
additionalProperties: true
--
2.39.2
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v2 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file
2023-05-23 8:19 ` [PATCH v2 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file Johannes Zink
@ 2023-05-23 17:16 ` Conor Dooley
2023-06-02 15:32 ` Laurent Pinchart
1 sibling, 0 replies; 13+ messages in thread
From: Conor Dooley @ 2023-05-23 17:16 UTC (permalink / raw)
To: Johannes Zink
Cc: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Laurent Pinchart, Thierry Reding, Neil Armstrong,
Sam Ravnborg, kernel test robot, Dan Carpenter, patchwork-jzi,
kernel, Laurent Pinchart, dri-devel, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 9875 bytes --]
On Tue, May 23, 2023 at 10:19:41AM +0200, Johannes Zink wrote:
> As the LVDS data-mapping property is required in multiple bindings: move
> it to separate file and include instead of duplicating it.
>
> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>
> ---
>
> Changes:
>
> v1 -> v2: worked in Rob's review findings (thank you for reviewing my
> work): extract common properties to
> file and include it instead of duplicating it
> ---
> .../bindings/display/lvds-data-mapping.yaml | 84 ++++++++++++++++++++++
> .../devicetree/bindings/display/lvds.yaml | 75 +++----------------
> 2 files changed, 92 insertions(+), 67 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml b/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml
> new file mode 100644
> index 000000000000..17ef5c9a5a90
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml
> @@ -0,0 +1,84 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/lvds-data-mapping.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LVDS Data Mapping
> +
> +maintainers:
> + - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> + - Thierry Reding <thierry.reding@gmail.com>
> +
> +description: |+
Apparently this + is a "chomping indicator", but I have no clue why that
is needed here. You didn't add it though and the movement seems faithful
to me, so:
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
> + LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple
> + incompatible data link layers have been used over time to transmit image data
> + to LVDS devices. This bindings supports devices compatible with the following
> + specifications.
> +
> + [JEIDA] "Digital Interface Standards for Monitor", JEIDA-59-1999, February
> + 1999 (Version 1.0), Japan Electronic Industry Development Association (JEIDA)
> + [LDI] "Open LVDS Display Interface", May 1999 (Version 0.95), National
> + Semiconductor
> + [VESA] "VESA Notebook Panel Standard", October 2007 (Version 1.0), Video
> + Electronics Standards Association (VESA)
> +
> + Device compatible with those specifications have been marketed under the
> + FPD-Link and FlatLink brands.
> +
> +properties:
> + data-mapping:
> + enum:
> + - jeida-18
> + - jeida-24
> + - vesa-24
> + description: |
> + The color signals mapping order.
> +
> + LVDS data mappings are defined as follows.
> +
> + - "jeida-18" - 18-bit data mapping compatible with the [JEIDA], [LDI] and
> + [VESA] specifications. Data are transferred as follows on 3 LVDS lanes.
> +
> + Slot 0 1 2 3 4 5 6
> + ________________ _________________
> + Clock \_______________________/
> + ______ ______ ______ ______ ______ ______ ______
> + DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
> + DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
> + DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
> +
> + - "jeida-24" - 24-bit data mapping compatible with the [DSIM] and [LDI]
> + specifications. Data are transferred as follows on 4 LVDS lanes.
> +
> + Slot 0 1 2 3 4 5 6
> + ________________ _________________
> + Clock \_______________________/
> + ______ ______ ______ ______ ______ ______ ______
> + DATA0 ><__G2__><__R7__><__R6__><__R5__><__R4__><__R3__><__R2__><
> + DATA1 ><__B3__><__B2__><__G7__><__G6__><__G5__><__G4__><__G3__><
> + DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B7__><__B6__><__B5__><__B4__><
> + DATA3 ><_CTL3_><__B1__><__B0__><__G1__><__G0__><__R1__><__R0__><
> +
> + - "vesa-24" - 24-bit data mapping compatible with the [VESA] specification.
> + Data are transferred as follows on 4 LVDS lanes.
> +
> + Slot 0 1 2 3 4 5 6
> + ________________ _________________
> + Clock \_______________________/
> + ______ ______ ______ ______ ______ ______ ______
> + DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
> + DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
> + DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
> + DATA3 ><_CTL3_><__B7__><__B6__><__G7__><__G6__><__R7__><__R6__><
> +
> + Control signals are mapped as follows.
> +
> + CTL0: HSync
> + CTL1: VSync
> + CTL2: Data Enable
> + CTL3: 0
> +
> +additionalProperties: true
> +
> +...
> diff --git a/Documentation/devicetree/bindings/display/lvds.yaml b/Documentation/devicetree/bindings/display/lvds.yaml
> index 7cd2ce7e9c33..2200f986c3cf 100644
> --- a/Documentation/devicetree/bindings/display/lvds.yaml
> +++ b/Documentation/devicetree/bindings/display/lvds.yaml
> @@ -6,83 +6,24 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
>
> title: LVDS Display Common Properties
>
> +allOf:
> + - $ref: lvds-data-mapping.yaml#
> +
> maintainers:
> - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> - Thierry Reding <thierry.reding@gmail.com>
>
> description: |+
> - LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple
> - incompatible data link layers have been used over time to transmit image data
> - to LVDS devices. This bindings supports devices compatible with the following
> - specifications.
> -
> - [JEIDA] "Digital Interface Standards for Monitor", JEIDA-59-1999, February
> - 1999 (Version 1.0), Japan Electronic Industry Development Association (JEIDA)
> - [LDI] "Open LVDS Display Interface", May 1999 (Version 0.95), National
> - Semiconductor
> - [VESA] "VESA Notebook Panel Standard", October 2007 (Version 1.0), Video
> - Electronics Standards Association (VESA)
> -
> - Device compatible with those specifications have been marketed under the
> - FPD-Link and FlatLink brands.
> + This binding extends the data mapping defined in lvds-data-mapping.yaml.
> + It supports reversing the bit order on the formats defined there in order
> + to accomodate for even more specialized data formats, since a variety of
> + data formats and layouts is used to drive LVDS displays.
>
> properties:
> - data-mapping:
> - enum:
> - - jeida-18
> - - jeida-24
> - - vesa-24
> - description: |
> - The color signals mapping order.
> -
> - LVDS data mappings are defined as follows.
> -
> - - "jeida-18" - 18-bit data mapping compatible with the [JEIDA], [LDI] and
> - [VESA] specifications. Data are transferred as follows on 3 LVDS lanes.
> -
> - Slot 0 1 2 3 4 5 6
> - ________________ _________________
> - Clock \_______________________/
> - ______ ______ ______ ______ ______ ______ ______
> - DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
> - DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
> - DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
> -
> - - "jeida-24" - 24-bit data mapping compatible with the [DSIM] and [LDI]
> - specifications. Data are transferred as follows on 4 LVDS lanes.
> -
> - Slot 0 1 2 3 4 5 6
> - ________________ _________________
> - Clock \_______________________/
> - ______ ______ ______ ______ ______ ______ ______
> - DATA0 ><__G2__><__R7__><__R6__><__R5__><__R4__><__R3__><__R2__><
> - DATA1 ><__B3__><__B2__><__G7__><__G6__><__G5__><__G4__><__G3__><
> - DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B7__><__B6__><__B5__><__B4__><
> - DATA3 ><_CTL3_><__B1__><__B0__><__G1__><__G0__><__R1__><__R0__><
> -
> - - "vesa-24" - 24-bit data mapping compatible with the [VESA] specification.
> - Data are transferred as follows on 4 LVDS lanes.
> -
> - Slot 0 1 2 3 4 5 6
> - ________________ _________________
> - Clock \_______________________/
> - ______ ______ ______ ______ ______ ______ ______
> - DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
> - DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
> - DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
> - DATA3 ><_CTL3_><__B7__><__B6__><__G7__><__G6__><__R7__><__R6__><
> -
> - Control signals are mapped as follows.
> -
> - CTL0: HSync
> - CTL1: VSync
> - CTL2: Data Enable
> - CTL3: 0
> -
> data-mirror:
> type: boolean
> description:
> - If set, reverse the bit order described in the data mappings below on all
> + If set, reverse the bit order described in the data mappings on all
> data lanes, transmitting bits for slots 6 to 0 instead of 0 to 6.
>
> additionalProperties: true
>
> --
> 2.39.2
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file
2023-05-23 8:19 ` [PATCH v2 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file Johannes Zink
2023-05-23 17:16 ` Conor Dooley
@ 2023-06-02 15:32 ` Laurent Pinchart
2023-07-28 8:33 ` Johannes Zink
1 sibling, 1 reply; 13+ messages in thread
From: Laurent Pinchart @ 2023-06-02 15:32 UTC (permalink / raw)
To: Johannes Zink
Cc: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Neil Armstrong, Sam Ravnborg,
kernel test robot, Dan Carpenter, patchwork-jzi, kernel,
dri-devel, devicetree, linux-kernel
Hello Johannes,
Thank you for the patch.
On Tue, May 23, 2023 at 10:19:41AM +0200, Johannes Zink wrote:
> As the LVDS data-mapping property is required in multiple bindings: move
> it to separate file and include instead of duplicating it.
>
> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>
> ---
>
> Changes:
>
> v1 -> v2: worked in Rob's review findings (thank you for reviewing my
> work): extract common properties to
> file and include it instead of duplicating it
> ---
> .../bindings/display/lvds-data-mapping.yaml | 84 ++++++++++++++++++++++
> .../devicetree/bindings/display/lvds.yaml | 75 +++----------------
> 2 files changed, 92 insertions(+), 67 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml b/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml
> new file mode 100644
> index 000000000000..17ef5c9a5a90
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml
> @@ -0,0 +1,84 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/lvds-data-mapping.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LVDS Data Mapping
> +
> +maintainers:
> + - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> + - Thierry Reding <thierry.reding@gmail.com>
> +
> +description: |+
> + LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple
> + incompatible data link layers have been used over time to transmit image data
> + to LVDS devices. This bindings supports devices compatible with the following
> + specifications.
> +
> + [JEIDA] "Digital Interface Standards for Monitor", JEIDA-59-1999, February
> + 1999 (Version 1.0), Japan Electronic Industry Development Association (JEIDA)
> + [LDI] "Open LVDS Display Interface", May 1999 (Version 0.95), National
> + Semiconductor
> + [VESA] "VESA Notebook Panel Standard", October 2007 (Version 1.0), Video
> + Electronics Standards Association (VESA)
> +
> + Device compatible with those specifications have been marketed under the
> + FPD-Link and FlatLink brands.
> +
> +properties:
> + data-mapping:
> + enum:
> + - jeida-18
> + - jeida-24
> + - vesa-24
> + description: |
> + The color signals mapping order.
> +
> + LVDS data mappings are defined as follows.
> +
> + - "jeida-18" - 18-bit data mapping compatible with the [JEIDA], [LDI] and
> + [VESA] specifications. Data are transferred as follows on 3 LVDS lanes.
> +
> + Slot 0 1 2 3 4 5 6
> + ________________ _________________
> + Clock \_______________________/
> + ______ ______ ______ ______ ______ ______ ______
> + DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
> + DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
> + DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
> +
> + - "jeida-24" - 24-bit data mapping compatible with the [DSIM] and [LDI]
> + specifications. Data are transferred as follows on 4 LVDS lanes.
> +
> + Slot 0 1 2 3 4 5 6
> + ________________ _________________
> + Clock \_______________________/
> + ______ ______ ______ ______ ______ ______ ______
> + DATA0 ><__G2__><__R7__><__R6__><__R5__><__R4__><__R3__><__R2__><
> + DATA1 ><__B3__><__B2__><__G7__><__G6__><__G5__><__G4__><__G3__><
> + DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B7__><__B6__><__B5__><__B4__><
> + DATA3 ><_CTL3_><__B1__><__B0__><__G1__><__G0__><__R1__><__R0__><
> +
> + - "vesa-24" - 24-bit data mapping compatible with the [VESA] specification.
> + Data are transferred as follows on 4 LVDS lanes.
> +
> + Slot 0 1 2 3 4 5 6
> + ________________ _________________
> + Clock \_______________________/
> + ______ ______ ______ ______ ______ ______ ______
> + DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
> + DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
> + DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
> + DATA3 ><_CTL3_><__B7__><__B6__><__G7__><__G6__><__R7__><__R6__><
> +
> + Control signals are mapped as follows.
> +
> + CTL0: HSync
> + CTL1: VSync
> + CTL2: Data Enable
> + CTL3: 0
> +
> +additionalProperties: true
> +
> +...
> diff --git a/Documentation/devicetree/bindings/display/lvds.yaml b/Documentation/devicetree/bindings/display/lvds.yaml
> index 7cd2ce7e9c33..2200f986c3cf 100644
> --- a/Documentation/devicetree/bindings/display/lvds.yaml
> +++ b/Documentation/devicetree/bindings/display/lvds.yaml
> @@ -6,83 +6,24 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
>
> title: LVDS Display Common Properties
>
> +allOf:
> + - $ref: lvds-data-mapping.yaml#
> +
> maintainers:
> - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> - Thierry Reding <thierry.reding@gmail.com>
>
> description: |+
You can drop the |+ here.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> - LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple
> - incompatible data link layers have been used over time to transmit image data
> - to LVDS devices. This bindings supports devices compatible with the following
> - specifications.
> -
> - [JEIDA] "Digital Interface Standards for Monitor", JEIDA-59-1999, February
> - 1999 (Version 1.0), Japan Electronic Industry Development Association (JEIDA)
> - [LDI] "Open LVDS Display Interface", May 1999 (Version 0.95), National
> - Semiconductor
> - [VESA] "VESA Notebook Panel Standard", October 2007 (Version 1.0), Video
> - Electronics Standards Association (VESA)
> -
> - Device compatible with those specifications have been marketed under the
> - FPD-Link and FlatLink brands.
> + This binding extends the data mapping defined in lvds-data-mapping.yaml.
> + It supports reversing the bit order on the formats defined there in order
> + to accomodate for even more specialized data formats, since a variety of
> + data formats and layouts is used to drive LVDS displays.
>
> properties:
> - data-mapping:
> - enum:
> - - jeida-18
> - - jeida-24
> - - vesa-24
> - description: |
> - The color signals mapping order.
> -
> - LVDS data mappings are defined as follows.
> -
> - - "jeida-18" - 18-bit data mapping compatible with the [JEIDA], [LDI] and
> - [VESA] specifications. Data are transferred as follows on 3 LVDS lanes.
> -
> - Slot 0 1 2 3 4 5 6
> - ________________ _________________
> - Clock \_______________________/
> - ______ ______ ______ ______ ______ ______ ______
> - DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
> - DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
> - DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
> -
> - - "jeida-24" - 24-bit data mapping compatible with the [DSIM] and [LDI]
> - specifications. Data are transferred as follows on 4 LVDS lanes.
> -
> - Slot 0 1 2 3 4 5 6
> - ________________ _________________
> - Clock \_______________________/
> - ______ ______ ______ ______ ______ ______ ______
> - DATA0 ><__G2__><__R7__><__R6__><__R5__><__R4__><__R3__><__R2__><
> - DATA1 ><__B3__><__B2__><__G7__><__G6__><__G5__><__G4__><__G3__><
> - DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B7__><__B6__><__B5__><__B4__><
> - DATA3 ><_CTL3_><__B1__><__B0__><__G1__><__G0__><__R1__><__R0__><
> -
> - - "vesa-24" - 24-bit data mapping compatible with the [VESA] specification.
> - Data are transferred as follows on 4 LVDS lanes.
> -
> - Slot 0 1 2 3 4 5 6
> - ________________ _________________
> - Clock \_______________________/
> - ______ ______ ______ ______ ______ ______ ______
> - DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
> - DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
> - DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
> - DATA3 ><_CTL3_><__B7__><__B6__><__G7__><__G6__><__R7__><__R6__><
> -
> - Control signals are mapped as follows.
> -
> - CTL0: HSync
> - CTL1: VSync
> - CTL2: Data Enable
> - CTL3: 0
> -
> data-mirror:
> type: boolean
> description:
> - If set, reverse the bit order described in the data mappings below on all
> + If set, reverse the bit order described in the data mappings on all
> data lanes, transmitting bits for slots 6 to 0 instead of 0 to 6.
>
> additionalProperties: true
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file
2023-06-02 15:32 ` Laurent Pinchart
@ 2023-07-28 8:33 ` Johannes Zink
0 siblings, 0 replies; 13+ messages in thread
From: Johannes Zink @ 2023-07-28 8:33 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Neil Armstrong, Conor Dooley, Dan Carpenter, Daniel Vetter,
devicetree, Sam Ravnborg, linux-kernel, Rob Herring,
Thierry Reding, dri-devel, Krzysztof Kozlowski, patchwork-jzi,
David Airlie, kernel, kernel test robot
Hi Laurent,
thank you for your review.
On 6/2/23 17:32, Laurent Pinchart wrote:
> Hello Johannes,
>
> Thank you for the patch.
>
> On Tue, May 23, 2023 at 10:19:41AM +0200, Johannes Zink wrote:
>> As the LVDS data-mapping property is required in multiple bindings: move
>> it to separate file and include instead of duplicating it.
>>
>> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>>
>> ---
>>
>> Changes:
>>
>> v1 -> v2: worked in Rob's review findings (thank you for reviewing my
>> work): extract common properties to
>> file and include it instead of duplicating it
>> ---
>> .../bindings/display/lvds-data-mapping.yaml | 84 ++++++++++++++++++++++
>> .../devicetree/bindings/display/lvds.yaml | 75 +++----------------
>> 2 files changed, 92 insertions(+), 67 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml b/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml
>> new file mode 100644
>> index 000000000000..17ef5c9a5a90
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/display/lvds-data-mapping.yaml
>> @@ -0,0 +1,84 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/display/lvds-data-mapping.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: LVDS Data Mapping
>> +
>> +maintainers:
>> + - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>> + - Thierry Reding <thierry.reding@gmail.com>
>> +
>> +description: |+
>> + LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple
>> + incompatible data link layers have been used over time to transmit image data
>> + to LVDS devices. This bindings supports devices compatible with the following
>> + specifications.
>> +
>> + [JEIDA] "Digital Interface Standards for Monitor", JEIDA-59-1999, February
>> + 1999 (Version 1.0), Japan Electronic Industry Development Association (JEIDA)
>> + [LDI] "Open LVDS Display Interface", May 1999 (Version 0.95), National
>> + Semiconductor
>> + [VESA] "VESA Notebook Panel Standard", October 2007 (Version 1.0), Video
>> + Electronics Standards Association (VESA)
>> +
>> + Device compatible with those specifications have been marketed under the
>> + FPD-Link and FlatLink brands.
>> +
>> +properties:
>> + data-mapping:
>> + enum:
>> + - jeida-18
>> + - jeida-24
>> + - vesa-24
>> + description: |
>> + The color signals mapping order.
>> +
>> + LVDS data mappings are defined as follows.
>> +
>> + - "jeida-18" - 18-bit data mapping compatible with the [JEIDA], [LDI] and
>> + [VESA] specifications. Data are transferred as follows on 3 LVDS lanes.
>> +
>> + Slot 0 1 2 3 4 5 6
>> + ________________ _________________
>> + Clock \_______________________/
>> + ______ ______ ______ ______ ______ ______ ______
>> + DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
>> + DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
>> + DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
>> +
>> + - "jeida-24" - 24-bit data mapping compatible with the [DSIM] and [LDI]
>> + specifications. Data are transferred as follows on 4 LVDS lanes.
>> +
>> + Slot 0 1 2 3 4 5 6
>> + ________________ _________________
>> + Clock \_______________________/
>> + ______ ______ ______ ______ ______ ______ ______
>> + DATA0 ><__G2__><__R7__><__R6__><__R5__><__R4__><__R3__><__R2__><
>> + DATA1 ><__B3__><__B2__><__G7__><__G6__><__G5__><__G4__><__G3__><
>> + DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B7__><__B6__><__B5__><__B4__><
>> + DATA3 ><_CTL3_><__B1__><__B0__><__G1__><__G0__><__R1__><__R0__><
>> +
>> + - "vesa-24" - 24-bit data mapping compatible with the [VESA] specification.
>> + Data are transferred as follows on 4 LVDS lanes.
>> +
>> + Slot 0 1 2 3 4 5 6
>> + ________________ _________________
>> + Clock \_______________________/
>> + ______ ______ ______ ______ ______ ______ ______
>> + DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
>> + DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
>> + DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
>> + DATA3 ><_CTL3_><__B7__><__B6__><__G7__><__G6__><__R7__><__R6__><
>> +
>> + Control signals are mapped as follows.
>> +
>> + CTL0: HSync
>> + CTL1: VSync
>> + CTL2: Data Enable
>> + CTL3: 0
>> +
>> +additionalProperties: true
>> +
>> +...
>> diff --git a/Documentation/devicetree/bindings/display/lvds.yaml b/Documentation/devicetree/bindings/display/lvds.yaml
>> index 7cd2ce7e9c33..2200f986c3cf 100644
>> --- a/Documentation/devicetree/bindings/display/lvds.yaml
>> +++ b/Documentation/devicetree/bindings/display/lvds.yaml
>> @@ -6,83 +6,24 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
>>
>> title: LVDS Display Common Properties
>>
>> +allOf:
>> + - $ref: lvds-data-mapping.yaml#
>> +
>> maintainers:
>> - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>> - Thierry Reding <thierry.reding@gmail.com>
>>
>> description: |+
>
> You can drop the |+ here.
ack, gonna change that in V3.
Best regards
Johannes
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
>> - LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple
>> - incompatible data link layers have been used over time to transmit image data
>> - to LVDS devices. This bindings supports devices compatible with the following
>> - specifications.
>> -
>> - [JEIDA] "Digital Interface Standards for Monitor", JEIDA-59-1999, February
>> - 1999 (Version 1.0), Japan Electronic Industry Development Association (JEIDA)
>> - [LDI] "Open LVDS Display Interface", May 1999 (Version 0.95), National
>> - Semiconductor
>> - [VESA] "VESA Notebook Panel Standard", October 2007 (Version 1.0), Video
>> - Electronics Standards Association (VESA)
>> -
>> - Device compatible with those specifications have been marketed under the
>> - FPD-Link and FlatLink brands.
>> + This binding extends the data mapping defined in lvds-data-mapping.yaml.
>> + It supports reversing the bit order on the formats defined there in order
>> + to accomodate for even more specialized data formats, since a variety of
>> + data formats and layouts is used to drive LVDS displays.
>>
>> properties:
>> - data-mapping:
>> - enum:
>> - - jeida-18
>> - - jeida-24
>> - - vesa-24
>> - description: |
>> - The color signals mapping order.
>> -
>> - LVDS data mappings are defined as follows.
>> -
>> - - "jeida-18" - 18-bit data mapping compatible with the [JEIDA], [LDI] and
>> - [VESA] specifications. Data are transferred as follows on 3 LVDS lanes.
>> -
>> - Slot 0 1 2 3 4 5 6
>> - ________________ _________________
>> - Clock \_______________________/
>> - ______ ______ ______ ______ ______ ______ ______
>> - DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
>> - DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
>> - DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
>> -
>> - - "jeida-24" - 24-bit data mapping compatible with the [DSIM] and [LDI]
>> - specifications. Data are transferred as follows on 4 LVDS lanes.
>> -
>> - Slot 0 1 2 3 4 5 6
>> - ________________ _________________
>> - Clock \_______________________/
>> - ______ ______ ______ ______ ______ ______ ______
>> - DATA0 ><__G2__><__R7__><__R6__><__R5__><__R4__><__R3__><__R2__><
>> - DATA1 ><__B3__><__B2__><__G7__><__G6__><__G5__><__G4__><__G3__><
>> - DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B7__><__B6__><__B5__><__B4__><
>> - DATA3 ><_CTL3_><__B1__><__B0__><__G1__><__G0__><__R1__><__R0__><
>> -
>> - - "vesa-24" - 24-bit data mapping compatible with the [VESA] specification.
>> - Data are transferred as follows on 4 LVDS lanes.
>> -
>> - Slot 0 1 2 3 4 5 6
>> - ________________ _________________
>> - Clock \_______________________/
>> - ______ ______ ______ ______ ______ ______ ______
>> - DATA0 ><__G0__><__R5__><__R4__><__R3__><__R2__><__R1__><__R0__><
>> - DATA1 ><__B1__><__B0__><__G5__><__G4__><__G3__><__G2__><__G1__><
>> - DATA2 ><_CTL2_><_CTL1_><_CTL0_><__B5__><__B4__><__B3__><__B2__><
>> - DATA3 ><_CTL3_><__B7__><__B6__><__G7__><__G6__><__R7__><__R6__><
>> -
>> - Control signals are mapped as follows.
>> -
>> - CTL0: HSync
>> - CTL1: VSync
>> - CTL2: Data Enable
>> - CTL3: 0
>> -
>> data-mirror:
>> type: boolean
>> description:
>> - If set, reverse the bit order described in the data mappings below on all
>> + If set, reverse the bit order described in the data mappings on all
>> data lanes, transmitting bits for slots 6 to 0 instead of 0 to 6.
>>
>> additionalProperties: true
>>
>
--
Pengutronix e.K. | Johannes Zink |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686| Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 2/3] dt-bindings: display: simple: support non-default data-mapping
2023-05-23 8:19 [PATCH v2 0/3] Support non-default LVDS data mapping for simple panel Johannes Zink
2023-05-23 8:19 ` [PATCH v2 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file Johannes Zink
@ 2023-05-23 8:19 ` Johannes Zink
2023-05-23 17:21 ` Conor Dooley
2023-06-02 15:35 ` Laurent Pinchart
2023-05-23 8:19 ` [PATCH v2 3/3] drm/panel-simple: allow LVDS format override Johannes Zink
2 siblings, 2 replies; 13+ messages in thread
From: Johannes Zink @ 2023-05-23 8:19 UTC (permalink / raw)
To: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Laurent Pinchart, Thierry Reding, Neil Armstrong,
Sam Ravnborg
Cc: kernel test robot, Dan Carpenter, patchwork-jzi, kernel,
Laurent Pinchart, dri-devel, devicetree, linux-kernel,
Johannes Zink
Some Displays support more than just a single default lvds data mapping,
which can be used to run displays on only 3 LVDS lanes in the jeida-18
data-mapping mode.
Add an optional data-mapping property to allow overriding the default
data mapping. As it does not generally apply to any display and bus: use
it selectively on the innolux,g101ice-l01, which supports changing the
data mapping via a strapping pin.
Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
---
Changes:
v1 -> v2: - worked in Rob's review findings (thanks for reviewing my
work): use extracted common property instead of duplicating
the property
- refined commit message
- add an example dts for automated checking
---
.../bindings/display/panel/panel-simple.yaml | 26 +++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
index ec50dd268314..698301c8c920 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
+++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
@@ -21,9 +21,9 @@ description: |
allOf:
- $ref: panel-common.yaml#
+ - $ref: ../lvds-data-mapping.yaml#
properties:
-
compatible:
enum:
# compatible must be listed in alphabetical order, ordered by compatible.
@@ -353,6 +353,17 @@ properties:
power-supply: true
no-hpd: true
hpd-gpios: true
+ data-mapping: true
+
+if:
+ not:
+ properties:
+ compatible:
+ contains:
+ const: innolux,g101ice-l01
+then:
+ properties:
+ data-mapping: false
additionalProperties: false
@@ -372,3 +383,16 @@ examples:
};
};
};
+ - |
+ panel_lvds: panel-lvds {
+ compatible = "innolux,g101ice-l01";
+ power-supply = <&vcc_lcd_reg>;
+
+ data-mapping = "jeida-24";
+
+ port {
+ panel_in_lvds: endpoint {
+ remote-endpoint = <<dc_out_lvds>;
+ };
+ };
+ };
--
2.39.2
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v2 2/3] dt-bindings: display: simple: support non-default data-mapping
2023-05-23 8:19 ` [PATCH v2 2/3] dt-bindings: display: simple: support non-default data-mapping Johannes Zink
@ 2023-05-23 17:21 ` Conor Dooley
2023-06-02 15:35 ` Laurent Pinchart
1 sibling, 0 replies; 13+ messages in thread
From: Conor Dooley @ 2023-05-23 17:21 UTC (permalink / raw)
To: Johannes Zink
Cc: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Laurent Pinchart, Thierry Reding, Neil Armstrong,
Sam Ravnborg, kernel test robot, Dan Carpenter, patchwork-jzi,
kernel, Laurent Pinchart, dri-devel, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2541 bytes --]
On Tue, May 23, 2023 at 10:19:42AM +0200, Johannes Zink wrote:
> Some Displays support more than just a single default lvds data mapping,
> which can be used to run displays on only 3 LVDS lanes in the jeida-18
> data-mapping mode.
>
> Add an optional data-mapping property to allow overriding the default
> data mapping. As it does not generally apply to any display and bus: use
> it selectively on the innolux,g101ice-l01, which supports changing the
> data mapping via a strapping pin.
>
> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>
> ---
>
> Changes:
>
> v1 -> v2: - worked in Rob's review findings (thanks for reviewing my
> work): use extracted common property instead of duplicating
> the property
That looks to be true (and Rob's AFK at the moment, hence unable to reply
to your ping) so,
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
> - refined commit message
> - add an example dts for automated checking
> ---
> .../bindings/display/panel/panel-simple.yaml | 26 +++++++++++++++++++++-
> 1 file changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> index ec50dd268314..698301c8c920 100644
> --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> @@ -21,9 +21,9 @@ description: |
>
> allOf:
> - $ref: panel-common.yaml#
> + - $ref: ../lvds-data-mapping.yaml#
>
> properties:
> -
> compatible:
> enum:
> # compatible must be listed in alphabetical order, ordered by compatible.
> @@ -353,6 +353,17 @@ properties:
> power-supply: true
> no-hpd: true
> hpd-gpios: true
> + data-mapping: true
> +
> +if:
> + not:
> + properties:
> + compatible:
> + contains:
> + const: innolux,g101ice-l01
> +then:
> + properties:
> + data-mapping: false
>
> additionalProperties: false
>
> @@ -372,3 +383,16 @@ examples:
> };
> };
> };
> + - |
> + panel_lvds: panel-lvds {
> + compatible = "innolux,g101ice-l01";
> + power-supply = <&vcc_lcd_reg>;
> +
> + data-mapping = "jeida-24";
> +
> + port {
> + panel_in_lvds: endpoint {
> + remote-endpoint = <<dc_out_lvds>;
> + };
> + };
> + };
>
> --
> 2.39.2
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH v2 2/3] dt-bindings: display: simple: support non-default data-mapping
2023-05-23 8:19 ` [PATCH v2 2/3] dt-bindings: display: simple: support non-default data-mapping Johannes Zink
2023-05-23 17:21 ` Conor Dooley
@ 2023-06-02 15:35 ` Laurent Pinchart
2023-07-28 8:36 ` Johannes Zink
1 sibling, 1 reply; 13+ messages in thread
From: Laurent Pinchart @ 2023-06-02 15:35 UTC (permalink / raw)
To: Johannes Zink
Cc: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Neil Armstrong, Sam Ravnborg,
kernel test robot, Dan Carpenter, patchwork-jzi, kernel,
dri-devel, devicetree, linux-kernel
Hi Johannes,
Thank you for the patch.
On Tue, May 23, 2023 at 10:19:42AM +0200, Johannes Zink wrote:
> Some Displays support more than just a single default lvds data mapping,
s/lvds/LVDS/
> which can be used to run displays on only 3 LVDS lanes in the jeida-18
> data-mapping mode.
>
> Add an optional data-mapping property to allow overriding the default
> data mapping. As it does not generally apply to any display and bus: use
s/bus:/bus,/
> it selectively on the innolux,g101ice-l01, which supports changing the
> data mapping via a strapping pin.
>
> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
> ---
>
> Changes:
>
> v1 -> v2: - worked in Rob's review findings (thanks for reviewing my
> work): use extracted common property instead of duplicating
> the property
> - refined commit message
> - add an example dts for automated checking
> ---
> .../bindings/display/panel/panel-simple.yaml | 26 +++++++++++++++++++++-
> 1 file changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> index ec50dd268314..698301c8c920 100644
> --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> @@ -21,9 +21,9 @@ description: |
>
> allOf:
> - $ref: panel-common.yaml#
> + - $ref: ../lvds-data-mapping.yaml#
>
> properties:
> -
> compatible:
> enum:
> # compatible must be listed in alphabetical order, ordered by compatible.
> @@ -353,6 +353,17 @@ properties:
> power-supply: true
> no-hpd: true
> hpd-gpios: true
> + data-mapping: true
As the property is optional, don't you need a default value ?
> +
> +if:
> + not:
> + properties:
> + compatible:
> + contains:
> + const: innolux,g101ice-l01
> +then:
> + properties:
> + data-mapping: false
>
> additionalProperties: false
>
> @@ -372,3 +383,16 @@ examples:
> };
> };
> };
> + - |
> + panel_lvds: panel-lvds {
> + compatible = "innolux,g101ice-l01";
> + power-supply = <&vcc_lcd_reg>;
> +
> + data-mapping = "jeida-24";
> +
> + port {
> + panel_in_lvds: endpoint {
> + remote-endpoint = <<dc_out_lvds>;
> + };
> + };
> + };
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH v2 2/3] dt-bindings: display: simple: support non-default data-mapping
2023-06-02 15:35 ` Laurent Pinchart
@ 2023-07-28 8:36 ` Johannes Zink
0 siblings, 0 replies; 13+ messages in thread
From: Johannes Zink @ 2023-07-28 8:36 UTC (permalink / raw)
To: Laurent Pinchart
Cc: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Neil Armstrong, Sam Ravnborg,
kernel test robot, Dan Carpenter, patchwork-jzi, kernel,
dri-devel, devicetree, linux-kernel
Hi Laurent,
thank you for your review.
On 6/2/23 17:35, Laurent Pinchart wrote:
> Hi Johannes,
>
> Thank you for the patch.
>
> On Tue, May 23, 2023 at 10:19:42AM +0200, Johannes Zink wrote:
>> Some Displays support more than just a single default lvds data mapping,
>
> s/lvds/LVDS/
ack, gonna fix in V3
>
>> which can be used to run displays on only 3 LVDS lanes in the jeida-18
>> data-mapping mode.
>>
>> Add an optional data-mapping property to allow overriding the default
>> data mapping. As it does not generally apply to any display and bus: use
>
> s/bus:/bus,/
ack, gonna fix in V3
>
>> it selectively on the innolux,g101ice-l01, which supports changing the
>> data mapping via a strapping pin.
>>
>> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>> ---
>>
>> Changes:
>>
>> v1 -> v2: - worked in Rob's review findings (thanks for reviewing my
>> work): use extracted common property instead of duplicating
>> the property
>> - refined commit message
>> - add an example dts for automated checking
>> ---
>> .../bindings/display/panel/panel-simple.yaml | 26 +++++++++++++++++++++-
>> 1 file changed, 25 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
>> index ec50dd268314..698301c8c920 100644
>> --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
>> +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
>> @@ -21,9 +21,9 @@ description: |
>>
>> allOf:
>> - $ref: panel-common.yaml#
>> + - $ref: ../lvds-data-mapping.yaml#
>>
>> properties:
>> -
>> compatible:
>> enum:
>> # compatible must be listed in alphabetical order, ordered by compatible.
>> @@ -353,6 +353,17 @@ properties:
>> power-supply: true
>> no-hpd: true
>> hpd-gpios: true
>> + data-mapping: true
>
> As the property is optional, don't you need a default value ?
as the simple-bus implicitely assumes default data mappings for LVDS panels, I
think this is not necessary. If the property is not used in a DT, the default
data mapping is used.
Best regards
Johannes
>
>> +
>> +if:
>> + not:
>> + properties:
>> + compatible:
>> + contains:
>> + const: innolux,g101ice-l01
>> +then:
>> + properties:
>> + data-mapping: false
>>
>> additionalProperties: false
>>
>> @@ -372,3 +383,16 @@ examples:
>> };
>> };
>> };
>> + - |
>> + panel_lvds: panel-lvds {
>> + compatible = "innolux,g101ice-l01";
>> + power-supply = <&vcc_lcd_reg>;
>> +
>> + data-mapping = "jeida-24";
>> +
>> + port {
>> + panel_in_lvds: endpoint {
>> + remote-endpoint = <<dc_out_lvds>;
>> + };
>> + };
>> + };
>>
>
--
Pengutronix e.K. | Johannes Zink |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686| Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 3/3] drm/panel-simple: allow LVDS format override
2023-05-23 8:19 [PATCH v2 0/3] Support non-default LVDS data mapping for simple panel Johannes Zink
2023-05-23 8:19 ` [PATCH v2 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file Johannes Zink
2023-05-23 8:19 ` [PATCH v2 2/3] dt-bindings: display: simple: support non-default data-mapping Johannes Zink
@ 2023-05-23 8:19 ` Johannes Zink
2023-06-02 14:34 ` Johannes Zink
2023-06-02 15:39 ` Laurent Pinchart
2 siblings, 2 replies; 13+ messages in thread
From: Johannes Zink @ 2023-05-23 8:19 UTC (permalink / raw)
To: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Laurent Pinchart, Thierry Reding, Neil Armstrong,
Sam Ravnborg
Cc: kernel test robot, Dan Carpenter, patchwork-jzi, kernel,
Laurent Pinchart, dri-devel, devicetree, linux-kernel,
Johannes Zink
Some panels support multiple LVDS data mapping formats, which can be
used e.g. run displays on jeida-18 format when only 3 LVDS lanes are
available.
Add parsing of an optional data-mapping devicetree property, which also
touches up the bits per color to match the bus format.
Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
---
Changes:
v1 -> v2: - fix missing unwind goto found by test robot
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/202304160359.4LHmFOlU-lkp@intel.com/
---
drivers/gpu/drm/panel/panel-simple.c | 39 +++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 2a9c1a785a5c..0a35fdb49ccb 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -40,6 +40,7 @@
#include <drm/drm_edid.h>
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_panel.h>
+#include <drm/drm_of.h>
/**
* struct panel_desc - Describes a simple panel.
@@ -559,7 +560,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
struct device_node *ddc;
int connector_type;
u32 bus_flags;
- int err;
+ int err, ret;
panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
if (!panel)
@@ -605,6 +606,42 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
panel_simple_parse_panel_timing_node(dev, panel, &dt);
}
+
+ /* optional data-mapping property for overriding bus format */
+ ret = drm_of_lvds_get_data_mapping(dev->of_node);
+ if (ret == -EINVAL) {
+ dev_warn(dev, "Ignore invalid data-mapping property");
+ } else if (ret != -ENODEV) {
+ int bpc;
+
+ switch (ret) {
+ default:
+ WARN_ON(1);
+ fallthrough;
+ case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG:
+ fallthrough;
+ case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA:
+ bpc = 8;
+ break;
+ case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG:
+ bpc = 6;
+ }
+
+ if (desc->bpc != bpc || desc->bus_format != ret) {
+ struct panel_desc *override_desc;
+
+ override_desc = devm_kmemdup(dev, desc, sizeof(*desc), GFP_KERNEL);
+ if (!override_desc) {
+ err = -ENOMEM;
+ goto free_ddc;
+ }
+
+ override_desc->bus_format = ret;
+ override_desc->bpc = bpc;
+ panel->desc = override_desc;
+ }
+ }
+
connector_type = desc->connector_type;
/* Catch common mistakes for panels. */
switch (connector_type) {
--
2.39.2
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v2 3/3] drm/panel-simple: allow LVDS format override
2023-05-23 8:19 ` [PATCH v2 3/3] drm/panel-simple: allow LVDS format override Johannes Zink
@ 2023-06-02 14:34 ` Johannes Zink
2023-06-02 15:39 ` Laurent Pinchart
1 sibling, 0 replies; 13+ messages in thread
From: Johannes Zink @ 2023-06-02 14:34 UTC (permalink / raw)
To: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Laurent Pinchart, Thierry Reding, Neil Armstrong,
Sam Ravnborg
Cc: devicetree, Laurent Pinchart, Dan Carpenter, kernel test robot,
linux-kernel, dri-devel, kernel, patchwork-jzi
Hi,
gentle ping here - Do you have any feedback for me on this patch?
Thanks and best regards
Johannes
On 5/23/23 10:19, Johannes Zink wrote:
> Some panels support multiple LVDS data mapping formats, which can be
> used e.g. run displays on jeida-18 format when only 3 LVDS lanes are
> available.
>
> Add parsing of an optional data-mapping devicetree property, which also
> touches up the bits per color to match the bus format.
>
> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>
> ---
>
> Changes:
>
> v1 -> v2: - fix missing unwind goto found by test robot
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Link: https://lore.kernel.org/r/202304160359.4LHmFOlU-lkp@intel.com/
> ---
> drivers/gpu/drm/panel/panel-simple.c | 39 +++++++++++++++++++++++++++++++++++-
> 1 file changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 2a9c1a785a5c..0a35fdb49ccb 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -40,6 +40,7 @@
> #include <drm/drm_edid.h>
> #include <drm/drm_mipi_dsi.h>
> #include <drm/drm_panel.h>
> +#include <drm/drm_of.h>
>
> /**
> * struct panel_desc - Describes a simple panel.
> @@ -559,7 +560,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
> struct device_node *ddc;
> int connector_type;
> u32 bus_flags;
> - int err;
> + int err, ret;
>
> panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
> if (!panel)
> @@ -605,6 +606,42 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
> panel_simple_parse_panel_timing_node(dev, panel, &dt);
> }
>
> +
> + /* optional data-mapping property for overriding bus format */
> + ret = drm_of_lvds_get_data_mapping(dev->of_node);
> + if (ret == -EINVAL) {
> + dev_warn(dev, "Ignore invalid data-mapping property");
> + } else if (ret != -ENODEV) {
> + int bpc;
> +
> + switch (ret) {
> + default:
> + WARN_ON(1);
> + fallthrough;
> + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG:
> + fallthrough;
> + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA:
> + bpc = 8;
> + break;
> + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG:
> + bpc = 6;
> + }
> +
> + if (desc->bpc != bpc || desc->bus_format != ret) {
> + struct panel_desc *override_desc;
> +
> + override_desc = devm_kmemdup(dev, desc, sizeof(*desc), GFP_KERNEL);
> + if (!override_desc) {
> + err = -ENOMEM;
> + goto free_ddc;
> + }
> +
> + override_desc->bus_format = ret;
> + override_desc->bpc = bpc;
> + panel->desc = override_desc;
> + }
> + }
> +
> connector_type = desc->connector_type;
> /* Catch common mistakes for panels. */
> switch (connector_type) {
>
--
Pengutronix e.K. | Johannes Zink |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686| Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH v2 3/3] drm/panel-simple: allow LVDS format override
2023-05-23 8:19 ` [PATCH v2 3/3] drm/panel-simple: allow LVDS format override Johannes Zink
2023-06-02 14:34 ` Johannes Zink
@ 2023-06-02 15:39 ` Laurent Pinchart
2023-06-05 6:20 ` Johannes Zink
1 sibling, 1 reply; 13+ messages in thread
From: Laurent Pinchart @ 2023-06-02 15:39 UTC (permalink / raw)
To: Johannes Zink
Cc: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Neil Armstrong, Sam Ravnborg,
kernel test robot, Dan Carpenter, patchwork-jzi, kernel,
dri-devel, devicetree, linux-kernel
Hi Johannes,
Thank you for the patch.
On Tue, May 23, 2023 at 10:19:43AM +0200, Johannes Zink wrote:
> Some panels support multiple LVDS data mapping formats, which can be
> used e.g. run displays on jeida-18 format when only 3 LVDS lanes are
> available.
>
> Add parsing of an optional data-mapping devicetree property, which also
> touches up the bits per color to match the bus format.
Of course one could argue that the innolux,g101ice-l01 panel should have
used the panel-lvds bindings... :-)
> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>
> ---
>
> Changes:
>
> v1 -> v2: - fix missing unwind goto found by test robot
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Link: https://lore.kernel.org/r/202304160359.4LHmFOlU-lkp@intel.com/
> ---
> drivers/gpu/drm/panel/panel-simple.c | 39 +++++++++++++++++++++++++++++++++++-
> 1 file changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 2a9c1a785a5c..0a35fdb49ccb 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -40,6 +40,7 @@
> #include <drm/drm_edid.h>
> #include <drm/drm_mipi_dsi.h>
> #include <drm/drm_panel.h>
> +#include <drm/drm_of.h>
>
> /**
> * struct panel_desc - Describes a simple panel.
> @@ -559,7 +560,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
> struct device_node *ddc;
> int connector_type;
> u32 bus_flags;
> - int err;
> + int err, ret;
>
> panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
> if (!panel)
> @@ -605,6 +606,42 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
> panel_simple_parse_panel_timing_node(dev, panel, &dt);
> }
>
> +
Double blank line.
> + /* optional data-mapping property for overriding bus format */
s/optional/Optional/
> + ret = drm_of_lvds_get_data_mapping(dev->of_node);
> + if (ret == -EINVAL) {
> + dev_warn(dev, "Ignore invalid data-mapping property");
> + } else if (ret != -ENODEV) {
If someone incorrectly sets the property in DT for a non-LVDS panel,
the result won't be nice. That's of course a DT issue, but I wonder if
we could/should protect against it. You could move this code to a
separate function (which would have the added benefit of lowering the
indentation level as you can return early in error cases), and call it
from panel_simple_probe() only if the panel is an LVDS panel (as
reported by its desc->bus_format value).
> + int bpc;
> +
> + switch (ret) {
> + default:
> + WARN_ON(1);
> + fallthrough;
> + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG:
> + fallthrough;
> + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA:
> + bpc = 8;
> + break;
> + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG:
> + bpc = 6;
> + }
> +
> + if (desc->bpc != bpc || desc->bus_format != ret) {
> + struct panel_desc *override_desc;
> +
> + override_desc = devm_kmemdup(dev, desc, sizeof(*desc), GFP_KERNEL);
> + if (!override_desc) {
> + err = -ENOMEM;
> + goto free_ddc;
> + }
> +
> + override_desc->bus_format = ret;
> + override_desc->bpc = bpc;
> + panel->desc = override_desc;
> + }
> + }
> +
> connector_type = desc->connector_type;
> /* Catch common mistakes for panels. */
> switch (connector_type) {
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH v2 3/3] drm/panel-simple: allow LVDS format override
2023-06-02 15:39 ` Laurent Pinchart
@ 2023-06-05 6:20 ` Johannes Zink
0 siblings, 0 replies; 13+ messages in thread
From: Johannes Zink @ 2023-06-05 6:20 UTC (permalink / raw)
To: Laurent Pinchart
Cc: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thierry Reding, Neil Armstrong, Sam Ravnborg,
kernel test robot, Dan Carpenter, patchwork-jzi, kernel,
dri-devel, devicetree, linux-kernel
Hi Laurent,
thanks for your review and your feedback.
On 6/2/23 17:39, Laurent Pinchart wrote:
> Hi Johannes,
>
> Thank you for the patch.
>
> On Tue, May 23, 2023 at 10:19:43AM +0200, Johannes Zink wrote:
>> Some panels support multiple LVDS data mapping formats, which can be
>> used e.g. run displays on jeida-18 format when only 3 LVDS lanes are
>> available.
>>
>> Add parsing of an optional data-mapping devicetree property, which also
>> touches up the bits per color to match the bus format.
>
> Of course one could argue that the innolux,g101ice-l01 panel should have
> used the panel-lvds bindings... :-)
I would prefer to add it in the panel-simple, if ever possible, as this already
has the timing information etc. in the driver. I would probably opt to use the
panel-lvds for an entirely new LVDS display, but as the innolux,g101ice-l01 is
already supported in panel-simple, imho there should be no harm in supporting
the jeida-18 operating mode as well. Also other displays in panel-simple
_might_ benefit from supporting non-default LVDS mapping modes, though I have
not researched whether they have actual hardware support for doing so.
>
>> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>>
>> ---
>>
>> Changes:
>>
>> v1 -> v2: - fix missing unwind goto found by test robot
>> Reported-by: kernel test robot <lkp@intel.com>
>> Reported-by: Dan Carpenter <error27@gmail.com>
>> Link: https://lore.kernel.org/r/202304160359.4LHmFOlU-lkp@intel.com/
>> ---
>> drivers/gpu/drm/panel/panel-simple.c | 39 +++++++++++++++++++++++++++++++++++-
>> 1 file changed, 38 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
>> index 2a9c1a785a5c..0a35fdb49ccb 100644
>> --- a/drivers/gpu/drm/panel/panel-simple.c
>> +++ b/drivers/gpu/drm/panel/panel-simple.c
>> @@ -40,6 +40,7 @@
>> #include <drm/drm_edid.h>
>> #include <drm/drm_mipi_dsi.h>
>> #include <drm/drm_panel.h>
>> +#include <drm/drm_of.h>
>>
>> /**
>> * struct panel_desc - Describes a simple panel.
>> @@ -559,7 +560,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
>> struct device_node *ddc;
>> int connector_type;
>> u32 bus_flags;
>> - int err;
>> + int err, ret;
>>
>> panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
>> if (!panel)
>> @@ -605,6 +606,42 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
>> panel_simple_parse_panel_timing_node(dev, panel, &dt);
>> }
>>
>> +
>
> Double blank line.
ack, gonna fix in v3.
>
>> + /* optional data-mapping property for overriding bus format */
>
> s/optional/Optional/
ack, gonna fix in v3.
>
>> + ret = drm_of_lvds_get_data_mapping(dev->of_node);
>> + if (ret == -EINVAL) {
>> + dev_warn(dev, "Ignore invalid data-mapping property");
>> + } else if (ret != -ENODEV) {
>
> If someone incorrectly sets the property in DT for a non-LVDS panel,
> the result won't be nice. That's of course a DT issue, but I wonder if
> we could/should protect against it. You could move this code to a
> separate function (which would have the added benefit of lowering the
> indentation level as you can return early in error cases), and call it
> from panel_simple_probe() only if the panel is an LVDS panel (as
> reported by its desc->bus_format value).
>
that's a good idea, gonna change it for v3.
>> + int bpc;
>> +
>> + switch (ret) {
>> + default:
>> + WARN_ON(1);
>> + fallthrough;
>> + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG:
>> + fallthrough;
>> + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA:
>> + bpc = 8;
>> + break;
>> + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG:
>> + bpc = 6;
>> + }
>> +
>> + if (desc->bpc != bpc || desc->bus_format != ret) {
>> + struct panel_desc *override_desc;
>> +
>> + override_desc = devm_kmemdup(dev, desc, sizeof(*desc), GFP_KERNEL);
>> + if (!override_desc) {
>> + err = -ENOMEM;
>> + goto free_ddc;
>> + }
>> +
>> + override_desc->bus_format = ret;
>> + override_desc->bpc = bpc;
>> + panel->desc = override_desc;
>> + }
>> + }
>> +
>> connector_type = desc->connector_type;
>> /* Catch common mistakes for panels. */
>> switch (connector_type) {
>
--
Pengutronix e.K. | Johannes Zink |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686| Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 13+ messages in thread