Skip to contentSkip to conversation

video: of: Drive edge selection for sync

PATCH Superseded Peter Ujfalusi 3 participants 8 messages Sep 22, 2016 – Sep 29, 2016

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover video: of: Drive edge selection for sync

Hi,

Changes since v1:
- separated the code changes from the omap/drm videomode conversion patches
- the DT bindings document is now explicitly states that the drive edge is referring to the pixel clock

Since we have several panels under omapdrm/displays/ where the data drive edge is set to be different then the sync drive edge, the first three patch will add support to select the sync drive edge via DT.
I was not able to locate the datasheet for all the panels and because the different edge was used in omapdrm and omapfb for a long time without complains from users - and they were written this way - I think it is a valid that we can have panels requiring different edge for data and sync to be driven.

This series will add support for the sync drive edge setting and the omapdrm's videmode conversion series depends on this change. It is also planned that the omapdrm is going to move to use the drm/panel in the future and to be able to convert the panel drivers we will need this feature.

Regards,
Peter
---
Peter Ujfalusi (3):
dt-bindings: display: display-timing: Add property to configure sync
drive edge
video: display_timing: Add flags to select the edge when the sync is
driven
video: of: display_timing: Add support for syncclk-active property

 .../devicetree/bindings/display/panel/display-timing.txt         | 8 ++++++++
 drivers/video/of_display_timing.c                                | 9 +++++++++
 include/video/display_timing.h                                   | 4 ++++
 3 files changed, 21 insertions(+)

--
2.10.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw

PATCH v2 1/3 dt-bindings: display: display-timing: Add property to configure sync drive edge

There are display panels which demands that the sync signal is driven on different edge than the pixel data.
With the syncclk-active property we can specify the clk edge to be used to drive the sync signal. When the property is missing it indicates that the sync is driven on the same edge as the pixel data.

---
 .../devicetree/bindings/display/panel/display-timing.txt          | 8 ++++++++
 1 file changed, 8 insertions(+)
Documentation/devicetree/bindings/display/panel/display-timing.txt +8 -0
index e1d4a0b59612..81a75893d1b8 100644
@@ -32,6 +32,14 @@ optional properties:
 			- 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
Signature · 6 lines
2.10.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer Acked-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: display: display-timing: Add property to configure sync drive edge

Quoted 6 lines · Peter Ujfalusi

There are display panels which demands that the sync signal is driven on different edge than the pixel data.
With the syncclk-active property we can specify the clk edge to be used to drive the sync signal. When the property is missing it indicates that the sync is driven on the same edge as the pixel data.

Quoted 7 lines
---
 .../devicetree/bindings/display/panel/display-timing.txt          | 8 ++++++++
 1 file changed, 8 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Reviewed-by on v2 1/3
#3 lore raw

Re: [PATCH v2 1/3] dt-bindings: display: display-timing: Add property to configure sync drive edge

In reply to Peter Ujfalusi
Quoted 20 lines · Peter Ujfalusi

There are display panels which demands that the sync signal is driven on different edge than the pixel data.
With the syncclk-active property we can specify the clk edge to be used to drive the sync signal. When the property is missing it indicates that the sync is driven on the same edge as the pixel data.

---
 .../devicetree/bindings/display/panel/display-timing.txt          | 8 ++++++++
 1 file changed, 8 insertions(+)
Documentation/devicetree/bindings/display/panel/display-timing.txt +0 -0
index e1d4a0b59612..81a75893d1b8 100644
@@ -32,6 +32,14 @@ optional properties:
 			- active low  = drive pixel data on falling edge/

Documentation/devicetree/bindings/display/panel/display-timing.txt optional properties: · line 42

Quoted 10 lines
Documentation/devicetree/bindings/display/panel/display-timing.txt +8 -0
 					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

I wonder if the "sample sync on..." should be left out here. It makes sense for the pixel data, but for sync... Do the panels "sample" it, or do they trigger on rising/falling edge?

Well, maybe that's a bit on the nitpick side, so:

Tomi

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

PATCH v2 2/3 video: display_timing: Add flags to select the edge when the sync is driven

In reply to Peter Ujfalusi

The sync can be - and for some panels it must be - driven on different edge then the data.

---
 include/video/display_timing.h | 4 ++++
 1 file changed, 4 insertions(+)
include/video/display_timing.h +4 -0
index 28d9d0d566ca..3d289e990aca 100644
@@ -28,6 +28,10 @@ enum display_flags {
 	DISPLAY_FLAGS_INTERLACED	= BIT(8),
 	DISPLAY_FLAGS_DOUBLESCAN	= BIT(9),
 	DISPLAY_FLAGS_DOUBLECLK		= BIT(10),
+	/* drive sync on pos. edge */
+	DISPLAY_FLAGS_SYNC_POSEDGE	= BIT(11),
+	/* drive sync on neg. edge */
+	DISPLAY_FLAGS_SYNC_NEGEDGE	= BIT(12),
 };
 
 /*
Signature · 1 line
2.10.0
Reviewed-by on v2 2/3
#5 lore raw

Re: [PATCH v2 2/3] video: display_timing: Add flags to select the edge when the sync is driven

Quoted 2 lines · Peter Ujfalusi

The sync can be - and for some panels it must be - driven on different edge then the data.

Well, the "can be" depends on the display controller =).

Quoted 14 lines
---
 include/video/display_timing.h | 4 ++++
 1 file changed, 4 insertions(+)
include/video/display_timing.h +0 -0
index 28d9d0d566ca..3d289e990aca 100644

include/video/display_timing.h enum display_flags { · line 37

Quoted 10 lines
include/video/display_timing.h +4 -0
@@ -28,6 +28,10 @@ enum display_flags {
 	DISPLAY_FLAGS_INTERLACED	= BIT(8),
 	DISPLAY_FLAGS_DOUBLESCAN	= BIT(9),
 	DISPLAY_FLAGS_DOUBLECLK		= BIT(10),
+	/* drive sync on pos. edge */
+	DISPLAY_FLAGS_SYNC_POSEDGE	= BIT(11),
+	/* drive sync on neg. edge */
+	DISPLAY_FLAGS_SYNC_NEGEDGE	= BIT(12),
 };
 
 /*

Tomi

#6 lore raw

PATCH v2 3/3 video: of: display_timing: Add support for syncclk-active property

In reply to Peter Ujfalusi

Configure the DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE flags according to the binding document.
If the syncclk-active is present in DT, configure the flags accordingly, if it is omitted it means that the SYNC edge is following the pixdata configuration.

---
 drivers/video/of_display_timing.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/video/of_display_timing.c +9 -0
index 8a1076beecd3..db992c684f09 100644
@@ -88,6 +88,15 @@ static int of_parse_display_timing(const struct device_node *np,
 		dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE :
 				DISPLAY_FLAGS_PIXDATA_NEGEDGE;
 
+	if (!of_property_read_u32(np, "syncclk-active", &val))
+		dt->flags |= val ? DISPLAY_FLAGS_SYNC_POSEDGE :
+				DISPLAY_FLAGS_SYNC_NEGEDGE;
+	else if (dt->flags & (DISPLAY_FLAGS_PIXDATA_POSEDGE |
+			      DISPLAY_FLAGS_PIXDATA_NEGEDGE))
+		dt->flags |= dt->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE ?
+				DISPLAY_FLAGS_SYNC_POSEDGE :
+				DISPLAY_FLAGS_SYNC_NEGEDGE;
+
 	if (of_property_read_bool(np, "interlaced"))
 		dt->flags |= DISPLAY_FLAGS_INTERLACED;
 	if (of_property_read_bool(np, "doublescan"))
Signature · 6 lines
2.10.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reviewed-by on v2 3/3
#7 lore raw

Re: [PATCH v2 3/3] video: of: display_timing: Add support for syncclk-active property

Quoted 25 lines · Peter Ujfalusi

Configure the DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE flags according to the binding document.
If the syncclk-active is present in DT, configure the flags accordingly, if it is omitted it means that the SYNC edge is following the pixdata configuration.

---
 drivers/video/of_display_timing.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/video/of_display_timing.c +2 -0
index 8a1076beecd3..db992c684f09 100644
@@ -88,6 +88,15 @@ static int of_parse_display_timing(const struct device_node *np,
 		dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE :
 				DISPLAY_FLAGS_PIXDATA_NEGEDGE;
 
+	if (!of_property_read_u32(np, "syncclk-active", &val))
+		dt->flags |= val ? DISPLAY_FLAGS_SYNC_POSEDGE :

drivers/video/of_display_timing.c static int of_parse_display_timing(const struct device_node *np, · line 102

Quoted 10 lines
drivers/video/of_display_timing.c +7 -0
+				DISPLAY_FLAGS_SYNC_NEGEDGE;
+	else if (dt->flags & (DISPLAY_FLAGS_PIXDATA_POSEDGE |
+			      DISPLAY_FLAGS_PIXDATA_NEGEDGE))
+		dt->flags |= dt->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE ?
+				DISPLAY_FLAGS_SYNC_POSEDGE :
+				DISPLAY_FLAGS_SYNC_NEGEDGE;
+
 	if (of_property_read_bool(np, "interlaced"))
 		dt->flags |= DISPLAY_FLAGS_INTERLACED;
 	if (of_property_read_bool(np, "doublescan"))

Tomi

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel