linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/18] Allwinner R40 HDMI refactoring
@ 2018-07-10 20:34 Jernej Skrabec
  2018-07-10 20:34 ` [PATCH v2 01/18] dt-bindings: display: sun4i-drm: Add R40 display engine compatible Jernej Skrabec
                   ` (18 more replies)
  0 siblings, 19 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:34 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

This series fixes several issues found in R40 HDMI patch series after
it was applied. Conversation can be found here:
http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.html

Patches are based on latest linux-next (next-20180710) and are ordered
in such way that they don't break R40 HDMI at any time. Because of that
I suggest that whole series goes through drm-misc to preserve that order.

I also tested those patches on H3 to make sure it doesn't break other
platforms. However, it would be nice to test for regressions also on
older SoCs (with DE1).

Best regards,
Jernej

Changes from v1:
- added Review-by and Acked-by tags
- added a patch which reorders mixer includes alphabetically
- reworked function which finds mixer id
- dropped register initialization in TCON TOP
- reworded some commit messages

Jernej Skrabec (18):
  dt-bindings: display: sun4i-drm: Add R40 display engine compatible
  drm/sun4i: Add R40 display engine compatible
  ARM: dts: sun8i: r40: Remove fallback display engine compatible
  drm/sun4i: tcon-top: Cleanup clock handling
  drm/sun4i: tcon: Release node when traversing of graph
  dt-bindings: display: sun4i-drm: Add R40 TV TCON description
  drm/sun4i: DW HDMI: Release nodes if error happens during CRTC search
  ARM: dts: sun8i: r40: Add mixer ids to TCON TOP
  drm/sun4i: mixer: Order includes alphabetically
  drm/sun4i: mixer: Read id from DT
  drm/sun4i: tcon-top: Add helpers for mux switching
  drm/sun4i: tcon: Add another way for matching mixers with tcon
  drm/sun4i: tcon: Add support for R40 TCON
  ARM: dts: sun8i: r40: Remove fallback compatible for TCON TV
  ARM: dts: sun8i: r40: Add missing TCON-TOP - TCON connections
  ARM: dts: sun8i: r40: Disable TCONs by default.
  drm/sun4i: tcon-top: Remove mux configuration at probe time
  dt-bindings: display: sun4i-drm: Fix order of DW HDMI PHY compatibles

 .../bindings/display/sunxi/sun4i-drm.txt      |   6 +-
 .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts  |  20 +-
 arch/arm/boot/dts/sun8i-r40.dtsi              |  65 ++++++-
 drivers/gpu/drm/sun4i/sun4i_drv.c             |   1 +
 drivers/gpu/drm/sun4i/sun4i_tcon.c            |  92 ++++++++-
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c         |  15 +-
 drivers/gpu/drm/sun4i/sun8i_mixer.c           |  42 ++++-
 drivers/gpu/drm/sun4i/sun8i_tcon_top.c        | 178 ++++++++----------
 drivers/gpu/drm/sun4i/sun8i_tcon_top.h        |   4 +
 9 files changed, 278 insertions(+), 145 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH v2 01/18] dt-bindings: display: sun4i-drm: Add R40 display engine compatible
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
@ 2018-07-10 20:34 ` Jernej Skrabec
  2018-07-10 20:34 ` [PATCH v2 02/18] drm/sun4i: " Jernej Skrabec
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:34 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

R40 has pretty unique display pipeline. It supports two outputs at the
same time.

Possible outputs:
- 1x HDMI,
- 2x TV output
- 1x VGA,
- 1x MIPI DSI and
- 2x LCD outputs

That is the biggest number of possible outputs from all Allwinner SoC.
Because of that, add new compatible for it.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
index 5a9319ad8861..288b4cbc255e 100644
--- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
+++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
@@ -399,6 +399,7 @@ Required properties:
     * allwinner,sun8i-a33-display-engine
     * allwinner,sun8i-a83t-display-engine
     * allwinner,sun8i-h3-display-engine
+    * allwinner,sun8i-r40-display-engine
     * allwinner,sun8i-v3s-display-engine
     * allwinner,sun9i-a80-display-engine
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 02/18] drm/sun4i: Add R40 display engine compatible
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
  2018-07-10 20:34 ` [PATCH v2 01/18] dt-bindings: display: sun4i-drm: Add R40 display engine compatible Jernej Skrabec
@ 2018-07-10 20:34 ` Jernej Skrabec
  2018-07-10 20:34 ` [PATCH v2 03/18] ARM: dts: sun8i: r40: Remove fallback " Jernej Skrabec
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:34 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

R40 has versatile display pipeline. It supports two simultanious outputs
on various outputs (TVE, VGA, HDMI, MIPI DSI, LCD).

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 6ddf4eaccb40..a15feb807393 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -417,6 +417,7 @@ static const struct of_device_id sun4i_drv_of_table[] = {
 	{ .compatible = "allwinner,sun8i-a33-display-engine" },
 	{ .compatible = "allwinner,sun8i-a83t-display-engine" },
 	{ .compatible = "allwinner,sun8i-h3-display-engine" },
+	{ .compatible = "allwinner,sun8i-r40-display-engine" },
 	{ .compatible = "allwinner,sun8i-v3s-display-engine" },
 	{ .compatible = "allwinner,sun9i-a80-display-engine" },
 	{ }
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 03/18] ARM: dts: sun8i: r40: Remove fallback display engine compatible
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
  2018-07-10 20:34 ` [PATCH v2 01/18] dt-bindings: display: sun4i-drm: Add R40 display engine compatible Jernej Skrabec
  2018-07-10 20:34 ` [PATCH v2 02/18] drm/sun4i: " Jernej Skrabec
@ 2018-07-10 20:34 ` Jernej Skrabec
  2018-07-10 20:34 ` [PATCH v2 04/18] drm/sun4i: tcon-top: Cleanup clock handling Jernej Skrabec
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:34 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

R40 has pretty unique display pipeline. Because of that, H3 display
engine compatible fallback should be removed.

Fixes: 05a43a262d03 ("ARM: dts: sun8i: r40: Add HDMI pipeline")

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 arch/arm/boot/dts/sun8i-r40.dtsi | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index c95a59aac48f..2afb079a3776 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -102,8 +102,7 @@
 	};
 
 	de: display-engine {
-		compatible = "allwinner,sun8i-r40-display-engine",
-			     "allwinner,sun8i-h3-display-engine";
+		compatible = "allwinner,sun8i-r40-display-engine";
 		allwinner,pipelines = <&mixer0>, <&mixer1>;
 		status = "disabled";
 	};
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 04/18] drm/sun4i: tcon-top: Cleanup clock handling
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (2 preceding siblings ...)
  2018-07-10 20:34 ` [PATCH v2 03/18] ARM: dts: sun8i: r40: Remove fallback " Jernej Skrabec
@ 2018-07-10 20:34 ` Jernej Skrabec
  2018-07-10 23:20   ` kbuild test robot
  2018-07-10 20:34 ` [PATCH v2 05/18] drm/sun4i: tcon: Release node when traversing of graph Jernej Skrabec
                   ` (14 subsequent siblings)
  18 siblings, 1 reply; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:34 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

There is no need to acquire reference to clock just to get its name.

This commit just cleans up the code. There is no functional change.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 48 ++++++--------------------
 1 file changed, 11 insertions(+), 37 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
index 8da0460e0028..9fb51940156f 100644
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
@@ -44,15 +44,20 @@ static int sun8i_tcon_top_get_connected_ep_id(struct device_node *node,
 }
 
 static struct clk_hw *sun8i_tcon_top_register_gate(struct device *dev,
-						   struct clk *parent,
+						   const char *parent,
 						   void __iomem *regs,
 						   spinlock_t *lock,
 						   u8 bit, int name_index)
 {
 	const char *clk_name, *parent_name;
-	int ret;
+	int ret, index;
+
+	index = of_property_match_string(dev->of_node, "clock-names", parent);
+	if (IS_ERR_VALUE(index))
+		return ERR_PTR(index);
+
+	parent_name = of_clk_get_parent_name(dev->of_node, index);
 
-	parent_name = __clk_get_name(parent);
 	ret = of_property_read_string_index(dev->of_node,
 					    "clock-output-names", name_index,
 					    &clk_name);
@@ -69,7 +74,6 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
 			       void *data)
 {
 	struct platform_device *pdev = to_platform_device(dev);
-	struct clk *dsi, *tcon_tv0, *tcon_tv1, *tve0, *tve1;
 	struct clk_hw_onecell_data *clk_data;
 	struct sun8i_tcon_top *tcon_top;
 	bool mixer0_unused = false;
@@ -103,36 +107,6 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
 		return PTR_ERR(tcon_top->bus);
 	}
 
-	dsi = devm_clk_get(dev, "dsi");
-	if (IS_ERR(dsi)) {
-		dev_err(dev, "Couldn't get the dsi clock\n");
-		return PTR_ERR(dsi);
-	}
-
-	tcon_tv0 = devm_clk_get(dev, "tcon-tv0");
-	if (IS_ERR(tcon_tv0)) {
-		dev_err(dev, "Couldn't get the tcon-tv0 clock\n");
-		return PTR_ERR(tcon_tv0);
-	}
-
-	tcon_tv1 = devm_clk_get(dev, "tcon-tv1");
-	if (IS_ERR(tcon_tv1)) {
-		dev_err(dev, "Couldn't get the tcon-tv1 clock\n");
-		return PTR_ERR(tcon_tv1);
-	}
-
-	tve0 = devm_clk_get(dev, "tve0");
-	if (IS_ERR(tve0)) {
-		dev_err(dev, "Couldn't get the tve0 clock\n");
-		return PTR_ERR(tve0);
-	}
-
-	tve1 = devm_clk_get(dev, "tve1");
-	if (IS_ERR(tve1)) {
-		dev_err(dev, "Couldn't get the tve1 clock\n");
-		return PTR_ERR(tve1);
-	}
-
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	regs = devm_ioremap_resource(dev, res);
 	if (IS_ERR(regs))
@@ -203,17 +177,17 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
 	 * to TVE clock parent.
 	 */
 	clk_data->hws[CLK_TCON_TOP_TV0] =
-		sun8i_tcon_top_register_gate(dev, tcon_tv0, regs,
+		sun8i_tcon_top_register_gate(dev, "tcon-tv0", regs,
 					     &tcon_top->reg_lock,
 					     TCON_TOP_TCON_TV0_GATE, 0);
 
 	clk_data->hws[CLK_TCON_TOP_TV1] =
-		sun8i_tcon_top_register_gate(dev, tcon_tv1, regs,
+		sun8i_tcon_top_register_gate(dev, "tcon-tv1", regs,
 					     &tcon_top->reg_lock,
 					     TCON_TOP_TCON_TV1_GATE, 1);
 
 	clk_data->hws[CLK_TCON_TOP_DSI] =
-		sun8i_tcon_top_register_gate(dev, dsi, regs,
+		sun8i_tcon_top_register_gate(dev, "dsi", regs,
 					     &tcon_top->reg_lock,
 					     TCON_TOP_TCON_DSI_GATE, 2);
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 05/18] drm/sun4i: tcon: Release node when traversing of graph
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (3 preceding siblings ...)
  2018-07-10 20:34 ` [PATCH v2 04/18] drm/sun4i: tcon-top: Cleanup clock handling Jernej Skrabec
@ 2018-07-10 20:34 ` Jernej Skrabec
  2018-07-10 20:34 ` [PATCH v2 06/18] dt-bindings: display: sun4i-drm: Add R40 TV TCON description Jernej Skrabec
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:34 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

Function sun4i_tcon_find_engine_traverse() doesn't release node if it
needs to traverse of graph deeper than 1 level.

Fix this by calling of_node_put().

Fixes: 49836b11fe71 ("drm/sun4i: tcon: Generalize engine search algorithm")

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index aacc841d3dc6..3fb084f802e2 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -811,6 +811,7 @@ sun4i_tcon_find_engine_traverse(struct sun4i_drv *drv,
 	 * remote output id. If this for some reason can't be done, 0
 	 * is used as input port id.
 	 */
+	of_node_put(port);
 	port = of_graph_get_remote_port(ep);
 	if (!of_property_read_u32(port, "reg", &reg) && reg > 0)
 		reg -= 1;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 06/18] dt-bindings: display: sun4i-drm: Add R40 TV TCON description
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (4 preceding siblings ...)
  2018-07-10 20:34 ` [PATCH v2 05/18] drm/sun4i: tcon: Release node when traversing of graph Jernej Skrabec
@ 2018-07-10 20:34 ` Jernej Skrabec
  2018-07-10 20:35 ` [PATCH v2 07/18] drm/sun4i: DW HDMI: Release nodes if error happens during CRTC search Jernej Skrabec
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:34 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

TCON description is expanded with R40 TV TCON compatible. It is a bit
special, because it is connected to TCON TOP instead directly to mixer
and it needs special handling.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
index 288b4cbc255e..7e2451396a28 100644
--- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
+++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
@@ -147,6 +147,7 @@ Required properties:
    * allwinner,sun8i-a33-tcon
    * allwinner,sun8i-a83t-tcon-lcd
    * allwinner,sun8i-a83t-tcon-tv
+   * allwinner,sun8i-r40-tcon-tv
    * allwinner,sun8i-v3s-tcon
    * allwinner,sun9i-a80-tcon-lcd
    * allwinner,sun9i-a80-tcon-tv
@@ -181,7 +182,7 @@ For TCONs with channel 0, there is one more clock required:
 For TCONs with channel 1, there is one more clock required:
    - 'tcon-ch1': The clock driving the TCON channel 1
 
-When TCON support LVDS (all TCONs except TV TCON on A83T and those found
+When TCON support LVDS (all TCONs except TV TCONs on A83T, R40 and those found
 in A13, H3, H5 and V3s SoCs), you need one more reset line:
    - 'lvds': The reset line driving the LVDS logic
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 07/18] drm/sun4i: DW HDMI: Release nodes if error happens during CRTC search
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (5 preceding siblings ...)
  2018-07-10 20:34 ` [PATCH v2 06/18] dt-bindings: display: sun4i-drm: Add R40 TV TCON description Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-10 20:35 ` [PATCH v2 08/18] ARM: dts: sun8i: r40: Add mixer ids to TCON TOP Jernej Skrabec
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

If error happens in sun8i_dw_hdmi_find_possible_crtcs(), nodes are not
released with of_node_put() before returning.

Fix that by calling of_node_put() when necessary. While on it, clean up
the code by using of_graph_get_remote_node() which also lowers number of
cases where error handling has to be performed.

Fixes: 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs")

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
index 3459b9ec56c9..21dc9ebad0b4 100644
--- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
+++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
@@ -53,22 +53,14 @@ static u32 sun8i_dw_hdmi_find_possible_crtcs(struct drm_device *drm,
 	struct device_node *port, *ep, *remote, *remote_port;
 	u32 crtcs = 0;
 
-	port = of_graph_get_port_by_id(node, 0);
-	if (!port)
-		return 0;
-
-	ep = of_get_next_available_child(port, NULL);
-	if (!ep)
-		return 0;
-
-	remote = of_graph_get_remote_port_parent(ep);
+	remote = of_graph_get_remote_node(node, 0, -1);
 	if (!remote)
 		return 0;
 
 	if (sun8i_dw_hdmi_node_is_tcon_top(remote)) {
 		port = of_graph_get_port_by_id(remote, 4);
 		if (!port)
-			return 0;
+			goto crtcs_exit;
 
 		for_each_child_of_node(port, ep) {
 			remote_port = of_graph_get_remote_port(ep);
@@ -81,6 +73,9 @@ static u32 sun8i_dw_hdmi_find_possible_crtcs(struct drm_device *drm,
 		crtcs = drm_of_find_possible_crtcs(drm, node);
 	}
 
+crtcs_exit:
+	of_node_put(remote);
+
 	return crtcs;
 }
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 08/18] ARM: dts: sun8i: r40: Add mixer ids to TCON TOP
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (6 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 07/18] drm/sun4i: DW HDMI: Release nodes if error happens during CRTC search Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-11  2:55   ` Chen-Yu Tsai
  2018-07-10 20:35 ` [PATCH v2 09/18] drm/sun4i: mixer: Order includes alphabetically Jernej Skrabec
                   ` (10 subsequent siblings)
  18 siblings, 1 reply; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

sun4i-drm DT binding, second paragraph of the first section says:

For all connections between components up to the TCONs in the display
pipeline, when there are multiple components of the same type at the
same depth, the local endpoint ID must be the same as the remote
component's index.

Add mixer ids in R40 DT as mandated by DT binding.

Fixes: 05a43a262d03 ("ARM: dts: sun8i: r40: Add HDMI pipeline")

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 arch/arm/boot/dts/sun8i-r40.dtsi | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 2afb079a3776..1dd088d82773 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -576,9 +576,12 @@
 				#size-cells = <0>;
 
 				tcon_top_mixer0_in: port@0 {
+					#address-cells = <1>;
+					#size-cells = <0>;
 					reg = <0>;
 
-					tcon_top_mixer0_in_mixer0: endpoint {
+					tcon_top_mixer0_in_mixer0: endpoint@0 {
+						reg = <0>;
 						remote-endpoint = <&mixer0_out_tcon_top>;
 					};
 				};
@@ -606,9 +609,12 @@
 				};
 
 				tcon_top_mixer1_in: port@2 {
+					#address-cells = <1>;
+					#size-cells = <0>;
 					reg = <2>;
 
-					tcon_top_mixer1_in_mixer1: endpoint {
+					tcon_top_mixer1_in_mixer1: endpoint@1 {
+						reg = <1>;
 						remote-endpoint = <&mixer1_out_tcon_top>;
 					};
 				};
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 09/18] drm/sun4i: mixer: Order includes alphabetically
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (7 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 08/18] ARM: dts: sun8i: r40: Add mixer ids to TCON TOP Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-11  2:56   ` Chen-Yu Tsai
  2018-07-10 20:35 ` [PATCH v2 10/18] drm/sun4i: mixer: Read id from DT Jernej Skrabec
                   ` (9 subsequent siblings)
  18 siblings, 1 reply; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

Includes are not alphabetically ordered.

Reorder them.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/sun4i/sun8i_mixer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
index ee8febb25903..aa81b9838ae8 100644
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
@@ -21,8 +21,8 @@
 
 #include <linux/component.h>
 #include <linux/dma-mapping.h>
-#include <linux/reset.h>
 #include <linux/of_device.h>
+#include <linux/reset.h>
 
 #include "sun4i_drv.h"
 #include "sun8i_mixer.h"
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 10/18] drm/sun4i: mixer: Read id from DT
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (8 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 09/18] drm/sun4i: mixer: Order includes alphabetically Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-11  3:11   ` Chen-Yu Tsai
  2018-07-10 20:35 ` [PATCH v2 11/18] drm/sun4i: tcon-top: Add helpers for mux switching Jernej Skrabec
                   ` (8 subsequent siblings)
  18 siblings, 1 reply; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

Currently, TCON supports 2 ways to match TCON with engine (mixer in this
case). Old way is to just traverse of graph backwards and compare node
pointer. New way is to match TCON and engine by their respective ids.
All SoCs with DE2 enabled till now used the old way, which means mixer
id was never used and thus never implemented.

However, for R40, only the new way will be used. To prepare for that,
implement mixer id fetching from DT.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/sun4i/sun8i_mixer.c | 40 +++++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
index aa81b9838ae8..4bd4d8ccb34f 100644
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
@@ -22,6 +22,7 @@
 #include <linux/component.h>
 #include <linux/dma-mapping.h>
 #include <linux/of_device.h>
+#include <linux/of_graph.h>
 #include <linux/reset.h>
 
 #include "sun4i_drv.h"
@@ -322,6 +323,42 @@ static struct regmap_config sun8i_mixer_regmap_config = {
 	.max_register	= 0xbfffc, /* guessed */
 };
 
+static int sun8i_mixer_of_get_id(struct device_node *node)
+{
+	struct device_node *port, *ep;
+	int ret = -EINVAL;
+
+	/* output is port 1 */
+	port = of_graph_get_port_by_id(node, 1);
+	if (!port)
+		return -EINVAL;
+
+	/* try to find downstream endpoint */
+	for_each_available_child_of_node(port, ep) {
+		struct device_node *remote;
+		u32 reg;
+
+		remote = of_graph_get_remote_endpoint(ep);
+		if (!remote)
+			continue;
+
+		ret = of_property_read_u32(remote, "reg", &reg);
+		if (!ret) {
+			of_node_put(remote);
+			of_node_put(ep);
+			of_node_put(port);
+
+			return reg;
+		}
+
+		of_node_put(remote);
+	}
+
+	of_node_put(port);
+
+	return ret;
+}
+
 static int sun8i_mixer_bind(struct device *dev, struct device *master,
 			      void *data)
 {
@@ -353,8 +390,7 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master,
 	dev_set_drvdata(dev, mixer);
 	mixer->engine.ops = &sun8i_engine_ops;
 	mixer->engine.node = dev->of_node;
-	/* The ID of the mixer currently doesn't matter */
-	mixer->engine.id = -1;
+	mixer->engine.id = sun8i_mixer_of_get_id(dev->of_node);
 
 	mixer->cfg = of_device_get_match_data(dev);
 	if (!mixer->cfg)
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 11/18] drm/sun4i: tcon-top: Add helpers for mux switching
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (9 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 10/18] drm/sun4i: mixer: Read id from DT Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-10 20:35 ` [PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching mixers with tcon Jernej Skrabec
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

We want to be able to set TCON TOP muxes at runtime. Add helpers for
that.

Old, static configuration of muxes at probe time is preserved for now.
It will be removed when R40 TCON starts using them.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 74 ++++++++++++++++++++++++++
 drivers/gpu/drm/sun4i/sun8i_tcon_top.h |  4 ++
 2 files changed, 78 insertions(+)

diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
index 9fb51940156f..c09b15b64192 100644
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
@@ -14,6 +14,79 @@
 
 #include "sun8i_tcon_top.h"
 
+static bool sun8i_tcon_top_node_is_tcon_top(struct device_node *node)
+{
+	return !!of_match_node(sun8i_tcon_top_of_table, node);
+}
+
+int sun8i_tcon_top_set_hdmi_src(struct device *dev, int tcon)
+{
+	struct sun8i_tcon_top *tcon_top = dev_get_drvdata(dev);
+	unsigned long flags;
+	u32 val;
+
+	if (!sun8i_tcon_top_node_is_tcon_top(dev->of_node)) {
+		dev_err(dev, "Device is not TCON TOP!\n");
+		return -EINVAL;
+	}
+
+	if (tcon < 2 || tcon > 3) {
+		dev_err(dev, "TCON index must be 2 or 3!\n");
+		return -EINVAL;
+	}
+
+	spin_lock_irqsave(&tcon_top->reg_lock, flags);
+
+	val = readl(tcon_top->regs + TCON_TOP_GATE_SRC_REG);
+	val &= ~TCON_TOP_HDMI_SRC_MSK;
+	val |= FIELD_PREP(TCON_TOP_HDMI_SRC_MSK, tcon - 1);
+	writel(val, tcon_top->regs + TCON_TOP_GATE_SRC_REG);
+
+	spin_unlock_irqrestore(&tcon_top->reg_lock, flags);
+
+	return 0;
+}
+EXPORT_SYMBOL(sun8i_tcon_top_set_hdmi_src);
+
+int sun8i_tcon_top_de_config(struct device *dev, int mixer, int tcon)
+{
+	struct sun8i_tcon_top *tcon_top = dev_get_drvdata(dev);
+	unsigned long flags;
+	u32 reg;
+
+	if (!sun8i_tcon_top_node_is_tcon_top(dev->of_node)) {
+		dev_err(dev, "Device is not TCON TOP!\n");
+		return -EINVAL;
+	}
+
+	if (mixer > 1) {
+		dev_err(dev, "Mixer index is too high!\n");
+		return -EINVAL;
+	}
+
+	if (tcon > 3) {
+		dev_err(dev, "TCON index is too high!\n");
+		return -EINVAL;
+	}
+
+	spin_lock_irqsave(&tcon_top->reg_lock, flags);
+
+	reg = readl(tcon_top->regs + TCON_TOP_PORT_SEL_REG);
+	if (mixer == 0) {
+		reg &= ~TCON_TOP_PORT_DE0_MSK;
+		reg |= FIELD_PREP(TCON_TOP_PORT_DE0_MSK, tcon);
+	} else {
+		reg &= ~TCON_TOP_PORT_DE1_MSK;
+		reg |= FIELD_PREP(TCON_TOP_PORT_DE1_MSK, tcon);
+	}
+	writel(reg, tcon_top->regs + TCON_TOP_PORT_SEL_REG);
+
+	spin_unlock_irqrestore(&tcon_top->reg_lock, flags);
+
+	return 0;
+}
+EXPORT_SYMBOL(sun8i_tcon_top_de_config);
+
 static int sun8i_tcon_top_get_connected_ep_id(struct device_node *node,
 					      int port_id)
 {
@@ -109,6 +182,7 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	regs = devm_ioremap_resource(dev, res);
+	tcon_top->regs = regs;
 	if (IS_ERR(regs))
 		return PTR_ERR(regs);
 
diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.h b/drivers/gpu/drm/sun4i/sun8i_tcon_top.h
index 39838bbfeaee..0390584a330e 100644
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.h
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.h
@@ -26,6 +26,7 @@
 struct sun8i_tcon_top {
 	struct clk			*bus;
 	struct clk_hw_onecell_data	*clk_data;
+	void __iomem			*regs;
 	struct reset_control		*rst;
 
 	/*
@@ -37,4 +38,7 @@ struct sun8i_tcon_top {
 
 extern const struct of_device_id sun8i_tcon_top_of_table[];
 
+int sun8i_tcon_top_set_hdmi_src(struct device *dev, int tcon);
+int sun8i_tcon_top_de_config(struct device *dev, int mixer, int tcon);
+
 #endif /* _SUN8I_TCON_TOP_H_ */
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching mixers with tcon
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (10 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 11/18] drm/sun4i: tcon-top: Add helpers for mux switching Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-10 20:35 ` [PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON Jernej Skrabec
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

Till now, new way of matching engines with TCONs was reading their
respective ids and match them by those ids. However, with introduction
of TCON TOP, that might not be so straightforward anymore.
- there might be more TCONs that engines (mixers)
- TCON ids might have non-consecutive ids

Workaround that by matching mixer id with TCON index from TCON list.

For example, R40 has 2 mixers and 4 TCONs. Board designer can choose
2 outputs, which are connected to any of those 4 TCONs. As long as there
are only 2 TCONs enabled in DT, using index in list as alternative id,
will allow to match them with mixer 0 and 1.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 51 ++++++++++++++++++++++++++++--
 1 file changed, 49 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 3fb084f802e2..44ec3a3d4d64 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -35,6 +35,7 @@
 #include "sun4i_rgb.h"
 #include "sun4i_tcon.h"
 #include "sun6i_mipi_dsi.h"
+#include "sun8i_tcon_top.h"
 #include "sunxi_engine.h"
 
 static struct drm_connector *sun4i_tcon_get_connector(const struct drm_encoder *encoder)
@@ -880,6 +881,36 @@ static struct sunxi_engine *sun4i_tcon_get_engine_by_id(struct sun4i_drv *drv,
 	return ERR_PTR(-EINVAL);
 }
 
+static bool sun4i_tcon_connected_to_tcon_top(struct device_node *node)
+{
+	struct device_node *remote;
+	bool ret = false;
+
+	remote = of_graph_get_remote_node(node, 0, -1);
+	if (remote) {
+		ret = !!of_match_node(sun8i_tcon_top_of_table, remote);
+		of_node_put(remote);
+	}
+
+	return ret;
+}
+
+static int sun4i_tcon_get_index(struct sun4i_drv *drv)
+{
+	struct list_head *pos;
+	int size = 0;
+
+	/*
+	 * Because TCON is added to the list at the end of the probe
+	 * (after this function is called), index of the current TCON
+	 * will be same as current TCON list size.
+	 */
+	list_for_each(pos, &drv->tcon_list)
+		++size;
+
+	return size;
+}
+
 /*
  * On SoCs with the old display pipeline design (Display Engine 1.0),
  * we assumed the TCON was always tied to just one backend. However
@@ -928,8 +959,24 @@ static struct sunxi_engine *sun4i_tcon_find_engine(struct sun4i_drv *drv,
 	 * connections between the backend and TCON?
 	 */
 	if (of_get_child_count(port) > 1) {
-		/* Get our ID directly from an upstream endpoint */
-		int id = sun4i_tcon_of_get_id_from_port(port);
+		int id;
+
+		/*
+		 * When pipeline has the same number of TCONs and engines which
+		 * are represented by frontends/backends (DE1) or mixers (DE2),
+		 * we match them by their respective IDs. However, if pipeline
+		 * contains TCON TOP, chances are that there are either more
+		 * TCONs than engines (R40) or TCONs with non-consecutive ids.
+		 * (H6). In that case it's easier just use TCON index in list
+		 * as an id. That means that on R40, any 2 TCONs can be enabled
+		 * in DT out of 4 (there are 2 mixers). Due to the design of
+		 * TCON TOP, remaining 2 TCONs can't be connected to anything
+		 * anyway.
+		 */
+		if (sun4i_tcon_connected_to_tcon_top(node))
+			id = sun4i_tcon_get_index(drv);
+		else
+			id = sun4i_tcon_of_get_id_from_port(port);
 
 		/* Get our engine by matching our ID */
 		engine = sun4i_tcon_get_engine_by_id(drv, id);
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (11 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching mixers with tcon Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-10 20:35 ` [PATCH v2 14/18] ARM: dts: sun8i: r40: Remove fallback compatible for TCON TV Jernej Skrabec
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

R40 TV TCON is basically the same as on A83T. However, it needs special
handling, because it has to set up TCON TOP muxes at runtime.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 40 ++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 44ec3a3d4d64..5676b7faaca0 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -1291,6 +1291,40 @@ static int sun6i_tcon_set_mux(struct sun4i_tcon *tcon,
 	return 0;
 }
 
+static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,
+				     const struct drm_encoder *encoder)
+{
+	struct device_node *port, *remote;
+	struct platform_device *pdev;
+	int id, ret;
+
+	/* find TCON TOP platform device and TCON id */
+
+	port = of_graph_get_port_by_id(tcon->dev->of_node, 0);
+	if (!port)
+		return -EINVAL;
+
+	id = sun4i_tcon_of_get_id_from_port(port);
+	of_node_put(port);
+
+	remote = of_graph_get_remote_node(tcon->dev->of_node, 0, -1);
+	if (!remote)
+		return -EINVAL;
+
+	pdev = of_find_device_by_node(remote);
+	of_node_put(remote);
+	if (!pdev)
+		return -EINVAL;
+
+	if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
+		ret = sun8i_tcon_top_set_hdmi_src(&pdev->dev, id);
+		if (ret)
+			return ret;
+	}
+
+	return sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
+}
+
 static const struct sun4i_tcon_quirks sun4i_a10_quirks = {
 	.has_channel_0		= true,
 	.has_channel_1		= true,
@@ -1338,6 +1372,11 @@ static const struct sun4i_tcon_quirks sun8i_a83t_tv_quirks = {
 	.has_channel_1		= true,
 };
 
+static const struct sun4i_tcon_quirks sun8i_r40_tv_quirks = {
+	.has_channel_1		= true,
+	.set_mux		= sun8i_r40_tcon_tv_set_mux,
+};
+
 static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
 	.has_channel_0		= true,
 };
@@ -1362,6 +1401,7 @@ const struct of_device_id sun4i_tcon_of_table[] = {
 	{ .compatible = "allwinner,sun8i-a33-tcon", .data = &sun8i_a33_quirks },
 	{ .compatible = "allwinner,sun8i-a83t-tcon-lcd", .data = &sun8i_a83t_lcd_quirks },
 	{ .compatible = "allwinner,sun8i-a83t-tcon-tv", .data = &sun8i_a83t_tv_quirks },
+	{ .compatible = "allwinner,sun8i-r40-tcon-tv", .data = &sun8i_r40_tv_quirks },
 	{ .compatible = "allwinner,sun8i-v3s-tcon", .data = &sun8i_v3s_quirks },
 	{ .compatible = "allwinner,sun9i-a80-tcon-lcd", .data = &sun9i_a80_tcon_lcd_quirks },
 	{ .compatible = "allwinner,sun9i-a80-tcon-tv", .data = &sun9i_a80_tcon_tv_quirks },
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 14/18] ARM: dts: sun8i: r40: Remove fallback compatible for TCON TV
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (12 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-10 20:35 ` [PATCH v2 15/18] ARM: dts: sun8i: r40: Add missing TCON-TOP - TCON connections Jernej Skrabec
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

A83T and R40 TCON TV are very similar. However, R40 TCON TV is wired
differently, which makes it incompatible with A83T TCON TV.

Because of that, remove fallback A83T TCON TV compatible.

Fixes: 05a43a262d03 ("ARM: dts: sun8i: r40: Add HDMI pipeline")

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 arch/arm/boot/dts/sun8i-r40.dtsi | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 1dd088d82773..6b4fe8eeee99 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -666,8 +666,7 @@
 		};
 
 		tcon_tv0: lcd-controller@1c73000 {
-			compatible = "allwinner,sun8i-r40-tcon-tv",
-				     "allwinner,sun8i-a83t-tcon-tv";
+			compatible = "allwinner,sun8i-r40-tcon-tv";
 			reg = <0x01c73000 0x1000>;
 			interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ccu CLK_BUS_TCON_TV0>, <&tcon_top 0>;
@@ -690,8 +689,7 @@
 		};
 
 		tcon_tv1: lcd-controller@1c74000 {
-			compatible = "allwinner,sun8i-r40-tcon-tv",
-				     "allwinner,sun8i-a83t-tcon-tv";
+			compatible = "allwinner,sun8i-r40-tcon-tv";
 			reg = <0x01c74000 0x1000>;
 			interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ccu CLK_BUS_TCON_TV1>, <&tcon_top 1>;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 15/18] ARM: dts: sun8i: r40: Add missing TCON-TOP - TCON connections
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (13 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 14/18] ARM: dts: sun8i: r40: Remove fallback compatible for TCON TV Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-10 20:35 ` [PATCH v2 16/18] ARM: dts: sun8i: r40: Disable TCONs by default Jernej Skrabec
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

Current R40 is missing some graph connections between TCON TOP and
TCONs.

Add them.

Fixes: 05a43a262d03 ("ARM: dts: sun8i: r40: Add HDMI pipeline")

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts  | 20 ---------
 arch/arm/boot/dts/sun8i-r40.dtsi              | 44 +++++++++++++++++++
 2 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
index 4f3d583183dc..737cf01b1acd 100644
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -251,26 +251,6 @@
 	regulator-name = "vcc-wifi";
 };
 
-&tcon_top_hdmi_in_tcon_tv0 {
-	remote-endpoint = <&tcon_tv0_out_tcon_top>;
-};
-
-&tcon_top_mixer0_out_tcon_tv0 {
-	remote-endpoint = <&tcon_tv0_in_tcon_top>;
-};
-
-&tcon_tv0_in {
-	tcon_tv0_in_tcon_top: endpoint {
-		remote-endpoint = <&tcon_top_mixer0_out_tcon_tv0>;
-	};
-};
-
-&tcon_tv0_out {
-	tcon_tv0_out_tcon_top: endpoint {
-		remote-endpoint = <&tcon_top_hdmi_in_tcon_tv0>;
-	};
-};
-
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pb_pins>;
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 6b4fe8eeee99..e5c7e4804384 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -601,10 +601,12 @@
 
 					tcon_top_mixer0_out_tcon_tv0: endpoint@2 {
 						reg = <2>;
+						remote-endpoint = <&tcon_tv0_in_tcon_top_mixer0>;
 					};
 
 					tcon_top_mixer0_out_tcon_tv1: endpoint@3 {
 						reg = <3>;
+						remote-endpoint = <&tcon_tv1_in_tcon_top_mixer0>;
 					};
 				};
 
@@ -634,10 +636,12 @@
 
 					tcon_top_mixer1_out_tcon_tv0: endpoint@2 {
 						reg = <2>;
+						remote-endpoint = <&tcon_tv0_in_tcon_top_mixer1>;
 					};
 
 					tcon_top_mixer1_out_tcon_tv1: endpoint@3 {
 						reg = <3>;
+						remote-endpoint = <&tcon_tv1_in_tcon_top_mixer1>;
 					};
 				};
 
@@ -648,10 +652,12 @@
 
 					tcon_top_hdmi_in_tcon_tv0: endpoint@0 {
 						reg = <0>;
+						remote-endpoint = <&tcon_tv0_out_tcon_top>;
 					};
 
 					tcon_top_hdmi_in_tcon_tv1: endpoint@1 {
 						reg = <1>;
+						remote-endpoint = <&tcon_tv1_out_tcon_top>;
 					};
 				};
 
@@ -679,11 +685,30 @@
 				#size-cells = <0>;
 
 				tcon_tv0_in: port@0 {
+					#address-cells = <1>;
+					#size-cells = <0>;
 					reg = <0>;
+
+					tcon_tv0_in_tcon_top_mixer0: endpoint@0 {
+						reg = <0>;
+						remote-endpoint = <&tcon_top_mixer0_out_tcon_tv0>;
+					};
+
+					tcon_tv0_in_tcon_top_mixer1: endpoint@1 {
+						reg = <1>;
+						remote-endpoint = <&tcon_top_mixer1_out_tcon_tv0>;
+					};
 				};
 
 				tcon_tv0_out: port@1 {
+					#address-cells = <1>;
+					#size-cells = <0>;
 					reg = <1>;
+
+					tcon_tv0_out_tcon_top: endpoint@1 {
+						reg = <1>;
+						remote-endpoint = <&tcon_top_hdmi_in_tcon_tv0>;
+					};
 				};
 			};
 		};
@@ -702,11 +727,30 @@
 				#size-cells = <0>;
 
 				tcon_tv1_in: port@0 {
+					#address-cells = <1>;
+					#size-cells = <0>;
 					reg = <0>;
+
+					tcon_tv1_in_tcon_top_mixer0: endpoint@0 {
+						reg = <0>;
+						remote-endpoint = <&tcon_top_mixer0_out_tcon_tv1>;
+					};
+
+					tcon_tv1_in_tcon_top_mixer1: endpoint@1 {
+						reg = <1>;
+						remote-endpoint = <&tcon_top_mixer1_out_tcon_tv1>;
+					};
 				};
 
 				tcon_tv1_out: port@1 {
+					#address-cells = <1>;
+					#size-cells = <0>;
 					reg = <1>;
+
+					tcon_tv1_out_tcon_top: endpoint@1 {
+						reg = <1>;
+						remote-endpoint = <&tcon_top_hdmi_in_tcon_tv1>;
+					};
 				};
 			};
 		};
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 16/18] ARM: dts: sun8i: r40: Disable TCONs by default.
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (14 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 15/18] ARM: dts: sun8i: r40: Add missing TCON-TOP - TCON connections Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-10 20:35 ` [PATCH v2 17/18] drm/sun4i: tcon-top: Remove mux configuration at probe time Jernej Skrabec
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

R40 has 4 TCONs, but only 2 of them can receive some kind of output at
the same time. Let's disable them by default, so only those which are
really connected on board can be enabled in board dts file.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 4 ++++
 arch/arm/boot/dts/sun8i-r40.dtsi                  | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
index 737cf01b1acd..c39b9169ea64 100644
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -251,6 +251,10 @@
 	regulator-name = "vcc-wifi";
 };
 
+&tcon_tv0 {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pb_pins>;
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index e5c7e4804384..e2cbd4f645c5 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -679,6 +679,7 @@
 			clock-names = "ahb", "tcon-ch1";
 			resets = <&ccu RST_BUS_TCON_TV0>;
 			reset-names = "lcd";
+			status = "disabled";
 
 			ports {
 				#address-cells = <1>;
@@ -721,6 +722,7 @@
 			clock-names = "ahb", "tcon-ch1";
 			resets = <&ccu RST_BUS_TCON_TV1>;
 			reset-names = "lcd";
+			status = "disabled";
 
 			ports {
 				#address-cells = <1>;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 17/18] drm/sun4i: tcon-top: Remove mux configuration at probe time
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (15 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 16/18] ARM: dts: sun8i: r40: Disable TCONs by default Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-11  3:15   ` Chen-Yu Tsai
  2018-07-10 20:35 ` [PATCH v2 18/18] dt-bindings: display: sun4i-drm: Fix order of DW HDMI PHY compatibles Jernej Skrabec
  2018-07-11  8:30 ` [PATCH v2 00/18] Allwinner R40 HDMI refactoring Maxime Ripard
  18 siblings, 1 reply; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

Now that R40 TCON migrated to runtime mux configuration, old code can be
removed.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 76 +-------------------------
 1 file changed, 1 insertion(+), 75 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
index c09b15b64192..b7cf0f0f6583 100644
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
@@ -87,34 +87,6 @@ int sun8i_tcon_top_de_config(struct device *dev, int mixer, int tcon)
 }
 EXPORT_SYMBOL(sun8i_tcon_top_de_config);
 
-static int sun8i_tcon_top_get_connected_ep_id(struct device_node *node,
-					      int port_id)
-{
-	struct device_node *ep, *remote, *port;
-	struct of_endpoint endpoint;
-
-	port = of_graph_get_port_by_id(node, port_id);
-	if (!port)
-		return -ENOENT;
-
-	for_each_available_child_of_node(port, ep) {
-		remote = of_graph_get_remote_port_parent(ep);
-		if (!remote)
-			continue;
-
-		if (of_device_is_available(remote)) {
-			of_graph_parse_endpoint(ep, &endpoint);
-
-			of_node_put(remote);
-
-			return endpoint.id;
-		}
-
-		of_node_put(remote);
-	}
-
-	return -ENOENT;
-}
 
 static struct clk_hw *sun8i_tcon_top_register_gate(struct device *dev,
 						   const char *parent,
@@ -149,11 +121,9 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
 	struct platform_device *pdev = to_platform_device(dev);
 	struct clk_hw_onecell_data *clk_data;
 	struct sun8i_tcon_top *tcon_top;
-	bool mixer0_unused = false;
 	struct resource *res;
 	void __iomem *regs;
-	int ret, i, id;
-	u32 val;
+	int ret, i;
 
 	tcon_top = devm_kzalloc(dev, sizeof(*tcon_top), GFP_KERNEL);
 	if (!tcon_top)
@@ -198,50 +168,6 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
 		goto err_assert_reset;
 	}
 
-	val = 0;
-
-	/* check if HDMI mux output is connected */
-	if (sun8i_tcon_top_get_connected_ep_id(dev->of_node, 5) >= 0) {
-		/* find HDMI input endpoint id, if it is connected at all*/
-		id = sun8i_tcon_top_get_connected_ep_id(dev->of_node, 4);
-		if (id >= 0)
-			val = FIELD_PREP(TCON_TOP_HDMI_SRC_MSK, id + 1);
-		else
-			DRM_DEBUG_DRIVER("TCON TOP HDMI input is not connected\n");
-	} else {
-		DRM_DEBUG_DRIVER("TCON TOP HDMI output is not connected\n");
-	}
-
-	writel(val, regs + TCON_TOP_GATE_SRC_REG);
-
-	val = 0;
-
-	/* process mixer0 mux output */
-	id = sun8i_tcon_top_get_connected_ep_id(dev->of_node, 1);
-	if (id >= 0) {
-		val = FIELD_PREP(TCON_TOP_PORT_DE0_MSK, id);
-	} else {
-		DRM_DEBUG_DRIVER("TCON TOP mixer0 output is not connected\n");
-		mixer0_unused = true;
-	}
-
-	/* process mixer1 mux output */
-	id = sun8i_tcon_top_get_connected_ep_id(dev->of_node, 3);
-	if (id >= 0) {
-		val |= FIELD_PREP(TCON_TOP_PORT_DE1_MSK, id);
-
-		/*
-		 * mixer0 mux has priority over mixer1 mux. We have to
-		 * make sure mixer0 doesn't overtake TCON from mixer1.
-		 */
-		if (mixer0_unused && id == 0)
-			val |= FIELD_PREP(TCON_TOP_PORT_DE0_MSK, 1);
-	} else {
-		DRM_DEBUG_DRIVER("TCON TOP mixer1 output is not connected\n");
-	}
-
-	writel(val, regs + TCON_TOP_PORT_SEL_REG);
-
 	/*
 	 * TCON TOP has two muxes, which select parent clock for each TCON TV
 	 * channel clock. Parent could be either TCON TV or TVE clock. For now
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH v2 18/18] dt-bindings: display: sun4i-drm: Fix order of DW HDMI PHY compatibles
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (16 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 17/18] drm/sun4i: tcon-top: Remove mux configuration at probe time Jernej Skrabec
@ 2018-07-10 20:35 ` Jernej Skrabec
  2018-07-11  8:30 ` [PATCH v2 00/18] Allwinner R40 HDMI refactoring Maxime Ripard
  18 siblings, 0 replies; 40+ messages in thread
From: Jernej Skrabec @ 2018-07-10 20:35 UTC (permalink / raw)
  To: maxime.ripard, wens, robh+dt
  Cc: airlied, mark.rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi

They are currently sorted alphabetically. However, they should be sorted
by release date of the family and then alphabetically.

Fixes: 03c35dbf73e0 ("dt-bindings: display: sun4i-drm: Add description of A64 HDMI PHY")

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
index 7e2451396a28..f8773ecb7525 100644
--- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
+++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
@@ -101,9 +101,9 @@ DWC HDMI PHY
 
 Required properties:
   - compatible: value must be one of:
-    * allwinner,sun50i-a64-hdmi-phy
     * allwinner,sun8i-a83t-hdmi-phy
     * allwinner,sun8i-h3-hdmi-phy
+    * allwinner,sun50i-a64-hdmi-phy
   - reg: base address and size of memory-mapped region
   - clocks: phandles to the clocks feeding the HDMI PHY
     * bus: the HDMI PHY interface clock
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 04/18] drm/sun4i: tcon-top: Cleanup clock handling
  2018-07-10 20:34 ` [PATCH v2 04/18] drm/sun4i: tcon-top: Cleanup clock handling Jernej Skrabec
@ 2018-07-10 23:20   ` kbuild test robot
  2018-07-11  2:54     ` Chen-Yu Tsai
  0 siblings, 1 reply; 40+ messages in thread
From: kbuild test robot @ 2018-07-10 23:20 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: kbuild-all, maxime.ripard, wens, robh+dt, airlied, mark.rutland,
	dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 4047 bytes --]

Hi Jernej,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on next-20180710]
[cannot apply to sunxi/sunxi/for-next drm/drm-next robh/for-next v4.18-rc4 v4.18-rc3 v4.18-rc2 v4.18-rc4]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Jernej-Skrabec/Allwinner-R40-HDMI-refactoring/20180711-043932
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=arm64 

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:10:0,
                    from include/linux/list.h:9,
                    from include/linux/agp_backend.h:33,
                    from include/drm/drmP.h:35,
                    from drivers/gpu//drm/sun4i/sun8i_tcon_top.c:4:
   drivers/gpu//drm/sun4i/sun8i_tcon_top.c: In function 'sun8i_tcon_top_register_gate':
   include/linux/err.h:22:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
                                                    ^
   include/linux/compiler.h:77:42: note: in definition of macro 'unlikely'
    # define unlikely(x) __builtin_expect(!!(x), 0)
                                             ^
>> drivers/gpu//drm/sun4i/sun8i_tcon_top.c:56:6: note: in expansion of macro 'IS_ERR_VALUE'
     if (IS_ERR_VALUE(index))
         ^~~~~~~~~~~~

vim +/IS_ERR_VALUE +56 drivers/gpu//drm/sun4i/sun8i_tcon_top.c

     3	
   > 4	#include <drm/drmP.h>
     5	
     6	#include <dt-bindings/clock/sun8i-tcon-top.h>
     7	
     8	#include <linux/bitfield.h>
     9	#include <linux/component.h>
    10	#include <linux/device.h>
    11	#include <linux/module.h>
    12	#include <linux/of_graph.h>
    13	#include <linux/platform_device.h>
    14	
    15	#include "sun8i_tcon_top.h"
    16	
    17	static int sun8i_tcon_top_get_connected_ep_id(struct device_node *node,
    18						      int port_id)
    19	{
    20		struct device_node *ep, *remote, *port;
    21		struct of_endpoint endpoint;
    22	
    23		port = of_graph_get_port_by_id(node, port_id);
    24		if (!port)
    25			return -ENOENT;
    26	
    27		for_each_available_child_of_node(port, ep) {
    28			remote = of_graph_get_remote_port_parent(ep);
    29			if (!remote)
    30				continue;
    31	
    32			if (of_device_is_available(remote)) {
    33				of_graph_parse_endpoint(ep, &endpoint);
    34	
    35				of_node_put(remote);
    36	
    37				return endpoint.id;
    38			}
    39	
    40			of_node_put(remote);
    41		}
    42	
    43		return -ENOENT;
    44	}
    45	
    46	static struct clk_hw *sun8i_tcon_top_register_gate(struct device *dev,
    47							   const char *parent,
    48							   void __iomem *regs,
    49							   spinlock_t *lock,
    50							   u8 bit, int name_index)
    51	{
    52		const char *clk_name, *parent_name;
    53		int ret, index;
    54	
    55		index = of_property_match_string(dev->of_node, "clock-names", parent);
  > 56		if (IS_ERR_VALUE(index))
    57			return ERR_PTR(index);
    58	
    59		parent_name = of_clk_get_parent_name(dev->of_node, index);
    60	
    61		ret = of_property_read_string_index(dev->of_node,
    62						    "clock-output-names", name_index,
    63						    &clk_name);
    64		if (ret)
    65			return ERR_PTR(ret);
    66	
    67		return clk_hw_register_gate(dev, clk_name, parent_name,
    68					    CLK_SET_RATE_PARENT,
    69					    regs + TCON_TOP_GATE_SRC_REG,
    70					    bit, 0, lock);
    71	};
    72	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 60979 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 04/18] drm/sun4i: tcon-top: Cleanup clock handling
  2018-07-10 23:20   ` kbuild test robot
@ 2018-07-11  2:54     ` Chen-Yu Tsai
  0 siblings, 0 replies; 40+ messages in thread
From: Chen-Yu Tsai @ 2018-07-11  2:54 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: kbuild-all, Maxime Ripard, Rob Herring, David Airlie,
	Mark Rutland, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, kbuild test robot

On Wed, Jul 11, 2018 at 7:20 AM, kbuild test robot <lkp@intel.com> wrote:
> Hi Jernej,
>
> Thank you for the patch! Perhaps something to improve:
>
> [auto build test WARNING on next-20180710]
> [cannot apply to sunxi/sunxi/for-next drm/drm-next robh/for-next v4.18-rc4 v4.18-rc3 v4.18-rc2 v4.18-rc4]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url:    https://github.com/0day-ci/linux/commits/Jernej-Skrabec/Allwinner-R40-HDMI-refactoring/20180711-043932
> config: arm64-allyesconfig (attached as .config)
> compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         GCC_VERSION=7.2.0 make.cross ARCH=arm64
>
> All warnings (new ones prefixed by >>):
>
>    In file included from include/linux/kernel.h:10:0,
>                     from include/linux/list.h:9,
>                     from include/linux/agp_backend.h:33,
>                     from include/drm/drmP.h:35,
>                     from drivers/gpu//drm/sun4i/sun8i_tcon_top.c:4:
>    drivers/gpu//drm/sun4i/sun8i_tcon_top.c: In function 'sun8i_tcon_top_register_gate':
>    include/linux/err.h:22:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>     #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
>                                                     ^
>    include/linux/compiler.h:77:42: note: in definition of macro 'unlikely'
>     # define unlikely(x) __builtin_expect(!!(x), 0)
>                                              ^
>>> drivers/gpu//drm/sun4i/sun8i_tcon_top.c:56:6: note: in expansion of macro 'IS_ERR_VALUE'
>      if (IS_ERR_VALUE(index))
>          ^~~~~~~~~~~~
>
> vim +/IS_ERR_VALUE +56 drivers/gpu//drm/sun4i/sun8i_tcon_top.c
>
>      3
>    > 4  #include <drm/drmP.h>
>      5
>      6  #include <dt-bindings/clock/sun8i-tcon-top.h>
>      7
>      8  #include <linux/bitfield.h>
>      9  #include <linux/component.h>
>     10  #include <linux/device.h>
>     11  #include <linux/module.h>
>     12  #include <linux/of_graph.h>
>     13  #include <linux/platform_device.h>
>     14
>     15  #include "sun8i_tcon_top.h"
>     16
>     17  static int sun8i_tcon_top_get_connected_ep_id(struct device_node *node,
>     18                                                int port_id)
>     19  {
>     20          struct device_node *ep, *remote, *port;
>     21          struct of_endpoint endpoint;
>     22
>     23          port = of_graph_get_port_by_id(node, port_id);
>     24          if (!port)
>     25                  return -ENOENT;
>     26
>     27          for_each_available_child_of_node(port, ep) {
>     28                  remote = of_graph_get_remote_port_parent(ep);
>     29                  if (!remote)
>     30                          continue;
>     31
>     32                  if (of_device_is_available(remote)) {
>     33                          of_graph_parse_endpoint(ep, &endpoint);
>     34
>     35                          of_node_put(remote);
>     36
>     37                          return endpoint.id;
>     38                  }
>     39
>     40                  of_node_put(remote);
>     41          }
>     42
>     43          return -ENOENT;
>     44  }
>     45
>     46  static struct clk_hw *sun8i_tcon_top_register_gate(struct device *dev,
>     47                                                     const char *parent,
>     48                                                     void __iomem *regs,
>     49                                                     spinlock_t *lock,
>     50                                                     u8 bit, int name_index)
>     51  {
>     52          const char *clk_name, *parent_name;
>     53          int ret, index;
>     54
>     55          index = of_property_match_string(dev->of_node, "clock-names", parent);
>   > 56          if (IS_ERR_VALUE(index))

Yeah. This is incorrect usage. IS_ERR_VALUE should be used on pointers.
Checking for a negative value here should suffice.

ChenYu

>     57                  return ERR_PTR(index);
>     58
>     59          parent_name = of_clk_get_parent_name(dev->of_node, index);
>     60
>     61          ret = of_property_read_string_index(dev->of_node,
>     62                                              "clock-output-names", name_index,
>     63                                              &clk_name);
>     64          if (ret)
>     65                  return ERR_PTR(ret);
>     66
>     67          return clk_hw_register_gate(dev, clk_name, parent_name,
>     68                                      CLK_SET_RATE_PARENT,
>     69                                      regs + TCON_TOP_GATE_SRC_REG,
>     70                                      bit, 0, lock);
>     71  };
>     72
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 08/18] ARM: dts: sun8i: r40: Add mixer ids to TCON TOP
  2018-07-10 20:35 ` [PATCH v2 08/18] ARM: dts: sun8i: r40: Add mixer ids to TCON TOP Jernej Skrabec
@ 2018-07-11  2:55   ` Chen-Yu Tsai
  0 siblings, 0 replies; 40+ messages in thread
From: Chen-Yu Tsai @ 2018-07-11  2:55 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: Maxime Ripard, Rob Herring, David Airlie, Mark Rutland,
	dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi

On Wed, Jul 11, 2018 at 4:35 AM, Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> sun4i-drm DT binding, second paragraph of the first section says:
>
> For all connections between components up to the TCONs in the display
> pipeline, when there are multiple components of the same type at the
> same depth, the local endpoint ID must be the same as the remote
> component's index.
>
> Add mixer ids in R40 DT as mandated by DT binding.
>
> Fixes: 05a43a262d03 ("ARM: dts: sun8i: r40: Add HDMI pipeline")
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>

Reviewed-by: Chen-Yu Tsai <wens@csie.org>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 09/18] drm/sun4i: mixer: Order includes alphabetically
  2018-07-10 20:35 ` [PATCH v2 09/18] drm/sun4i: mixer: Order includes alphabetically Jernej Skrabec
@ 2018-07-11  2:56   ` Chen-Yu Tsai
  0 siblings, 0 replies; 40+ messages in thread
From: Chen-Yu Tsai @ 2018-07-11  2:56 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: Maxime Ripard, Rob Herring, David Airlie, Mark Rutland,
	dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi

On Wed, Jul 11, 2018 at 4:35 AM, Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> Includes are not alphabetically ordered.
>
> Reorder them.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>

Reviewed-by: Chen-Yu Tsai <wens@csie.org>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 10/18] drm/sun4i: mixer: Read id from DT
  2018-07-10 20:35 ` [PATCH v2 10/18] drm/sun4i: mixer: Read id from DT Jernej Skrabec
@ 2018-07-11  3:11   ` Chen-Yu Tsai
  2018-07-11  7:10     ` Jernej Škrabec
  0 siblings, 1 reply; 40+ messages in thread
From: Chen-Yu Tsai @ 2018-07-11  3:11 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: Maxime Ripard, Rob Herring, David Airlie, Mark Rutland,
	dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi

On Wed, Jul 11, 2018 at 4:35 AM, Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> Currently, TCON supports 2 ways to match TCON with engine (mixer in this
> case). Old way is to just traverse of graph backwards and compare node
> pointer. New way is to match TCON and engine by their respective ids.
> All SoCs with DE2 enabled till now used the old way, which means mixer
> id was never used and thus never implemented.
>
> However, for R40, only the new way will be used. To prepare for that,
> implement mixer id fetching from DT.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> ---
>  drivers/gpu/drm/sun4i/sun8i_mixer.c | 40 +++++++++++++++++++++++++++--
>  1 file changed, 38 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> index aa81b9838ae8..4bd4d8ccb34f 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> @@ -22,6 +22,7 @@
>  #include <linux/component.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/of_device.h>
> +#include <linux/of_graph.h>
>  #include <linux/reset.h>
>
>  #include "sun4i_drv.h"
> @@ -322,6 +323,42 @@ static struct regmap_config sun8i_mixer_regmap_config = {
>         .max_register   = 0xbfffc, /* guessed */
>  };
>
> +static int sun8i_mixer_of_get_id(struct device_node *node)
> +{
> +       struct device_node *port, *ep;
> +       int ret = -EINVAL;
> +
> +       /* output is port 1 */
> +       port = of_graph_get_port_by_id(node, 1);
> +       if (!port)
> +               return -EINVAL;
> +
> +       /* try to find downstream endpoint */
> +       for_each_available_child_of_node(port, ep) {
> +               struct device_node *remote;
> +               u32 reg;
> +
> +               remote = of_graph_get_remote_endpoint(ep);
> +               if (!remote)
> +                       continue;
> +
> +               ret = of_property_read_u32(remote, "reg", &reg);
> +               if (!ret) {
> +                       of_node_put(remote);
> +                       of_node_put(ep);
> +                       of_node_put(port);
> +
> +                       return reg;
> +               }
> +
> +               of_node_put(remote);
> +       }
> +
> +       of_node_put(port);
> +
> +       return ret;
> +}
> +

The above looks good.

>  static int sun8i_mixer_bind(struct device *dev, struct device *master,
>                               void *data)
>  {
> @@ -353,8 +390,7 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master,
>         dev_set_drvdata(dev, mixer);
>         mixer->engine.ops = &sun8i_engine_ops;
>         mixer->engine.node = dev->of_node;
> -       /* The ID of the mixer currently doesn't matter */
> -       mixer->engine.id = -1;
> +       mixer->engine.id = sun8i_mixer_of_get_id(dev->of_node);

Should you be handling error codes?

ChenYu

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 17/18] drm/sun4i: tcon-top: Remove mux configuration at probe time
  2018-07-10 20:35 ` [PATCH v2 17/18] drm/sun4i: tcon-top: Remove mux configuration at probe time Jernej Skrabec
@ 2018-07-11  3:15   ` Chen-Yu Tsai
  0 siblings, 0 replies; 40+ messages in thread
From: Chen-Yu Tsai @ 2018-07-11  3:15 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: Maxime Ripard, Rob Herring, David Airlie, Mark Rutland,
	dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi

On Wed, Jul 11, 2018 at 4:35 AM, Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> Now that R40 TCON migrated to runtime mux configuration, old code can be
> removed.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>

Reviewed-by: Chen-Yu Tsai <wens@csie.org>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 10/18] drm/sun4i: mixer: Read id from DT
  2018-07-11  3:11   ` Chen-Yu Tsai
@ 2018-07-11  7:10     ` Jernej Škrabec
  2018-07-11  7:11       ` Chen-Yu Tsai
  0 siblings, 1 reply; 40+ messages in thread
From: Jernej Škrabec @ 2018-07-11  7:10 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Maxime Ripard, Rob Herring, David Airlie, Mark Rutland,
	dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi

Dne sreda, 11. julij 2018 ob 05:11:56 CEST je Chen-Yu Tsai napisal(a):
> On Wed, Jul 11, 2018 at 4:35 AM, Jernej Skrabec <jernej.skrabec@siol.net> 
wrote:
> > Currently, TCON supports 2 ways to match TCON with engine (mixer in this
> > case). Old way is to just traverse of graph backwards and compare node
> > pointer. New way is to match TCON and engine by their respective ids.
> > All SoCs with DE2 enabled till now used the old way, which means mixer
> > id was never used and thus never implemented.
> > 
> > However, for R40, only the new way will be used. To prepare for that,
> > implement mixer id fetching from DT.
> > 
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> > ---
> > 
> >  drivers/gpu/drm/sun4i/sun8i_mixer.c | 40 +++++++++++++++++++++++++++--
> >  1 file changed, 38 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> > b/drivers/gpu/drm/sun4i/sun8i_mixer.c index aa81b9838ae8..4bd4d8ccb34f
> > 100644
> > --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> > +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> > @@ -22,6 +22,7 @@
> > 
> >  #include <linux/component.h>
> >  #include <linux/dma-mapping.h>
> >  #include <linux/of_device.h>
> > 
> > +#include <linux/of_graph.h>
> > 
> >  #include <linux/reset.h>
> >  
> >  #include "sun4i_drv.h"
> > 
> > @@ -322,6 +323,42 @@ static struct regmap_config sun8i_mixer_regmap_config
> > = {> 
> >         .max_register   = 0xbfffc, /* guessed */
> >  
> >  };
> > 
> > +static int sun8i_mixer_of_get_id(struct device_node *node)
> > +{
> > +       struct device_node *port, *ep;
> > +       int ret = -EINVAL;
> > +
> > +       /* output is port 1 */
> > +       port = of_graph_get_port_by_id(node, 1);
> > +       if (!port)
> > +               return -EINVAL;
> > +
> > +       /* try to find downstream endpoint */
> > +       for_each_available_child_of_node(port, ep) {
> > +               struct device_node *remote;
> > +               u32 reg;
> > +
> > +               remote = of_graph_get_remote_endpoint(ep);
> > +               if (!remote)
> > +                       continue;
> > +
> > +               ret = of_property_read_u32(remote, "reg", &reg);
> > +               if (!ret) {
> > +                       of_node_put(remote);
> > +                       of_node_put(ep);
> > +                       of_node_put(port);
> > +
> > +                       return reg;
> > +               }
> > +
> > +               of_node_put(remote);
> > +       }
> > +
> > +       of_node_put(port);
> > +
> > +       return ret;
> > +}
> > +
> 
> The above looks good.
> 
> >  static int sun8i_mixer_bind(struct device *dev, struct device *master,
> >  
> >                               void *data)
> >  
> >  {
> > 
> > @@ -353,8 +390,7 @@ static int sun8i_mixer_bind(struct device *dev, struct
> > device *master,> 
> >         dev_set_drvdata(dev, mixer);
> >         mixer->engine.ops = &sun8i_engine_ops;
> >         mixer->engine.node = dev->of_node;
> > 
> > -       /* The ID of the mixer currently doesn't matter */
> > -       mixer->engine.id = -1;
> > +       mixer->engine.id = sun8i_mixer_of_get_id(dev->of_node);
> 
> Should you be handling error codes?

Sadly, no. Other supported DE2 SoC miss reg property in DT and it would break 
them. Additionally, V3s has only one mixer and thus technically doesn't 
violate binding with omiting mixer id.

Anyway, it was -1 all the time before and not really used, so having negative 
value doesn't change anything for other SoCs. If this fails and it's needed, 
it would stop at mixer <-> TCON matching stage anyway.

I guess I should add comment for that.

Best regards,
Jernej




^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 10/18] drm/sun4i: mixer: Read id from DT
  2018-07-11  7:10     ` Jernej Škrabec
@ 2018-07-11  7:11       ` Chen-Yu Tsai
  0 siblings, 0 replies; 40+ messages in thread
From: Chen-Yu Tsai @ 2018-07-11  7:11 UTC (permalink / raw)
  To: Jernej Škrabec
  Cc: Maxime Ripard, Rob Herring, David Airlie, Mark Rutland,
	dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi

On Wed, Jul 11, 2018 at 3:10 PM, Jernej Škrabec <jernej.skrabec@siol.net> wrote:
> Dne sreda, 11. julij 2018 ob 05:11:56 CEST je Chen-Yu Tsai napisal(a):
>> On Wed, Jul 11, 2018 at 4:35 AM, Jernej Skrabec <jernej.skrabec@siol.net>
> wrote:
>> > Currently, TCON supports 2 ways to match TCON with engine (mixer in this
>> > case). Old way is to just traverse of graph backwards and compare node
>> > pointer. New way is to match TCON and engine by their respective ids.
>> > All SoCs with DE2 enabled till now used the old way, which means mixer
>> > id was never used and thus never implemented.
>> >
>> > However, for R40, only the new way will be used. To prepare for that,
>> > implement mixer id fetching from DT.
>> >
>> > Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
>> > ---
>> >
>> >  drivers/gpu/drm/sun4i/sun8i_mixer.c | 40 +++++++++++++++++++++++++++--
>> >  1 file changed, 38 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c
>> > b/drivers/gpu/drm/sun4i/sun8i_mixer.c index aa81b9838ae8..4bd4d8ccb34f
>> > 100644
>> > --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
>> > +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
>> > @@ -22,6 +22,7 @@
>> >
>> >  #include <linux/component.h>
>> >  #include <linux/dma-mapping.h>
>> >  #include <linux/of_device.h>
>> >
>> > +#include <linux/of_graph.h>
>> >
>> >  #include <linux/reset.h>
>> >
>> >  #include "sun4i_drv.h"
>> >
>> > @@ -322,6 +323,42 @@ static struct regmap_config sun8i_mixer_regmap_config
>> > = {>
>> >         .max_register   = 0xbfffc, /* guessed */
>> >
>> >  };
>> >
>> > +static int sun8i_mixer_of_get_id(struct device_node *node)
>> > +{
>> > +       struct device_node *port, *ep;
>> > +       int ret = -EINVAL;
>> > +
>> > +       /* output is port 1 */
>> > +       port = of_graph_get_port_by_id(node, 1);
>> > +       if (!port)
>> > +               return -EINVAL;
>> > +
>> > +       /* try to find downstream endpoint */
>> > +       for_each_available_child_of_node(port, ep) {
>> > +               struct device_node *remote;
>> > +               u32 reg;
>> > +
>> > +               remote = of_graph_get_remote_endpoint(ep);
>> > +               if (!remote)
>> > +                       continue;
>> > +
>> > +               ret = of_property_read_u32(remote, "reg", &reg);
>> > +               if (!ret) {
>> > +                       of_node_put(remote);
>> > +                       of_node_put(ep);
>> > +                       of_node_put(port);
>> > +
>> > +                       return reg;
>> > +               }
>> > +
>> > +               of_node_put(remote);
>> > +       }
>> > +
>> > +       of_node_put(port);
>> > +
>> > +       return ret;
>> > +}
>> > +
>>
>> The above looks good.
>>
>> >  static int sun8i_mixer_bind(struct device *dev, struct device *master,
>> >
>> >                               void *data)
>> >
>> >  {
>> >
>> > @@ -353,8 +390,7 @@ static int sun8i_mixer_bind(struct device *dev, struct
>> > device *master,>
>> >         dev_set_drvdata(dev, mixer);
>> >         mixer->engine.ops = &sun8i_engine_ops;
>> >         mixer->engine.node = dev->of_node;
>> >
>> > -       /* The ID of the mixer currently doesn't matter */
>> > -       mixer->engine.id = -1;
>> > +       mixer->engine.id = sun8i_mixer_of_get_id(dev->of_node);
>>
>> Should you be handling error codes?
>
> Sadly, no. Other supported DE2 SoC miss reg property in DT and it would break
> them. Additionally, V3s has only one mixer and thus technically doesn't
> violate binding with omiting mixer id.
>
> Anyway, it was -1 all the time before and not really used, so having negative
> value doesn't change anything for other SoCs. If this fails and it's needed,
> it would stop at mixer <-> TCON matching stage anyway.
>
> I guess I should add comment for that.

Yes. Please. We'll leave the rest till later. I plan to fix up the missing
IDs for all the other SoCs anyway.

ChenYu

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
                   ` (17 preceding siblings ...)
  2018-07-10 20:35 ` [PATCH v2 18/18] dt-bindings: display: sun4i-drm: Fix order of DW HDMI PHY compatibles Jernej Skrabec
@ 2018-07-11  8:30 ` Maxime Ripard
  2018-07-11  8:37   ` Chen-Yu Tsai
                     ` (2 more replies)
  18 siblings, 3 replies; 40+ messages in thread
From: Maxime Ripard @ 2018-07-11  8:30 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: wens, robh+dt, airlied, mark.rutland, dri-devel, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
> This series fixes several issues found in R40 HDMI patch series after
> it was applied. Conversation can be found here:
> http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.html
> 
> Patches are based on latest linux-next (next-20180710) and are ordered
> in such way that they don't break R40 HDMI at any time. Because of that
> I suggest that whole series goes through drm-misc to preserve that order.
> 
> I also tested those patches on H3 to make sure it doesn't break other
> platforms. However, it would be nice to test for regressions also on
> older SoCs (with DE1).
> 
> Best regards,
> Jernej

Applied all patches but the patch 10, thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-11  8:30 ` [PATCH v2 00/18] Allwinner R40 HDMI refactoring Maxime Ripard
@ 2018-07-11  8:37   ` Chen-Yu Tsai
  2018-07-11  8:41   ` Jernej Škrabec
  2018-07-22 14:43   ` Jernej Škrabec
  2 siblings, 0 replies; 40+ messages in thread
From: Chen-Yu Tsai @ 2018-07-11  8:37 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Jernej Skrabec, Rob Herring, David Airlie, Mark Rutland,
	dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi

On Wed, Jul 11, 2018 at 4:30 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
>> This series fixes several issues found in R40 HDMI patch series after
>> it was applied. Conversation can be found here:
>> http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.html
>>
>> Patches are based on latest linux-next (next-20180710) and are ordered
>> in such way that they don't break R40 HDMI at any time. Because of that
>> I suggest that whole series goes through drm-misc to preserve that order.
>>
>> I also tested those patches on H3 to make sure it doesn't break other
>> platforms. However, it would be nice to test for regressions also on
>> older SoCs (with DE1).
>>
>> Best regards,
>> Jernej
>
> Applied all patches but the patch 10, thanks!

Patch 4 actually has an error. Hope you haven't pushed it out yet.

ChenYu

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-11  8:30 ` [PATCH v2 00/18] Allwinner R40 HDMI refactoring Maxime Ripard
  2018-07-11  8:37   ` Chen-Yu Tsai
@ 2018-07-11  8:41   ` Jernej Škrabec
  2018-07-11  9:30     ` Maxime Ripard
  2018-07-22 14:43   ` Jernej Škrabec
  2 siblings, 1 reply; 40+ messages in thread
From: Jernej Škrabec @ 2018-07-11  8:41 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: wens, robh+dt, airlied, mark.rutland, dri-devel, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi

Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard napisal(a):
> On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
> > This series fixes several issues found in R40 HDMI patch series after
> > it was applied. Conversation can be found here:
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.htm
> > l
> > 
> > Patches are based on latest linux-next (next-20180710) and are ordered
> > in such way that they don't break R40 HDMI at any time. Because of that
> > I suggest that whole series goes through drm-misc to preserve that order.
> > 
> > I also tested those patches on H3 to make sure it doesn't break other
> > platforms. However, it would be nice to test for regressions also on
> > older SoCs (with DE1).
> > 
> > Best regards,
> > Jernej
> 
> Applied all patches but the patch 10, thanks!
> Maxime

Ok, I'll send patch 10 separately. However,  patch 4 needs a fix according to 
test build robot:

if (IS_ERR_VALUE(index))
should be:
if (index < 0)

Additionally, due to Arnds patch merged (drm/sun4i: fix build failure with 
CONFIG_DRM_SUN8I_MIXER=m), sun4i_tcon.c needs additional handling if TCON_TOP 
driver is not build.

Best regards,
Jernej




^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-11  8:41   ` Jernej Škrabec
@ 2018-07-11  9:30     ` Maxime Ripard
  2018-07-11  9:34       ` [linux-sunxi] " Jernej Škrabec
  0 siblings, 1 reply; 40+ messages in thread
From: Maxime Ripard @ 2018-07-11  9:30 UTC (permalink / raw)
  To: Jernej Škrabec
  Cc: wens, robh+dt, airlied, mark.rutland, dri-devel, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1606 bytes --]

On Wed, Jul 11, 2018 at 10:41:54AM +0200, Jernej Škrabec wrote:
> Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard napisal(a):
> > On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
> > > This series fixes several issues found in R40 HDMI patch series after
> > > it was applied. Conversation can be found here:
> > > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.htm
> > > l
> > > 
> > > Patches are based on latest linux-next (next-20180710) and are ordered
> > > in such way that they don't break R40 HDMI at any time. Because of that
> > > I suggest that whole series goes through drm-misc to preserve that order.
> > > 
> > > I also tested those patches on H3 to make sure it doesn't break other
> > > platforms. However, it would be nice to test for regressions also on
> > > older SoCs (with DE1).
> > > 
> > > Best regards,
> > > Jernej
> > 
> > Applied all patches but the patch 10, thanks!
> > Maxime
> 
> Ok, I'll send patch 10 separately. However,  patch 4 needs a fix according to 
> test build robot:
> 
> if (IS_ERR_VALUE(index))
> should be:
> if (index < 0)

Yeah, sorry, I forgot to say it, but I fixed it locally (and the
return below as well).

> Additionally, due to Arnds patch merged (drm/sun4i: fix build failure with 
> CONFIG_DRM_SUN8I_MIXER=m), sun4i_tcon.c needs additional handling if TCON_TOP 
> driver is not build.

I'll drop it then, I haven't pushed it yet.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [linux-sunxi] Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-11  9:30     ` Maxime Ripard
@ 2018-07-11  9:34       ` Jernej Škrabec
  2018-07-11 13:36         ` Maxime Ripard
  0 siblings, 1 reply; 40+ messages in thread
From: Jernej Škrabec @ 2018-07-11  9:34 UTC (permalink / raw)
  To: linux-sunxi, maxime.ripard
  Cc: wens, robh+dt, airlied, mark.rutland, dri-devel, devicetree,
	linux-arm-kernel, linux-kernel

Dne sreda, 11. julij 2018 ob 11:30:16 CEST je Maxime Ripard napisal(a):
> On Wed, Jul 11, 2018 at 10:41:54AM +0200, Jernej Škrabec wrote:
> > Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard napisal(a):
> > > On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
> > > > This series fixes several issues found in R40 HDMI patch series after
> > > > it was applied. Conversation can be found here:
> > > > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011
> > > > .htm
> > > > l
> > > > 
> > > > Patches are based on latest linux-next (next-20180710) and are ordered
> > > > in such way that they don't break R40 HDMI at any time. Because of
> > > > that
> > > > I suggest that whole series goes through drm-misc to preserve that
> > > > order.
> > > > 
> > > > I also tested those patches on H3 to make sure it doesn't break other
> > > > platforms. However, it would be nice to test for regressions also on
> > > > older SoCs (with DE1).
> > > > 
> > > > Best regards,
> > > > Jernej
> > > 
> > > Applied all patches but the patch 10, thanks!
> > > Maxime
> > 
> > Ok, I'll send patch 10 separately. However,  patch 4 needs a fix according
> > to test build robot:
> > 
> > if (IS_ERR_VALUE(index))
> > should be:
> > if (index < 0)
> 
> Yeah, sorry, I forgot to say it, but I fixed it locally (and the
> return below as well).
> 
> > Additionally, due to Arnds patch merged (drm/sun4i: fix build failure with
> > CONFIG_DRM_SUN8I_MIXER=m), sun4i_tcon.c needs additional handling if
> > TCON_TOP driver is not build.
> 
> I'll drop it then, I haven't pushed it yet.

Which one? This series or patch from Arnd?

Best regards,
Jernej




^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [linux-sunxi] Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-11  9:34       ` [linux-sunxi] " Jernej Škrabec
@ 2018-07-11 13:36         ` Maxime Ripard
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Ripard @ 2018-07-11 13:36 UTC (permalink / raw)
  To: Jernej Škrabec
  Cc: linux-sunxi, wens, robh+dt, airlied, mark.rutland, dri-devel,
	devicetree, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1986 bytes --]

On Wed, Jul 11, 2018 at 11:34:58AM +0200, Jernej Škrabec wrote:
> Dne sreda, 11. julij 2018 ob 11:30:16 CEST je Maxime Ripard napisal(a):
> > On Wed, Jul 11, 2018 at 10:41:54AM +0200, Jernej Škrabec wrote:
> > > Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard napisal(a):
> > > > On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
> > > > > This series fixes several issues found in R40 HDMI patch series after
> > > > > it was applied. Conversation can be found here:
> > > > > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011
> > > > > .htm
> > > > > l
> > > > > 
> > > > > Patches are based on latest linux-next (next-20180710) and are ordered
> > > > > in such way that they don't break R40 HDMI at any time. Because of
> > > > > that
> > > > > I suggest that whole series goes through drm-misc to preserve that
> > > > > order.
> > > > > 
> > > > > I also tested those patches on H3 to make sure it doesn't break other
> > > > > platforms. However, it would be nice to test for regressions also on
> > > > > older SoCs (with DE1).
> > > > > 
> > > > > Best regards,
> > > > > Jernej
> > > > 
> > > > Applied all patches but the patch 10, thanks!
> > > > Maxime
> > > 
> > > Ok, I'll send patch 10 separately. However,  patch 4 needs a fix according
> > > to test build robot:
> > > 
> > > if (IS_ERR_VALUE(index))
> > > should be:
> > > if (index < 0)
> > 
> > Yeah, sorry, I forgot to say it, but I fixed it locally (and the
> > return below as well).
> > 
> > > Additionally, due to Arnds patch merged (drm/sun4i: fix build failure with
> > > CONFIG_DRM_SUN8I_MIXER=m), sun4i_tcon.c needs additional handling if
> > > TCON_TOP driver is not build.
> > 
> > I'll drop it then, I haven't pushed it yet.
> 
> Which one? This series or patch from Arnd?

Arnd's

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-11  8:30 ` [PATCH v2 00/18] Allwinner R40 HDMI refactoring Maxime Ripard
  2018-07-11  8:37   ` Chen-Yu Tsai
  2018-07-11  8:41   ` Jernej Škrabec
@ 2018-07-22 14:43   ` Jernej Škrabec
  2018-07-24 12:37     ` Maxime Ripard
  2 siblings, 1 reply; 40+ messages in thread
From: Jernej Škrabec @ 2018-07-22 14:43 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: wens, robh+dt, airlied, mark.rutland, dri-devel, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi

Hi Maxime,

Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard napisal(a):
> On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
> > This series fixes several issues found in R40 HDMI patch series after
> > it was applied. Conversation can be found here:
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.htm
> > l
> > 
> > Patches are based on latest linux-next (next-20180710) and are ordered
> > in such way that they don't break R40 HDMI at any time. Because of that
> > I suggest that whole series goes through drm-misc to preserve that order.
> > 
> > I also tested those patches on H3 to make sure it doesn't break other
> > platforms. However, it would be nice to test for regressions also on
> > older SoCs (with DE1).
> > 
> > Best regards,
> > Jernej
> 
> Applied all patches but the patch 10, thanks!
> Maxime

It seems that you forgot to merge some patches:

[PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching mixers with 
tcon
[PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON

Without them, R40 display pipeline can't work.

Maybe they are in your spam folder?

Best regards,
Jernej



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-22 14:43   ` Jernej Škrabec
@ 2018-07-24 12:37     ` Maxime Ripard
  2018-07-24 16:04       ` Icenowy Zheng
  2018-08-14  5:43       ` Icenowy Zheng
  0 siblings, 2 replies; 40+ messages in thread
From: Maxime Ripard @ 2018-07-24 12:37 UTC (permalink / raw)
  To: Jernej Škrabec
  Cc: wens, robh+dt, airlied, mark.rutland, dri-devel, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1522 bytes --]

On Sun, Jul 22, 2018 at 04:43:56PM +0200, Jernej Škrabec wrote:
> Hi Maxime,
> 
> Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard napisal(a):
> > On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
> > > This series fixes several issues found in R40 HDMI patch series after
> > > it was applied. Conversation can be found here:
> > > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.htm
> > > l
> > > 
> > > Patches are based on latest linux-next (next-20180710) and are ordered
> > > in such way that they don't break R40 HDMI at any time. Because of that
> > > I suggest that whole series goes through drm-misc to preserve that order.
> > > 
> > > I also tested those patches on H3 to make sure it doesn't break other
> > > platforms. However, it would be nice to test for regressions also on
> > > older SoCs (with DE1).
> > > 
> > > Best regards,
> > > Jernej
> > 
> > Applied all patches but the patch 10, thanks!
> > Maxime
> 
> It seems that you forgot to merge some patches:
> 
> [PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching mixers with 
> tcon
> [PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON
> 
> Without them, R40 display pipeline can't work.
> 
> Maybe they are in your spam folder?

Thanks for telling me, I'm not quite sure what happened.

I've applied them.

Sorry,
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-24 12:37     ` Maxime Ripard
@ 2018-07-24 16:04       ` Icenowy Zheng
  2018-07-24 17:20         ` [linux-sunxi] " Jernej Škrabec
  2018-08-14  5:43       ` Icenowy Zheng
  1 sibling, 1 reply; 40+ messages in thread
From: Icenowy Zheng @ 2018-07-24 16:04 UTC (permalink / raw)
  To: Maxime Ripard, Jernej �0�7krabec
  Cc: mark.rutland, devicetree, airlied, linux-sunxi, linux-kernel,
	dri-devel, wens, robh+dt, linux-arm-kernel

在 2018-07-24二的 14:37 +0200,Maxime Ripard写道:
> On Sun, Jul 22, 2018 at 04:43:56PM +0200, Jernej Škrabec wrote:
> > Hi Maxime,
> > 
> > Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard
> > napisal(a):
> > > On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
> > > > This series fixes several issues found in R40 HDMI patch series
> > > > after
> > > > it was applied. Conversation can be found here:
> > > > 
http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.htm
> > > > l
> > > > 
> > > > Patches are based on latest linux-next (next-20180710) and are
> > > > ordered
> > > > in such way that they don't break R40 HDMI at any time. Because
> > > > of that
> > > > I suggest that whole series goes through drm-misc to preserve
> > > > that order.
> > > > 
> > > > I also tested those patches on H3 to make sure it doesn't break
> > > > other
> > > > platforms. However, it would be nice to test for regressions
> > > > also on
> > > > older SoCs (with DE1).
> > > > 
> > > > Best regards,
> > > > Jernej
> > > 
> > > Applied all patches but the patch 10, thanks!
> > > Maxime
> > 
> > It seems that you forgot to merge some patches:
> > 
> > [PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching
> > mixers with 
> > tcon
> > [PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON
> > 
> > Without them, R40 display pipeline can't work.
> > 
> > Maybe they are in your spam folder?
> 
> Thanks for telling me, I'm not quite sure what happened.
> 
> I've applied them.

BTW without them the board cannot boot because of dead loop in
sun4i_drv_probe().

> 
> Sorry,
> Maxime
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [linux-sunxi] Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-24 16:04       ` Icenowy Zheng
@ 2018-07-24 17:20         ` Jernej Škrabec
  2018-07-24 17:23           ` Icenowy Zheng
  0 siblings, 1 reply; 40+ messages in thread
From: Jernej Škrabec @ 2018-07-24 17:20 UTC (permalink / raw)
  To: linux-sunxi, icenowy
  Cc: Maxime Ripard, mark.rutland, devicetree, airlied, linux-kernel,
	dri-devel, wens, robh+dt, linux-arm-kernel

Dne torek, 24. julij 2018 ob 18:04:49 CEST je Icenowy Zheng napisal(a):
> 在 2018-07-24二的 14:37 +0200,Maxime Ripard写道:
> 
> > On Sun, Jul 22, 2018 at 04:43:56PM +0200, Jernej Škrabec wrote:
> > > Hi Maxime,
> > > 
> > > Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard
> > > 
> > > napisal(a):
> > > > On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
> > > > > This series fixes several issues found in R40 HDMI patch series
> > > > > after
> 
> > > > > it was applied. Conversation can be found here:
> http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.htm
> 
> > > > > l
> > > > > 
> > > > > Patches are based on latest linux-next (next-20180710) and are
> > > > > ordered
> > > > > in such way that they don't break R40 HDMI at any time. Because
> > > > > of that
> > > > > I suggest that whole series goes through drm-misc to preserve
> > > > > that order.
> > > > > 
> > > > > I also tested those patches on H3 to make sure it doesn't break
> > > > > other
> > > > > platforms. However, it would be nice to test for regressions
> > > > > also on
> > > > > older SoCs (with DE1).
> > > > > 
> > > > > Best regards,
> > > > > Jernej
> > > > 
> > > > Applied all patches but the patch 10, thanks!
> > > > Maxime
> > > 
> > > It seems that you forgot to merge some patches:
> > > 
> > > [PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching
> > > mixers with
> > > tcon
> > > [PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON
> > > 
> > > Without them, R40 display pipeline can't work.
> > > 
> > > Maybe they are in your spam folder?
> > 
> > Thanks for telling me, I'm not quite sure what happened.
> > 
> > I've applied them.
> 
> BTW without them the board cannot boot because of dead loop in
> sun4i_drv_probe().

Does it work for you now?

> 
> > Sorry,
> > Maxime
> > 
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel





^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [linux-sunxi] Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-24 17:20         ` [linux-sunxi] " Jernej Škrabec
@ 2018-07-24 17:23           ` Icenowy Zheng
  0 siblings, 0 replies; 40+ messages in thread
From: Icenowy Zheng @ 2018-07-24 17:23 UTC (permalink / raw)
  To: linux-arm-kernel, Jernej Škrabec, linux-sunxi
  Cc: mark.rutland, devicetree, Maxime Ripard, linux-kernel, dri-devel,
	airlied, wens, robh+dt



于 2018年7月25日 GMT+08:00 上午1:20:42, "Jernej Škrabec" <jernej.skrabec@siol.net> 写到:
>Dne torek, 24. julij 2018 ob 18:04:49 CEST je Icenowy Zheng napisal(a):
>> 在 2018-07-24二的 14:37 +0200,Maxime Ripard写道:
>> 
>> > On Sun, Jul 22, 2018 at 04:43:56PM +0200, Jernej Škrabec wrote:
>> > > Hi Maxime,
>> > > 
>> > > Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard
>> > > 
>> > > napisal(a):
>> > > > On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
>> > > > > This series fixes several issues found in R40 HDMI patch
>series
>> > > > > after
>> 
>> > > > > it was applied. Conversation can be found here:
>>
>http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.htm
>> 
>> > > > > l
>> > > > > 
>> > > > > Patches are based on latest linux-next (next-20180710) and
>are
>> > > > > ordered
>> > > > > in such way that they don't break R40 HDMI at any time.
>Because
>> > > > > of that
>> > > > > I suggest that whole series goes through drm-misc to preserve
>> > > > > that order.
>> > > > > 
>> > > > > I also tested those patches on H3 to make sure it doesn't
>break
>> > > > > other
>> > > > > platforms. However, it would be nice to test for regressions
>> > > > > also on
>> > > > > older SoCs (with DE1).
>> > > > > 
>> > > > > Best regards,
>> > > > > Jernej
>> > > > 
>> > > > Applied all patches but the patch 10, thanks!
>> > > > Maxime
>> > > 
>> > > It seems that you forgot to merge some patches:
>> > > 
>> > > [PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching
>> > > mixers with
>> > > tcon
>> > > [PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON
>> > > 
>> > > Without them, R40 display pipeline can't work.
>> > > 
>> > > Maybe they are in your spam folder?
>> > 
>> > Thanks for telling me, I'm not quite sure what happened.
>> > 
>> > I've applied them.
>> 
>> BTW without them the board cannot boot because of dead loop in
>> sun4i_drv_probe().
>
>Does it work for you now?

Yes, although it cannot output 1920x1200 to my father's DVI
monitor, but if it output a smaller resolution (e.g. 1024x600, by
insert my WaveShare LCD first then the monitor) it works.

>
>> 
>> > Sorry,
>> > Maxime
>> > 
>> > _______________________________________________
>> > linux-arm-kernel mailing list
>> > linux-arm-kernel@lists.infradead.org
>> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
>
>
>
>_______________________________________________
>linux-arm-kernel mailing list
>linux-arm-kernel@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-07-24 12:37     ` Maxime Ripard
  2018-07-24 16:04       ` Icenowy Zheng
@ 2018-08-14  5:43       ` Icenowy Zheng
  2018-08-14  5:47         ` [linux-sunxi] " Chen-Yu Tsai
  1 sibling, 1 reply; 40+ messages in thread
From: Icenowy Zheng @ 2018-08-14  5:43 UTC (permalink / raw)
  To: Maxime Ripard, Jernej �0�7krabec
  Cc: mark.rutland, devicetree, airlied, linux-sunxi, linux-kernel,
	dri-devel, wens, robh+dt, linux-arm-kernel

在 2018-07-24二的 14:37 +0200,Maxime Ripard写道:
> On Sun, Jul 22, 2018 at 04:43:56PM +0200, Jernej Škrabec wrote:
> > Hi Maxime,
> > 
> > Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard
> > napisal(a):
> > > On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
> > > > This series fixes several issues found in R40 HDMI patch series
> > > > after
> > > > it was applied. Conversation can be found here:
> > > > 
http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.htm
> > > > l
> > > > 
> > > > Patches are based on latest linux-next (next-20180710) and are
> > > > ordered
> > > > in such way that they don't break R40 HDMI at any time. Because
> > > > of that
> > > > I suggest that whole series goes through drm-misc to preserve
> > > > that order.
> > > > 
> > > > I also tested those patches on H3 to make sure it doesn't break
> > > > other
> > > > platforms. However, it would be nice to test for regressions
> > > > also on
> > > > older SoCs (with DE1).
> > > > 
> > > > Best regards,
> > > > Jernej
> > > 
> > > Applied all patches but the patch 10, thanks!
> > > Maxime
> > 
> > It seems that you forgot to merge some patches:
> > 
> > [PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching
> > mixers with 
> > tcon
> > [PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON
> > 
> > Without them, R40 display pipeline can't work.
> > 
> > Maybe they are in your spam folder?
> 
> Thanks for telling me, I'm not quite sure what happened.
> 
> I've applied them.

Sorry, but I still didn't find them in linux-next/master.

> 
> Sorry,
> Maxime
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [linux-sunxi] Re: [PATCH v2 00/18] Allwinner R40 HDMI refactoring
  2018-08-14  5:43       ` Icenowy Zheng
@ 2018-08-14  5:47         ` Chen-Yu Tsai
  0 siblings, 0 replies; 40+ messages in thread
From: Chen-Yu Tsai @ 2018-08-14  5:47 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Maxime Ripard, Jernej Škrabec, Mark Rutland, devicetree,
	David Airlie, linux-sunxi, linux-kernel, dri-devel, Rob Herring,
	linux-arm-kernel

On Tue, Aug 14, 2018 at 1:43 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
> 在 2018-07-24二的 14:37 +0200,Maxime Ripard写道:
>> On Sun, Jul 22, 2018 at 04:43:56PM +0200, Jernej Škrabec wrote:
>> > Hi Maxime,
>> >
>> > Dne sreda, 11. julij 2018 ob 10:30:36 CEST je Maxime Ripard
>> > napisal(a):
>> > > On Tue, Jul 10, 2018 at 10:34:53PM +0200, Jernej Skrabec wrote:
>> > > > This series fixes several issues found in R40 HDMI patch series
>> > > > after
>> > > > it was applied. Conversation can be found here:
>> > > >
> http://lists.infradead.org/pipermail/linux-arm-kernel/2018-June/586011.htm
>> > > > l
>> > > >
>> > > > Patches are based on latest linux-next (next-20180710) and are
>> > > > ordered
>> > > > in such way that they don't break R40 HDMI at any time. Because
>> > > > of that
>> > > > I suggest that whole series goes through drm-misc to preserve
>> > > > that order.
>> > > >
>> > > > I also tested those patches on H3 to make sure it doesn't break
>> > > > other
>> > > > platforms. However, it would be nice to test for regressions
>> > > > also on
>> > > > older SoCs (with DE1).
>> > > >
>> > > > Best regards,
>> > > > Jernej
>> > >
>> > > Applied all patches but the patch 10, thanks!
>> > > Maxime
>> >
>> > It seems that you forgot to merge some patches:
>> >
>> > [PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching
>> > mixers with
>> > tcon
>> > [PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON
>> >
>> > Without them, R40 display pipeline can't work.
>> >
>> > Maybe they are in your spam folder?
>>
>> Thanks for telling me, I'm not quite sure what happened.
>>
>> I've applied them.
>
> Sorry, but I still didn't find them in linux-next/master.

They were applied too late and missed the -rc6 deadline for drm-misc.
We either have to revert the DT changes in 4.19-rc or somehow sneak
in a patch that prevents it from crashing.

ChenYu

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2018-08-14  5:47 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-10 20:34 [PATCH v2 00/18] Allwinner R40 HDMI refactoring Jernej Skrabec
2018-07-10 20:34 ` [PATCH v2 01/18] dt-bindings: display: sun4i-drm: Add R40 display engine compatible Jernej Skrabec
2018-07-10 20:34 ` [PATCH v2 02/18] drm/sun4i: " Jernej Skrabec
2018-07-10 20:34 ` [PATCH v2 03/18] ARM: dts: sun8i: r40: Remove fallback " Jernej Skrabec
2018-07-10 20:34 ` [PATCH v2 04/18] drm/sun4i: tcon-top: Cleanup clock handling Jernej Skrabec
2018-07-10 23:20   ` kbuild test robot
2018-07-11  2:54     ` Chen-Yu Tsai
2018-07-10 20:34 ` [PATCH v2 05/18] drm/sun4i: tcon: Release node when traversing of graph Jernej Skrabec
2018-07-10 20:34 ` [PATCH v2 06/18] dt-bindings: display: sun4i-drm: Add R40 TV TCON description Jernej Skrabec
2018-07-10 20:35 ` [PATCH v2 07/18] drm/sun4i: DW HDMI: Release nodes if error happens during CRTC search Jernej Skrabec
2018-07-10 20:35 ` [PATCH v2 08/18] ARM: dts: sun8i: r40: Add mixer ids to TCON TOP Jernej Skrabec
2018-07-11  2:55   ` Chen-Yu Tsai
2018-07-10 20:35 ` [PATCH v2 09/18] drm/sun4i: mixer: Order includes alphabetically Jernej Skrabec
2018-07-11  2:56   ` Chen-Yu Tsai
2018-07-10 20:35 ` [PATCH v2 10/18] drm/sun4i: mixer: Read id from DT Jernej Skrabec
2018-07-11  3:11   ` Chen-Yu Tsai
2018-07-11  7:10     ` Jernej Škrabec
2018-07-11  7:11       ` Chen-Yu Tsai
2018-07-10 20:35 ` [PATCH v2 11/18] drm/sun4i: tcon-top: Add helpers for mux switching Jernej Skrabec
2018-07-10 20:35 ` [PATCH v2 12/18] drm/sun4i: tcon: Add another way for matching mixers with tcon Jernej Skrabec
2018-07-10 20:35 ` [PATCH v2 13/18] drm/sun4i: tcon: Add support for R40 TCON Jernej Skrabec
2018-07-10 20:35 ` [PATCH v2 14/18] ARM: dts: sun8i: r40: Remove fallback compatible for TCON TV Jernej Skrabec
2018-07-10 20:35 ` [PATCH v2 15/18] ARM: dts: sun8i: r40: Add missing TCON-TOP - TCON connections Jernej Skrabec
2018-07-10 20:35 ` [PATCH v2 16/18] ARM: dts: sun8i: r40: Disable TCONs by default Jernej Skrabec
2018-07-10 20:35 ` [PATCH v2 17/18] drm/sun4i: tcon-top: Remove mux configuration at probe time Jernej Skrabec
2018-07-11  3:15   ` Chen-Yu Tsai
2018-07-10 20:35 ` [PATCH v2 18/18] dt-bindings: display: sun4i-drm: Fix order of DW HDMI PHY compatibles Jernej Skrabec
2018-07-11  8:30 ` [PATCH v2 00/18] Allwinner R40 HDMI refactoring Maxime Ripard
2018-07-11  8:37   ` Chen-Yu Tsai
2018-07-11  8:41   ` Jernej Škrabec
2018-07-11  9:30     ` Maxime Ripard
2018-07-11  9:34       ` [linux-sunxi] " Jernej Škrabec
2018-07-11 13:36         ` Maxime Ripard
2018-07-22 14:43   ` Jernej Škrabec
2018-07-24 12:37     ` Maxime Ripard
2018-07-24 16:04       ` Icenowy Zheng
2018-07-24 17:20         ` [linux-sunxi] " Jernej Škrabec
2018-07-24 17:23           ` Icenowy Zheng
2018-08-14  5:43       ` Icenowy Zheng
2018-08-14  5:47         ` [linux-sunxi] " Chen-Yu Tsai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).