* [PATCH v5 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file
2023-09-29 12:33 [PATCH v5 0/3] Support non-default LVDS data mapping for simple panel Johannes Zink
@ 2023-09-29 12:33 ` Johannes Zink
2023-09-29 12:33 ` [PATCH v5 2/3] dt-bindings: display: simple: support non-default data-mapping Johannes Zink
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Johannes Zink @ 2023-09-29 12:33 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, Conor Dooley
As the LVDS data-mapping property is required in multiple bindings: move
it to separate file and include instead of duplicating it.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
---
Changes:
v4 -> v5: none, but are-dded the reviewed-bys from v2, that were missing in
v3 -> v4: none
v2 -> v3: worked in Conor's and Laurent's review findings (thank you
for reviewing my work): drop +| on description
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 | 77 +++-----------------
2 files changed, 93 insertions(+), 68 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..d68982fe2e9b
--- /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..224db4932011 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.
+description:
+ 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] 5+ messages in thread* [PATCH v5 2/3] dt-bindings: display: simple: support non-default data-mapping
2023-09-29 12:33 [PATCH v5 0/3] Support non-default LVDS data mapping for simple panel Johannes Zink
2023-09-29 12:33 ` [PATCH v5 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file Johannes Zink
@ 2023-09-29 12:33 ` Johannes Zink
2023-09-29 12:33 ` [PATCH v5 3/3] drm/panel-simple: allow LVDS format override Johannes Zink
2023-10-09 9:12 ` [PATCH v5 0/3] Support non-default LVDS data mapping for simple panel Neil Armstrong
3 siblings, 0 replies; 5+ messages in thread
From: Johannes Zink @ 2023-09-29 12:33 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, Conor Dooley
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.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
---
Changes:
v4 -> v5: none, re-added lost reviewed-by tag
v3 -> v4: none
v2 -> v3: - worked in Laurent's review findings (thanks for reviewing
my work): fix typos in commit message
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 50143fe67471..81ac402ceed1 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.
@@ -359,6 +359,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
@@ -378,3 +389,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] 5+ messages in thread* [PATCH v5 3/3] drm/panel-simple: allow LVDS format override
2023-09-29 12:33 [PATCH v5 0/3] Support non-default LVDS data mapping for simple panel Johannes Zink
2023-09-29 12:33 ` [PATCH v5 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file Johannes Zink
2023-09-29 12:33 ` [PATCH v5 2/3] dt-bindings: display: simple: support non-default data-mapping Johannes Zink
@ 2023-09-29 12:33 ` Johannes Zink
2023-10-09 9:12 ` [PATCH v5 0/3] Support non-default LVDS data mapping for simple panel Neil Armstrong
3 siblings, 0 replies; 5+ messages in thread
From: Johannes Zink @ 2023-09-29 12:33 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:
v4 -> v5: none
v3 -> v4: - worked in Dan's feedback (thanks for reviewing my work):
- return with a proper error in case the call to
panel_simple_override_nondefault_lvds_datamapping()
fails
- drop the unneeded and ambiguous ret variable
v2 -> v3: - worked in Laurent's review findings (thanks for reviewing
my work):
- extract fixing up the bus format to separate
function
- only call function on LVDS panels
- fix typos found by Laurent
- simplified error handling
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 | 53 ++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 857bc01591db..4195cf54934b 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.
@@ -549,6 +550,51 @@ static void panel_simple_parse_panel_timing_node(struct device *dev,
dev_err(dev, "Reject override mode: No display_timing found\n");
}
+static int panel_simple_override_nondefault_lvds_datamapping(struct device *dev,
+ struct panel_simple *panel)
+{
+ int ret, bpc;
+
+ ret = drm_of_lvds_get_data_mapping(dev->of_node);
+ if (ret < 0) {
+ if (ret == -EINVAL)
+ dev_warn(dev, "Ignore invalid data-mapping property\n");
+
+ /*
+ * Ignore non-existing or malformatted property, fallback to
+ * default data-mapping, and return 0.
+ */
+ return 0;
+ }
+
+ 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 (panel->desc->bpc != bpc || panel->desc->bus_format != ret) {
+ struct panel_desc *override_desc;
+
+ override_desc = devm_kmemdup(dev, panel->desc, sizeof(*panel->desc), GFP_KERNEL);
+ if (!override_desc)
+ return -ENOMEM;
+
+ override_desc->bus_format = ret;
+ override_desc->bpc = bpc;
+ panel->desc = override_desc;
+ }
+
+ return 0;
+}
+
static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
{
struct panel_simple *panel;
@@ -601,6 +647,13 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
panel_simple_parse_panel_timing_node(dev, panel, &dt);
}
+ if (desc->connector_type == DRM_MODE_CONNECTOR_LVDS) {
+ /* Optional data-mapping property for overriding bus format */
+ err = panel_simple_override_nondefault_lvds_datamapping(dev, panel);
+ if (err)
+ goto free_ddc;
+ }
+
connector_type = desc->connector_type;
/* Catch common mistakes for panels. */
switch (connector_type) {
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v5 0/3] Support non-default LVDS data mapping for simple panel
2023-09-29 12:33 [PATCH v5 0/3] Support non-default LVDS data mapping for simple panel Johannes Zink
` (2 preceding siblings ...)
2023-09-29 12:33 ` [PATCH v5 3/3] drm/panel-simple: allow LVDS format override Johannes Zink
@ 2023-10-09 9:12 ` Neil Armstrong
3 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2023-10-09 9:12 UTC (permalink / raw)
To: David Airlie, Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Laurent Pinchart, Thierry Reding, Sam Ravnborg,
Johannes Zink
Cc: kernel test robot, Dan Carpenter, patchwork-jzi, kernel,
Laurent Pinchart, dri-devel, devicetree, linux-kernel,
Conor Dooley
Hi,
On Fri, 29 Sep 2023 14:33:30 +0200, Johannes Zink wrote:
> Some LVDS panels, such as the innolux,g101ice-l01 support multiple LVDS
> data mapping modes, which can be configured by strapping a dataformat
> pin on the display to a specific voltage.
>
> This can be particularly useful for using the jeida-18 format, which
> requires only 3 instead of 4 LVDS lanes.
>
> [...]
Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)
[1/3] dt-bindings: display: move LVDS data-mapping definition to separate file
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=5437d667a0cae87d34c321ce1819ea78011efdc1
[2/3] dt-bindings: display: simple: support non-default data-mapping
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=66b66c97f4074c38b1c53c49625ebdd9a33ba56d
[3/3] drm/panel-simple: allow LVDS format override
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=1cd3ea3e4b124120dbdff3faf00a71c8fc6f6402
--
Neil
^ permalink raw reply [flat|nested] 5+ messages in thread