Skip to contentSkip to conversation

drm: exynos: dsi: Restore the bridge chain

PATCH Superseded Jagan Teki 4 participants 16 messages Dec 12, 2022 – Jan 26, 2023

Subsystems (6)

v11 of 16 Superseded Latest is v16 →

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

v11 cover drm: exynos: dsi: Restore the bridge chain

Split the Exynos DSI bridge chain update patches from Samsung DSIM bridge driver for easy to apply.

Changes for v11:
- enable bridge.pre_enable_prev_first
Changes for v10:
- collect Marek.V Review tag

Any inputs?
Jagan.

Jagan Teki (2):
drm: panel: Enable prepare_prev_first flag for samsung-s6e panels
drm: exynos: dsi: Restore proper bridge chain order

Marek Szyprowski (1):
drm/bridge: tc358764: Enable pre_enable_prev_first flag

 drivers/gpu/drm/bridge/tc358764.c                | 1 +
 drivers/gpu/drm/exynos/exynos_drm_dsi.c          | 9 +++++++--
 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c    | 1 +
 drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 1 +
 drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c    | 1 +
 5 files changed, 11 insertions(+), 2 deletions(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v11 1/3 drm: panel: Enable prepare_prev_first flag for samsung-s6e panels

Enable the drm panel prepare_prev_first flag so-that the previous controller should be prepared first before the prepare for the panel is called.

samsung-s6e3ha2, samsung-s6e63j0x03 and samsung-s6e8aa0 are the effected samsung-s6e panels for this change.

This makes sure that the previous controller, likely to be a DSI host controller should be initialized to LP-11 before the panel is powered up.

---
Changes for v11, v10:
- none

 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c    | 1 +
 drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 1 +
 drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c    | 1 +
 3 files changed, 3 insertions(+)
drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c +1 -0
index 5c621b15e84c..1355b2c27932 100644
@@ -731,6 +731,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi)
 
 	drm_panel_init(&ctx->panel, dev, &s6e3ha2_drm_funcs,
 		       DRM_MODE_CONNECTOR_DSI);
+	ctx->panel.prepare_prev_first = true;
 
 	drm_panel_add(&ctx->panel);
 
drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c +1 -0
index e06fd35de814..3223a9d06a50 100644
@@ -462,6 +462,7 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)
 
 	drm_panel_init(&ctx->panel, dev, &s6e63j0x03_funcs,
 		       DRM_MODE_CONNECTOR_DSI);
+	ctx->panel.prepare_prev_first = true;
 
 	ctx->bl_dev = backlight_device_register("s6e63j0x03", dev, ctx,
 						&s6e63j0x03_bl_ops, NULL);
drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c +1 -0
index 54213beafaf5..362eb10f10ce 100644
@@ -1018,6 +1018,7 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi)
 
 	drm_panel_init(&ctx->panel, dev, &s6e8aa0_drm_funcs,
 		       DRM_MODE_CONNECTOR_DSI);
+	ctx->panel.prepare_prev_first = true;
 
 	drm_panel_add(&ctx->panel);
 
Signature · 1 line
2.25.1
Reviewed-by on v11 1/3
#2 lore raw

Re: [PATCH v11 1/3] drm: panel: Enable prepare_prev_first flag for samsung-s6e panels

Quoted 11 lines · Jagan Teki

Enable the drm panel prepare_prev_first flag so-that the previous controller should be prepared first before the prepare for the panel is called.

samsung-s6e3ha2, samsung-s6e63j0x03 and samsung-s6e8aa0 are the effected samsung-s6e panels for this change.

This makes sure that the previous controller, likely to be a DSI host controller should be initialized to LP-11 before the panel is powered up.

Quoted 2 lines
author
#3 lore raw

PATCH v11 2/3 drm/bridge: tc358764: Enable pre_enable_prev_first flag

In reply to Jagan Teki

From: Marek Szyprowski <[email protected]>

Enable the drm bridge pre_enable_prev_first flag so that the previous bridge pre_enable should be called first before the pre_enable for the tc358764 bridge is called.

This makes sure that the previous bridge should be initialized properly before the tc358764 bridge is powered up.

---
Changes for v11, v10:
- none

 drivers/gpu/drm/bridge/tc358764.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/bridge/tc358764.c +1 -0
index 53259c12d777..f85654f1b104 100644
@@ -369,6 +369,7 @@ static int tc358764_probe(struct mipi_dsi_device *dsi)
 
 	ctx->bridge.funcs = &tc358764_bridge_funcs;
 	ctx->bridge.of_node = dev->of_node;
+	ctx->bridge.pre_enable_prev_first = true;
 
 	drm_bridge_add(&ctx->bridge);
 
Signature · 1 line
2.25.1
Reviewed-by on v11 2/3
#4 lore raw

Re: [PATCH v11 2/3] drm/bridge: tc358764: Enable pre_enable_prev_first flag

Quoted 11 lines · Jagan Teki

From: Marek Szyprowski <[email protected]>

Enable the drm bridge pre_enable_prev_first flag so that the previous bridge pre_enable should be called first before the pre_enable for the tc358764 bridge is called.

This makes sure that the previous bridge should be initialized properly before the tc358764 bridge is powered up.

author
#5 lore raw

PATCH v11 3/3 drm: exynos: dsi: Restore proper bridge chain order

In reply to Jagan Teki

Restore the proper bridge chain by finding the previous bridge in the chain instead of passing NULL.

This establishes a proper bridge chain while attaching downstream bridges.

---
Changes for v11:
- add bridge.pre_enable_prev_first
Changes for v10:
- collect Marek review tag

 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +7 -2
index ec673223d6b7..9d10a89d28f1 100644
@@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge,
 {
 	struct exynos_dsi *dsi = bridge_to_dsi(bridge);
 
-	return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags);
+	return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge,
+				 flags);
 }
 
 static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = {
@@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
 
 	drm_bridge_add(&dsi->bridge);
 
-	drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
+	drm_bridge_attach(encoder, &dsi->bridge,
+			  list_first_entry_or_null(&encoder->bridge_chain,
+						   struct drm_bridge,
+						   chain_node), 0);
 
 	/*
 	 * This is a temporary solution and should be made by more generic way.
@@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev)
 	dsi->bridge.funcs = &exynos_dsi_bridge_funcs;
 	dsi->bridge.of_node = dev->of_node;
 	dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
+	dsi->bridge.pre_enable_prev_first = true;
 
 	ret = component_add(dev, &exynos_dsi_component_ops);
 	if (ret)
Signature · 1 line
2.25.1
Reviewed-by on v11 3/3
#6 lore raw

Re: [PATCH v11 3/3] drm: exynos: dsi: Restore proper bridge chain order

Quoted 9 lines · Jagan Teki

Restore the proper bridge chain by finding the previous bridge in the chain instead of passing NULL.

This establishes a proper bridge chain while attaching downstream bridges.

#7 lore raw

Re: [PATCH v11 3/3] drm: exynos: dsi: Restore proper bridge chain order

In reply to Jagan Teki

Hi Jagan

Responding due to Marek's comment on the "Add Samsung MIPI DSIM bridge" series, although I know very little about the Exynos specifics, and may well be missing context of what you're trying to achieve.

Quoted 24 lines · Jagan Teki

Restore the proper bridge chain by finding the previous bridge in the chain instead of passing NULL.

This establishes a proper bridge chain while attaching downstream bridges.

---
Changes for v11:
- add bridge.pre_enable_prev_first
Changes for v10:
- collect Marek review tag

 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -0
index ec673223d6b7..9d10a89d28f1 100644

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_attach(struct drm_bridge *bridge, · line 1432

Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +2 -1
@@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge,
 {
        struct exynos_dsi *dsi = bridge_to_dsi(bridge);
 
-       return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags);
+       return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge,
+                                flags);

Agreed on this change.

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_host_attach(struct mipi_dsi_host *host, · line 1481

Quoted 12 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +4 -1
 }
 
 static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = {
@@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
 
        drm_bridge_add(&dsi->bridge);
 
-       drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
+       drm_bridge_attach(encoder, &dsi->bridge,
+                         list_first_entry_or_null(&encoder->bridge_chain,
+                                                  struct drm_bridge,
+                                                  chain_node), 0);

What bridge are you expecting between the encoder and this bridge? The encoder is the drm_simple_encoder_init encoder that you've created in exynos_dsi_bind, so separating that from the bridge you're also creating here seems weird.

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_probe(struct platform_device *pdev) · line 1716

Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +1 -0
        /*
         * This is a temporary solution and should be made by more generic way.
@@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev)
        dsi->bridge.funcs = &exynos_dsi_bridge_funcs;
        dsi->bridge.of_node = dev->of_node;
        dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
+       dsi->bridge.pre_enable_prev_first = true;

Setting dsi->bridge.pre_enable_prev_first on what is presumably the DSI host controller seems a little odd.
Same question again - what bridge are you expecting to be upstream of the DSI host that needs to be preenabled before it? Whilst it's possible that there's another bridge, I'd have expected that to be the first link from your encoder as they appear to both belong to the same bit of driver.

Dave

Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -1
        ret = component_add(dev, &exynos_dsi_component_ops);
        if (ret)
--

2.25.1

author
#8 lore raw

Re: [PATCH v11 3/3] drm: exynos: dsi: Restore proper bridge chain order

Hi Dave,

Quoted 61 lines · Dave Stevenson

Hi Jagan

Responding due to Marek's comment on the "Add Samsung MIPI DSIM bridge" series, although I know very little about the Exynos specifics, and may well be missing context of what you're trying to achieve.

Quoted 24 lines · Jagan Teki

Restore the proper bridge chain by finding the previous bridge in the chain instead of passing NULL.

This establishes a proper bridge chain while attaching downstream bridges.

---
Changes for v11:
- add bridge.pre_enable_prev_first
Changes for v10:
- collect Marek review tag

 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -0
index ec673223d6b7..9d10a89d28f1 100644

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_attach(struct drm_bridge *bridge, · line 1432

Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +2 -1
@@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge,
 {
        struct exynos_dsi *dsi = bridge_to_dsi(bridge);
 
-       return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags);
+       return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge,
+                                flags);

Agreed on this change.

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_host_attach(struct mipi_dsi_host *host, · line 1481

Quoted 12 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +4 -1
 }
 
 static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = {
@@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
 
        drm_bridge_add(&dsi->bridge);
 
-       drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
+       drm_bridge_attach(encoder, &dsi->bridge,
+                         list_first_entry_or_null(&encoder->bridge_chain,
+                                                  struct drm_bridge,
+                                                  chain_node), 0);

What bridge are you expecting between the encoder and this bridge? The encoder is the drm_simple_encoder_init encoder that you've created in exynos_dsi_bind, so separating that from the bridge you're also creating here seems weird.

Quoted 1 line
Quoted 15 lines

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_probe(struct platform_device *pdev) · line 1716

Quoted 7 lines

/*
* This is a temporary solution and should be made by more generic way.

drivers/gpu/drm/exynos/exynos_drm_dsi.c +1 -0
@@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev)
        dsi->bridge.funcs = &exynos_dsi_bridge_funcs;
        dsi->bridge.of_node = dev->of_node;
        dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
+       dsi->bridge.pre_enable_prev_first = true;

Setting dsi->bridge.pre_enable_prev_first on what is presumably the DSI host controller seems a little odd.
Same question again - what bridge are you expecting to be upstream of the DSI host that needs to be preenabled before it? Whilst it's possible that there's another bridge, I'd have expected that to be the first link from your encoder as they appear to both belong to the same bit of driver.

Let me answer all together here. I can explain a bit about one of the pipelines used in Exynos. Exynos DSI DRM drivers have some strict host initialization which is not the same as what we used in i.MX8M even though it uses the same DSIM IP.

Exynos5433 Decon -> Exynos MIC -> Exynos DSI -> s6e3ha2 DSI panel

Here MIC is the bridge, Exynos DSI is the bridge and the requirement is to expect the upstream bridge to pre_enable first from DSI which means the MIC.

Jagan.

#9 lore raw

Re: [PATCH v11 3/3] drm: exynos: dsi: Restore proper bridge chain order

Hi Jagan

Quoted 87 lines · Jagan Teki

Hi Dave,

Quoted 61 lines · Dave Stevenson

Hi Jagan

Responding due to Marek's comment on the "Add Samsung MIPI DSIM bridge" series, although I know very little about the Exynos specifics, and may well be missing context of what you're trying to achieve.

Quoted 24 lines · Jagan Teki

Restore the proper bridge chain by finding the previous bridge in the chain instead of passing NULL.

This establishes a proper bridge chain while attaching downstream bridges.

---
Changes for v11:
- add bridge.pre_enable_prev_first
Changes for v10:
- collect Marek review tag

 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -0
index ec673223d6b7..9d10a89d28f1 100644

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_attach(struct drm_bridge *bridge, · line 1432

Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +2 -1
@@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge,
 {
        struct exynos_dsi *dsi = bridge_to_dsi(bridge);
 
-       return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags);
+       return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge,
+                                flags);

Agreed on this change.

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_host_attach(struct mipi_dsi_host *host, · line 1481

Quoted 12 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +4 -1
 }
 
 static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = {
@@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
 
        drm_bridge_add(&dsi->bridge);
 
-       drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
+       drm_bridge_attach(encoder, &dsi->bridge,
+                         list_first_entry_or_null(&encoder->bridge_chain,
+                                                  struct drm_bridge,
+                                                  chain_node), 0);

What bridge are you expecting between the encoder and this bridge? The encoder is the drm_simple_encoder_init encoder that you've created in exynos_dsi_bind, so separating that from the bridge you're also creating here seems weird.

Quoted 1 line
Quoted 15 lines

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_probe(struct platform_device *pdev) · line 1716

Quoted 7 lines

/*
* This is a temporary solution and should be made by more generic way.

drivers/gpu/drm/exynos/exynos_drm_dsi.c +1 -0
@@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev)
        dsi->bridge.funcs = &exynos_dsi_bridge_funcs;
        dsi->bridge.of_node = dev->of_node;
        dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
+       dsi->bridge.pre_enable_prev_first = true;

Setting dsi->bridge.pre_enable_prev_first on what is presumably the DSI host controller seems a little odd.
Same question again - what bridge are you expecting to be upstream of the DSI host that needs to be preenabled before it? Whilst it's possible that there's another bridge, I'd have expected that to be the first link from your encoder as they appear to both belong to the same bit of driver.

Let me answer all together here. I can explain a bit about one of the pipelines used in Exynos. Exynos DSI DRM drivers have some strict host initialization which is not the same as what we used in i.MX8M even though it uses the same DSIM IP.

Quoted 5 lines

Exynos5433 Decon -> Exynos MIC -> Exynos DSI -> s6e3ha2 DSI panel

Here MIC is the bridge, Exynos DSI is the bridge and the requirement is to expect the upstream bridge to pre_enable first from DSI which means the MIC.

That makes sense for the pre_enable_prev_first flag.

The drm_bridge_attach(... list_first_entry_or_null) still seems a little weird. I think you are making the assumption that there is only ever going to be the zero or one bridge (the MIC) between encoder and DSI bridge - the DSI bridge is linking itself to the first entry off the encoder bridge_chain (or NULL to link to the encoder). Is that reasonable? I've no idea!

I must confess to not having looked at the attaching sequence recently, and I'm about to head home for the weekend.
I have no real knowledge of how Exynos is working, and am aware that you're having to rejuggle stuff to try and support i.MX8M and Exynos, so leave that one up to you.

Cheers
Dave

#10 lore raw

Re: [PATCH v11 3/3] drm: exynos: dsi: Restore proper bridge chain order

Quoted 96 lines · Dave Stevenson

Hi Jagan

Quoted 87 lines · Jagan Teki

Hi Dave,

Quoted 61 lines · Dave Stevenson

Hi Jagan

Responding due to Marek's comment on the "Add Samsung MIPI DSIM bridge" series, although I know very little about the Exynos specifics, and may well be missing context of what you're trying to achieve.

Quoted 24 lines · Jagan Teki

Restore the proper bridge chain by finding the previous bridge in the chain instead of passing NULL.

This establishes a proper bridge chain while attaching downstream bridges.

---
Changes for v11:
- add bridge.pre_enable_prev_first
Changes for v10:
- collect Marek review tag

 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -0
index ec673223d6b7..9d10a89d28f1 100644

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_attach(struct drm_bridge *bridge, · line 1432

Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +2 -1
@@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge,
 {
        struct exynos_dsi *dsi = bridge_to_dsi(bridge);
 
-       return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags);
+       return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge,
+                                flags);

Agreed on this change.

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_host_attach(struct mipi_dsi_host *host, · line 1481

Quoted 12 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +4 -1
 }
 
 static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = {
@@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
 
        drm_bridge_add(&dsi->bridge);
 
-       drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
+       drm_bridge_attach(encoder, &dsi->bridge,
+                         list_first_entry_or_null(&encoder->bridge_chain,
+                                                  struct drm_bridge,
+                                                  chain_node), 0);

What bridge are you expecting between the encoder and this bridge? The encoder is the drm_simple_encoder_init encoder that you've created in exynos_dsi_bind, so separating that from the bridge you're also creating here seems weird.

Quoted 1 line
Quoted 15 lines

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_probe(struct platform_device *pdev) · line 1716

Quoted 7 lines

/*
* This is a temporary solution and should be made by more generic way.

drivers/gpu/drm/exynos/exynos_drm_dsi.c +1 -0
@@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev)
        dsi->bridge.funcs = &exynos_dsi_bridge_funcs;
        dsi->bridge.of_node = dev->of_node;
        dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
+       dsi->bridge.pre_enable_prev_first = true;

Setting dsi->bridge.pre_enable_prev_first on what is presumably the DSI host controller seems a little odd.
Same question again - what bridge are you expecting to be upstream of the DSI host that needs to be preenabled before it? Whilst it's possible that there's another bridge, I'd have expected that to be the first link from your encoder as they appear to both belong to the same bit of driver.

Let me answer all together here. I can explain a bit about one of the pipelines used in Exynos. Exynos DSI DRM drivers have some strict host initialization which is not the same as what we used in i.MX8M even though it uses the same DSIM IP.

Quoted 5 lines

Exynos5433 Decon -> Exynos MIC -> Exynos DSI -> s6e3ha2 DSI panel

Here MIC is the bridge, Exynos DSI is the bridge and the requirement is to expect the upstream bridge to pre_enable first from DSI which means the MIC.

Quoted 8 lines

That makes sense for the pre_enable_prev_first flag.

The drm_bridge_attach(... list_first_entry_or_null) still seems a little weird. I think you are making the assumption that there is only ever going to be the zero or one bridge (the MIC) between encoder and DSI bridge - the DSI bridge is linking itself to the first entry off the encoder bridge_chain (or NULL to link to the encoder). Is that reasonable? I've no idea!

I think the assumption is reasonable for now, as it covers both types of chains this driver is currently used in (Exynos and i.MX). And IIUC this change is mainly needed for (backward) compatibility with the somewhat "special" chain in Exynos.

Quoted 6 lines

I must confess to not having looked at the attaching sequence recently, and I'm about to head home for the weekend.
I have no real knowledge of how Exynos is working, and am aware that you're having to rejuggle stuff to try and support i.MX8M and Exynos, so leave that one up to you.

I strongly vote for leaving this as is for now. We already spent too much time finding a satisfying solution that covers Exynos and i.MX. There might be room for improvements in the future, but in my opinion this is good enough to get merged.

author
#11 lore raw

Re: [PATCH v11 3/3] drm: exynos: dsi: Restore proper bridge chain order

In reply to Dave Stevenson

Hi Dave,

Quoted 97 lines · Dave Stevenson

Hi Jagan

Quoted 87 lines · Jagan Teki

Hi Dave,

Quoted 61 lines · Dave Stevenson

Hi Jagan

Responding due to Marek's comment on the "Add Samsung MIPI DSIM bridge" series, although I know very little about the Exynos specifics, and may well be missing context of what you're trying to achieve.

Quoted 24 lines · Jagan Teki

Restore the proper bridge chain by finding the previous bridge in the chain instead of passing NULL.

This establishes a proper bridge chain while attaching downstream bridges.

---
Changes for v11:
- add bridge.pre_enable_prev_first
Changes for v10:
- collect Marek review tag

 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -0
index ec673223d6b7..9d10a89d28f1 100644

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_attach(struct drm_bridge *bridge, · line 1432

Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +2 -1
@@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge,
 {
        struct exynos_dsi *dsi = bridge_to_dsi(bridge);
 
-       return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags);
+       return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge,
+                                flags);

Agreed on this change.

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_host_attach(struct mipi_dsi_host *host, · line 1481

Quoted 12 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +4 -1
 }
 
 static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = {
@@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
 
        drm_bridge_add(&dsi->bridge);
 
-       drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
+       drm_bridge_attach(encoder, &dsi->bridge,
+                         list_first_entry_or_null(&encoder->bridge_chain,
+                                                  struct drm_bridge,
+                                                  chain_node), 0);

What bridge are you expecting between the encoder and this bridge? The encoder is the drm_simple_encoder_init encoder that you've created in exynos_dsi_bind, so separating that from the bridge you're also creating here seems weird.

Quoted 1 line
Quoted 15 lines

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_probe(struct platform_device *pdev) · line 1716

Quoted 7 lines

/*
* This is a temporary solution and should be made by more generic way.

drivers/gpu/drm/exynos/exynos_drm_dsi.c +1 -0
@@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev)
        dsi->bridge.funcs = &exynos_dsi_bridge_funcs;
        dsi->bridge.of_node = dev->of_node;
        dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
+       dsi->bridge.pre_enable_prev_first = true;

Setting dsi->bridge.pre_enable_prev_first on what is presumably the DSI host controller seems a little odd.
Same question again - what bridge are you expecting to be upstream of the DSI host that needs to be preenabled before it? Whilst it's possible that there's another bridge, I'd have expected that to be the first link from your encoder as they appear to both belong to the same bit of driver.

Let me answer all together here. I can explain a bit about one of the pipelines used in Exynos. Exynos DSI DRM drivers have some strict host initialization which is not the same as what we used in i.MX8M even though it uses the same DSIM IP.

Quoted 5 lines

Exynos5433 Decon -> Exynos MIC -> Exynos DSI -> s6e3ha2 DSI panel

Here MIC is the bridge, Exynos DSI is the bridge and the requirement is to expect the upstream bridge to pre_enable first from DSI which means the MIC.

Quoted 8 lines

That makes sense for the pre_enable_prev_first flag.

The drm_bridge_attach(... list_first_entry_or_null) still seems a little weird. I think you are making the assumption that there is only ever going to be the zero or one bridge (the MIC) between encoder and DSI bridge - the DSI bridge is linking itself to the first entry off the encoder bridge_chain (or NULL to link to the encoder). Is that reasonable? I've no idea!

That is true, the reason would be that DSI bridges still use an encoder, usually, the first bridge in the chain will use an encoder and subsequent bridges are fully bridge-driven drivers (without an encoder) in order to follow the DRM bridge chain topology. Unfortunately, the Exynos DRM drivers follow component-based binding so DSI is part of that topology any attempt to exclude the encoder from it not compatible with Exynos DRM drivers. So, in order to make the bridge chain work properly we assume that linking. I think this bridge attach from the DSI driver bind can be dropped if we make Exynos DSIM as an independent bridge driver.

Jagan.

author
#12 lore raw
In reply to Jagan Teki
Quoted 8 lines · Jagan Teki

Split the Exynos DSI bridge chain update patches from Samsung DSIM bridge driver for easy to apply.

Changes for v11:
- enable bridge.pre_enable_prev_first
Changes for v10:
- collect Marek.V Review tag

Any update on this?

Jagan.

#13 lore raw

Hi Jagan Teki,

Sorry for late.

Quoted 18 lines

-----Original Message-----
From: Jagan Teki <[email protected]>
Sent: Saturday, January 7, 2023 2:56 AM
To: Marek Szyprowski <[email protected]>; Inki Dae <[email protected]>; Seung-Woo Kim <[email protected]>; Kyungmin Park <[email protected]>; Neil Armstrong <[email protected]>; Robert Foss <[email protected]>; Andrzej Hajda <[email protected]>; Sam Ravnborg <[email protected]>
Cc: Marek Vasut <[email protected]>; [email protected]; dri- [email protected]; linux-amarula <linux- [email protected]>
Subject: Re: [PATCH v11 0/3] drm: exynos: dsi: Restore the bridge chain

Quoted 4 lines · Jagan Teki

Split the Exynos DSI bridge chain update patches from Samsung DSIM bridge driver for easy to apply.

Quoted 7 lines
Quoted 4 lines

Changes for v11:
- enable bridge.pre_enable_prev_first
Changes for v10:
- collect Marek.V Review tag

Any update on this?

Added Thierry Reding who is a maintainer of DRM panel drivers.

I will pick this patch series - including panel and bride patches - up.

Thierry and Andrzej, please let me know if any problem.

Thanks,
Inki Dae

Quoted 1 line

Jagan.

author
#14 lore raw

Hi Inki Dae,

Quoted 28 lines · 대인기/Tizen Platform Lab(SR)/삼성전자

Hi Jagan Teki,

Sorry for late.

Quoted 23 lines

-----Original Message-----
From: Jagan Teki <[email protected]>
Sent: Saturday, January 7, 2023 2:56 AM
To: Marek Szyprowski <[email protected]>; Inki Dae <[email protected]>; Seung-Woo Kim <[email protected]>; Kyungmin Park <[email protected]>; Neil Armstrong <[email protected]>; Robert Foss <[email protected]>; Andrzej Hajda <[email protected]>; Sam Ravnborg <[email protected]>
Cc: Marek Vasut <[email protected]>; [email protected]; dri- [email protected]; linux-amarula <linux- [email protected]>
Subject: Re: [PATCH v11 0/3] drm: exynos: dsi: Restore the bridge chain

Quoted 8 lines · Jagan Teki

Split the Exynos DSI bridge chain update patches from Samsung DSIM bridge driver for easy to apply.

Changes for v11:
- enable bridge.pre_enable_prev_first
Changes for v10:
- collect Marek.V Review tag

Quoted 8 lines
Quoted 2 lines

Any update on this?

Added Thierry Reding who is a maintainer of DRM panel drivers.

I will pick this patch series - including panel and bride patches - up.

Thierry and Andrzej, please let me know if any problem.

Any further update on this?

Thanks,
Jagan.

#15 lore raw

Hi Jagan Teki,

Quoted 52 lines

-----Original Message-----
From: Jagan Teki <[email protected]>
Sent: Friday, January 20, 2023 3:19 AM
To: 대인기/Tizen Platform Lab(SR)/삼성전자 <[email protected]>
Cc: Marek Szyprowski <[email protected]>; Seung-Woo Kim <[email protected]>; Kyungmin Park <[email protected]>; Neil Armstrong <[email protected]>; Robert Foss <[email protected]>; Andrzej Hajda <[email protected]>; Sam Ravnborg <[email protected]>; [email protected]; Marek Vasut <[email protected]>; linux-samsung- [email protected]; [email protected]; linux-amarula <linux- [email protected]>
Subject: Re: [PATCH v11 0/3] drm: exynos: dsi: Restore the bridge chain

Hi Inki Dae,

Quoted 10 lines · 대인기/Tizen Platform Lab(SR)/삼성전자

Hi Jagan Teki,

Sorry for late.

Quoted 5 lines

-----Original Message-----
From: Jagan Teki <[email protected]>
Sent: Saturday, January 7, 2023 2:56 AM
To: Marek Szyprowski <[email protected]>; Inki Dae <[email protected]>; Seung-Woo Kim <[email protected]>; Kyungmin

Park

Quoted 1 line
Quoted 1 line

<[email protected]>; Neil Armstrong <[email protected]>;

Robert

Quoted 1 line
Quoted 1 line

Foss <[email protected]>; Andrzej Hajda <[email protected]>;

Sam

Quoted 7 lines
Quoted 7 lines

Ravnborg <[email protected]>
Cc: Marek Vasut <[email protected]>; [email protected]; dri- [email protected]; linux-amarula <linux- [email protected]>
Subject: Re: [PATCH v11 0/3] drm: exynos: dsi: Restore the bridge chain

On Mon, Dec 12, 2022 at 11:59 PM Jagan Teki <[email protected]>

Quoted 12 lines · wrote:
Quoted 11 lines
Quoted 8 lines

Split the Exynos DSI bridge chain update patches from Samsung DSIM bridge driver for easy to apply.

Changes for v11:
- enable bridge.pre_enable_prev_first
Changes for v10:
- collect Marek.V Review tag

Any update on this?

Quoted 7 lines
Quoted 5 lines

Added Thierry Reding who is a maintainer of DRM panel drivers.

I will pick this patch series - including panel and bride patches - up.

Thierry and Andrzej, please let me know if any problem.

Any further update on this?

Already merged to exynos-drm-next so this patch series will go to -next as long as no feedback from Thierry and Andrzej. I will request a PR this or next week.

Thanks,
Inki Dae

Quoted 3 lines

Thanks,
Jagan.