[PATCH v2] drm: Pass connector state to the bridge enable and disable handlers

Laurent Pinchart laurent.pinchart+renesas at ideasonboard.com
Fri Apr 20 13:33:26 UTC 2018


To allow bridge drivers to access state data such as the active mode in
their enable and disable handlers, pass a pointer to the connector state
to those handlers. From there the CRTC state can be accessed through
conn_state->crtc->state.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas at ideasonboard.com>
Reviewed-by: Sean Paul <seanpaul at chromium.org>
---
Changes since v1:

- Update the new thc63lvd1024 driver

I haven't CC'ed all the individual drivers maintainers, as doing so on
v1 seems to have exceeded the maximum number of recipients allowed by
the mailing list and prevented the mail from reaching the list.

---
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c       |  6 ++--
 drivers/gpu/drm/bridge/analogix-anx78xx.c          |  6 ++--
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 16 +++++++----
 drivers/gpu/drm/bridge/dumb-vga-dac.c              |  6 ++--
 drivers/gpu/drm/bridge/nxp-ptn3460.c               | 16 +++++++----
 drivers/gpu/drm/bridge/panel.c                     | 12 +++++---
 drivers/gpu/drm/bridge/parade-ps8622.c             | 12 +++++---
 drivers/gpu/drm/bridge/sii902x.c                   |  6 ++--
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c          |  6 ++--
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c      |  8 ++++--
 drivers/gpu/drm/bridge/tc358767.c                  | 12 +++++---
 drivers/gpu/drm/bridge/thc63lvd1024.c              |  6 ++--
 drivers/gpu/drm/drm_atomic_helper.c                |  8 +++---
 drivers/gpu/drm/drm_bridge.c                       | 32 ++++++++++++++--------
 drivers/gpu/drm/drm_crtc_helper.c                  | 20 +++++++-------
 drivers/gpu/drm/exynos/exynos_drm_mic.c            | 16 ++++++++---
 drivers/gpu/drm/mediatek/mtk_hdmi.c                | 12 +++++---
 drivers/gpu/drm/msm/dsi/dsi_manager.c              | 12 +++++---
 drivers/gpu/drm/msm/edp/edp_bridge.c               | 12 +++++---
 drivers/gpu/drm/msm/hdmi/hdmi_bridge.c             | 12 +++++---
 drivers/gpu/drm/rcar-du/rcar_lvds.c                |  6 ++--
 drivers/gpu/drm/sti/sti_dvo.c                      |  9 ++++--
 drivers/gpu/drm/sti/sti_hda.c                      |  9 ++++--
 drivers/gpu/drm/sti/sti_hdmi.c                     |  9 ++++--
 include/drm/drm_bridge.h                           | 25 +++++++++++------
 25 files changed, 190 insertions(+), 104 deletions(-)

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index efa29db5fc2b..7e8d4f10ad53 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -812,14 +812,16 @@ static struct adv7511 *bridge_to_adv7511(struct drm_bridge *bridge)
 	return container_of(bridge, struct adv7511, bridge);
 }
 
-static void adv7511_bridge_enable(struct drm_bridge *bridge)
+static void adv7511_bridge_enable(struct drm_bridge *bridge,
+				  const struct drm_connector_state *conn_state)
 {
 	struct adv7511 *adv = bridge_to_adv7511(bridge);
 
 	adv7511_power_on(adv);
 }
 
-static void adv7511_bridge_disable(struct drm_bridge *bridge)
+static void adv7511_bridge_disable(struct drm_bridge *bridge,
+				   const struct drm_connector_state *conn_state)
 {
 	struct adv7511 *adv = bridge_to_adv7511(bridge);
 
diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c
index b49043866be6..73f1ed6c6d1f 100644
--- a/drivers/gpu/drm/bridge/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c
@@ -1072,7 +1072,8 @@ anx78xx_bridge_mode_valid(struct drm_bridge *bridge,
 	return MODE_OK;
 }
 
-static void anx78xx_bridge_disable(struct drm_bridge *bridge)
+static void anx78xx_bridge_disable(struct drm_bridge *bridge,
+				   const struct drm_connector_state *conn_state)
 {
 	struct anx78xx *anx78xx = bridge_to_anx78xx(bridge);
 
@@ -1109,7 +1110,8 @@ static void anx78xx_bridge_mode_set(struct drm_bridge *bridge,
 	mutex_unlock(&anx78xx->lock);
 }
 
-static void anx78xx_bridge_enable(struct drm_bridge *bridge)
+static void anx78xx_bridge_enable(struct drm_bridge *bridge,
+				  const struct drm_connector_state *conn_state)
 {
 	struct anx78xx *anx78xx = bridge_to_anx78xx(bridge);
 	int err;
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 5c52307146c7..217428b7e589 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1140,7 +1140,8 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge)
 	return 0;
 }
 
-static void analogix_dp_bridge_pre_enable(struct drm_bridge *bridge)
+static void analogix_dp_bridge_pre_enable(struct drm_bridge *bridge,
+					  const struct drm_connector_state *conn_state)
 {
 	struct analogix_dp_device *dp = bridge->driver_private;
 	int ret;
@@ -1150,7 +1151,8 @@ static void analogix_dp_bridge_pre_enable(struct drm_bridge *bridge)
 		DRM_ERROR("failed to setup the panel ret = %d\n", ret);
 }
 
-static void analogix_dp_bridge_enable(struct drm_bridge *bridge)
+static void analogix_dp_bridge_enable(struct drm_bridge *bridge,
+				      const struct drm_connector_state *conn_state)
 {
 	struct analogix_dp_device *dp = bridge->driver_private;
 
@@ -1170,7 +1172,8 @@ static void analogix_dp_bridge_enable(struct drm_bridge *bridge)
 	dp->dpms_mode = DRM_MODE_DPMS_ON;
 }
 
-static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
+static void analogix_dp_bridge_disable(struct drm_bridge *bridge,
+				       const struct drm_connector_state *conn_state)
 {
 	struct analogix_dp_device *dp = bridge->driver_private;
 	int ret;
@@ -1280,7 +1283,8 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge,
 		video->interlaced = true;
 }
 
-static void analogix_dp_bridge_nop(struct drm_bridge *bridge)
+static void analogix_dp_bridge_post_disable(struct drm_bridge *bridge,
+					    const struct drm_connector_state *conn_state)
 {
 	/* do nothing */
 }
@@ -1289,7 +1293,7 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
 	.pre_enable = analogix_dp_bridge_pre_enable,
 	.enable = analogix_dp_bridge_enable,
 	.disable = analogix_dp_bridge_disable,
-	.post_disable = analogix_dp_bridge_nop,
+	.post_disable = analogix_dp_bridge_post_disable,
 	.mode_set = analogix_dp_bridge_mode_set,
 	.attach = analogix_dp_bridge_attach,
 };
@@ -1499,7 +1503,7 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind);
 
 void analogix_dp_unbind(struct analogix_dp_device *dp)
 {
-	analogix_dp_bridge_disable(dp->bridge);
+	analogix_dp_bridge_disable(dp->bridge, NULL);
 	dp->connector.funcs->destroy(&dp->connector);
 
 	if (dp->plat_data->panel) {
diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c b/drivers/gpu/drm/bridge/dumb-vga-dac.c
index 498d5948d1a8..ba1c11f2cac6 100644
--- a/drivers/gpu/drm/bridge/dumb-vga-dac.c
+++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c
@@ -126,7 +126,8 @@ static int dumb_vga_attach(struct drm_bridge *bridge)
 	return 0;
 }
 
-static void dumb_vga_enable(struct drm_bridge *bridge)
+static void dumb_vga_enable(struct drm_bridge *bridge,
+			    const struct drm_connector_state *conn_state)
 {
 	struct dumb_vga *vga = drm_bridge_to_dumb_vga(bridge);
 	int ret = 0;
@@ -138,7 +139,8 @@ static void dumb_vga_enable(struct drm_bridge *bridge)
 		DRM_ERROR("Failed to enable vdd regulator: %d\n", ret);
 }
 
-static void dumb_vga_disable(struct drm_bridge *bridge)
+static void dumb_vga_disable(struct drm_bridge *bridge,
+			     const struct drm_connector_state *conn_state)
 {
 	struct dumb_vga *vga = drm_bridge_to_dumb_vga(bridge);
 
diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c
index d64a3283822a..19ec388f7667 100644
--- a/drivers/gpu/drm/bridge/nxp-ptn3460.c
+++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c
@@ -122,7 +122,8 @@ static int ptn3460_select_edid(struct ptn3460_bridge *ptn_bridge)
 	return 0;
 }
 
-static void ptn3460_pre_enable(struct drm_bridge *bridge)
+static void ptn3460_pre_enable(struct drm_bridge *bridge,
+			       const struct drm_connector_state *conn_state)
 {
 	struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
 	int ret;
@@ -155,7 +156,8 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge)
 	ptn_bridge->enabled = true;
 }
 
-static void ptn3460_enable(struct drm_bridge *bridge)
+static void ptn3460_enable(struct drm_bridge *bridge,
+			   const struct drm_connector_state *conn_state)
 {
 	struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
 
@@ -165,7 +167,8 @@ static void ptn3460_enable(struct drm_bridge *bridge)
 	}
 }
 
-static void ptn3460_disable(struct drm_bridge *bridge)
+static void ptn3460_disable(struct drm_bridge *bridge,
+			    const struct drm_connector_state *conn_state)
 {
 	struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
 
@@ -183,7 +186,8 @@ static void ptn3460_disable(struct drm_bridge *bridge)
 	gpiod_set_value(ptn_bridge->gpio_pd_n, 0);
 }
 
-static void ptn3460_post_disable(struct drm_bridge *bridge)
+static void ptn3460_post_disable(struct drm_bridge *bridge,
+				 const struct drm_connector_state *conn_state)
 {
 	struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
 
@@ -206,7 +210,7 @@ static int ptn3460_get_modes(struct drm_connector *connector)
 		return drm_add_edid_modes(connector, ptn_bridge->edid);
 
 	power_off = !ptn_bridge->enabled;
-	ptn3460_pre_enable(&ptn_bridge->bridge);
+	ptn3460_pre_enable(&ptn_bridge->bridge, NULL);
 
 	edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
 	if (!edid) {
@@ -228,7 +232,7 @@ static int ptn3460_get_modes(struct drm_connector *connector)
 
 out:
 	if (power_off)
-		ptn3460_disable(&ptn_bridge->bridge);
+		ptn3460_disable(&ptn_bridge->bridge, NULL);
 
 	return num_modes;
 }
diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
index 6d99d4a3beb3..b5d2f853d123 100644
--- a/drivers/gpu/drm/bridge/panel.c
+++ b/drivers/gpu/drm/bridge/panel.c
@@ -96,28 +96,32 @@ static void panel_bridge_detach(struct drm_bridge *bridge)
 	drm_panel_detach(panel_bridge->panel);
 }
 
-static void panel_bridge_pre_enable(struct drm_bridge *bridge)
+static void panel_bridge_pre_enable(struct drm_bridge *bridge,
+				    const struct drm_connector_state *conn_state)
 {
 	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
 
 	drm_panel_prepare(panel_bridge->panel);
 }
 
-static void panel_bridge_enable(struct drm_bridge *bridge)
+static void panel_bridge_enable(struct drm_bridge *bridge,
+				const struct drm_connector_state *conn_state)
 {
 	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
 
 	drm_panel_enable(panel_bridge->panel);
 }
 
-static void panel_bridge_disable(struct drm_bridge *bridge)
+static void panel_bridge_disable(struct drm_bridge *bridge,
+				 const struct drm_connector_state *conn_state)
 {
 	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
 
 	drm_panel_disable(panel_bridge->panel);
 }
 
-static void panel_bridge_post_disable(struct drm_bridge *bridge)
+static void panel_bridge_post_disable(struct drm_bridge *bridge,
+				      const struct drm_connector_state *conn_state)
 {
 	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
 
diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
index 81198f5e9afa..4b529c5b7717 100644
--- a/drivers/gpu/drm/bridge/parade-ps8622.c
+++ b/drivers/gpu/drm/bridge/parade-ps8622.c
@@ -356,7 +356,8 @@ static const struct backlight_ops ps8622_backlight_ops = {
 	.update_status	= ps8622_backlight_update,
 };
 
-static void ps8622_pre_enable(struct drm_bridge *bridge)
+static void ps8622_pre_enable(struct drm_bridge *bridge,
+			      const struct drm_connector_state *conn_state)
 {
 	struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
 	int ret;
@@ -406,7 +407,8 @@ static void ps8622_pre_enable(struct drm_bridge *bridge)
 	ps8622->enabled = true;
 }
 
-static void ps8622_enable(struct drm_bridge *bridge)
+static void ps8622_enable(struct drm_bridge *bridge,
+			  const struct drm_connector_state *conn_state)
 {
 	struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
 
@@ -416,7 +418,8 @@ static void ps8622_enable(struct drm_bridge *bridge)
 	}
 }
 
-static void ps8622_disable(struct drm_bridge *bridge)
+static void ps8622_disable(struct drm_bridge *bridge,
+			   const struct drm_connector_state *conn_state)
 {
 	struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
 
@@ -427,7 +430,8 @@ static void ps8622_disable(struct drm_bridge *bridge)
 	msleep(PS8622_PWMO_END_T12_MS);
 }
 
-static void ps8622_post_disable(struct drm_bridge *bridge)
+static void ps8622_post_disable(struct drm_bridge *bridge,
+				const struct drm_connector_state *conn_state)
 {
 	struct ps8622_bridge *ps8622 = bridge_to_ps8622(bridge);
 
diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index 60373d7eb220..a9fccfeab10c 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -233,7 +233,8 @@ static const struct drm_connector_helper_funcs sii902x_connector_helper_funcs =
 	.mode_valid = sii902x_mode_valid,
 };
 
-static void sii902x_bridge_disable(struct drm_bridge *bridge)
+static void sii902x_bridge_disable(struct drm_bridge *bridge,
+				   const struct drm_connector_state *conn_state)
 {
 	struct sii902x *sii902x = bridge_to_sii902x(bridge);
 
@@ -242,7 +243,8 @@ static void sii902x_bridge_disable(struct drm_bridge *bridge)
 			   SII902X_SYS_CTRL_PWR_DWN);
 }
 
-static void sii902x_bridge_enable(struct drm_bridge *bridge)
+static void sii902x_bridge_enable(struct drm_bridge *bridge,
+				  const struct drm_connector_state *conn_state)
 {
 	struct sii902x *sii902x = bridge_to_sii902x(bridge);
 
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index ec8d0006ef7c..5c7a2751c42b 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2011,7 +2011,8 @@ static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge,
 	mutex_unlock(&hdmi->mutex);
 }
 
-static void dw_hdmi_bridge_disable(struct drm_bridge *bridge)
+static void dw_hdmi_bridge_disable(struct drm_bridge *bridge,
+				   const struct drm_connector_state *conn_state)
 {
 	struct dw_hdmi *hdmi = bridge->driver_private;
 
@@ -2022,7 +2023,8 @@ static void dw_hdmi_bridge_disable(struct drm_bridge *bridge)
 	mutex_unlock(&hdmi->mutex);
 }
 
-static void dw_hdmi_bridge_enable(struct drm_bridge *bridge)
+static void dw_hdmi_bridge_enable(struct drm_bridge *bridge,
+				  const struct drm_connector_state *conn_state)
 {
 	struct dw_hdmi *hdmi = bridge->driver_private;
 
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index 0c7ecf798874..c4ad7659556d 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -735,7 +735,8 @@ static void dw_mipi_dsi_clear_err(struct dw_mipi_dsi *dsi)
 	dsi_write(dsi, DSI_INT_MSK1, 0);
 }
 
-static void dw_mipi_dsi_bridge_post_disable(struct drm_bridge *bridge)
+static void dw_mipi_dsi_bridge_post_disable(struct drm_bridge *bridge,
+					    const struct drm_connector_state *conn_state)
 {
 	struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge);
 
@@ -753,7 +754,7 @@ static void dw_mipi_dsi_bridge_post_disable(struct drm_bridge *bridge)
 	 * This needs to be fixed in the drm_bridge framework and the API
 	 * needs to be updated to manage our own call chains...
 	 */
-	dsi->panel_bridge->funcs->post_disable(dsi->panel_bridge);
+	dsi->panel_bridge->funcs->post_disable(dsi->panel_bridge, conn_state);
 
 	dw_mipi_dsi_disable(dsi);
 	clk_disable_unprepare(dsi->pclk);
@@ -804,7 +805,8 @@ static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge,
 	dw_mipi_dsi_set_mode(dsi, 0);
 }
 
-static void dw_mipi_dsi_bridge_enable(struct drm_bridge *bridge)
+static void dw_mipi_dsi_bridge_enable(struct drm_bridge *bridge,
+				      const struct drm_connector_state *conn_state)
 {
 	struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge);
 
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index 08ab7d6aea65..d539657c85d7 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1044,14 +1044,16 @@ static int tc_main_link_stream(struct tc_data *tc, int state)
 	return ret;
 }
 
-static void tc_bridge_pre_enable(struct drm_bridge *bridge)
+static void tc_bridge_pre_enable(struct drm_bridge *bridge,
+				 const struct drm_connector_state *conn_state)
 {
 	struct tc_data *tc = bridge_to_tc(bridge);
 
 	drm_panel_prepare(tc->panel);
 }
 
-static void tc_bridge_enable(struct drm_bridge *bridge)
+static void tc_bridge_enable(struct drm_bridge *bridge,
+			     const struct drm_connector_state *conn_state)
 {
 	struct tc_data *tc = bridge_to_tc(bridge);
 	int ret;
@@ -1071,7 +1073,8 @@ static void tc_bridge_enable(struct drm_bridge *bridge)
 	drm_panel_enable(tc->panel);
 }
 
-static void tc_bridge_disable(struct drm_bridge *bridge)
+static void tc_bridge_disable(struct drm_bridge *bridge,
+			      const struct drm_connector_state *conn_state)
 {
 	struct tc_data *tc = bridge_to_tc(bridge);
 	int ret;
@@ -1083,7 +1086,8 @@ static void tc_bridge_disable(struct drm_bridge *bridge)
 		dev_err(tc->dev, "main link stream stop error: %d\n", ret);
 }
 
-static void tc_bridge_post_disable(struct drm_bridge *bridge)
+static void tc_bridge_post_disable(struct drm_bridge *bridge,
+				   const struct drm_connector_state *conn_state)
 {
 	struct tc_data *tc = bridge_to_tc(bridge);
 
diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c
index c8b9edd5a7f4..bdd76fbb4360 100644
--- a/drivers/gpu/drm/bridge/thc63lvd1024.c
+++ b/drivers/gpu/drm/bridge/thc63lvd1024.c
@@ -45,7 +45,8 @@ static int thc63_attach(struct drm_bridge *bridge)
 	return drm_bridge_attach(bridge->encoder, thc63->next, bridge);
 }
 
-static void thc63_enable(struct drm_bridge *bridge)
+static void thc63_enable(struct drm_bridge *bridge,
+			 const struct drm_connector_state *conn_state)
 {
 	struct thc63_dev *thc63 = to_thc63(bridge);
 	int ret;
@@ -61,7 +62,8 @@ static void thc63_enable(struct drm_bridge *bridge)
 	gpiod_set_value(thc63->oe, 1);
 }
 
-static void thc63_disable(struct drm_bridge *bridge)
+static void thc63_disable(struct drm_bridge *bridge,
+			  const struct drm_connector_state *conn_state)
 {
 	struct thc63_dev *thc63 = to_thc63(bridge);
 	int ret;
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 9cb2209f6fc8..1ca38e6f9316 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -950,7 +950,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
 		 * Each encoder has at most one connector (since we always steal
 		 * it away), so we won't call disable hooks twice.
 		 */
-		drm_bridge_disable(encoder->bridge);
+		drm_bridge_disable(encoder->bridge, new_conn_state);
 
 		/* Right function depends upon target state. */
 		if (funcs) {
@@ -962,7 +962,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
 				funcs->dpms(encoder, DRM_MODE_DPMS_OFF);
 		}
 
-		drm_bridge_post_disable(encoder->bridge);
+		drm_bridge_post_disable(encoder->bridge, new_conn_state);
 	}
 
 	for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) {
@@ -1240,7 +1240,7 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
 		 * Each encoder has at most one connector (since we always steal
 		 * it away), so we won't call enable hooks twice.
 		 */
-		drm_bridge_pre_enable(encoder->bridge);
+		drm_bridge_pre_enable(encoder->bridge, new_conn_state);
 
 		if (funcs) {
 			if (funcs->enable)
@@ -1249,7 +1249,7 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
 				funcs->commit(encoder);
 		}
 
-		drm_bridge_enable(encoder->bridge);
+		drm_bridge_enable(encoder->bridge, new_conn_state);
 	}
 }
 EXPORT_SYMBOL(drm_atomic_helper_commit_modeset_enables);
diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index 1638bfe9627c..4b9c1e46e7f8 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -236,6 +236,7 @@ EXPORT_SYMBOL(drm_bridge_mode_valid);
 /**
  * drm_bridge_disable - disables all bridges in the encoder chain
  * @bridge: bridge control structure
+ * @conn_state: atomic state of the connecter at the end of the bridges chain
  *
  * Calls &drm_bridge_funcs.disable op for all the bridges in the encoder
  * chain, starting from the last bridge to the first. These are called before
@@ -243,21 +244,23 @@ EXPORT_SYMBOL(drm_bridge_mode_valid);
  *
  * Note: the bridge passed should be the one closest to the encoder
  */
-void drm_bridge_disable(struct drm_bridge *bridge)
+void drm_bridge_disable(struct drm_bridge *bridge,
+			const struct drm_connector_state *conn_state)
 {
 	if (!bridge)
 		return;
 
-	drm_bridge_disable(bridge->next);
+	drm_bridge_disable(bridge->next, conn_state);
 
 	if (bridge->funcs->disable)
-		bridge->funcs->disable(bridge);
+		bridge->funcs->disable(bridge, conn_state);
 }
 EXPORT_SYMBOL(drm_bridge_disable);
 
 /**
  * drm_bridge_post_disable - cleans up after disabling all bridges in the encoder chain
  * @bridge: bridge control structure
+ * @conn_state: atomic state of the connecter at the end of the bridges chain
  *
  * Calls &drm_bridge_funcs.post_disable op for all the bridges in the
  * encoder chain, starting from the first bridge to the last. These are called
@@ -265,15 +268,16 @@ EXPORT_SYMBOL(drm_bridge_disable);
  *
  * Note: the bridge passed should be the one closest to the encoder
  */
-void drm_bridge_post_disable(struct drm_bridge *bridge)
+void drm_bridge_post_disable(struct drm_bridge *bridge,
+			     const struct drm_connector_state *conn_state)
 {
 	if (!bridge)
 		return;
 
 	if (bridge->funcs->post_disable)
-		bridge->funcs->post_disable(bridge);
+		bridge->funcs->post_disable(bridge, conn_state);
 
-	drm_bridge_post_disable(bridge->next);
+	drm_bridge_post_disable(bridge->next, conn_state);
 }
 EXPORT_SYMBOL(drm_bridge_post_disable);
 
@@ -307,6 +311,7 @@ EXPORT_SYMBOL(drm_bridge_mode_set);
  * drm_bridge_pre_enable - prepares for enabling all
  *			   bridges in the encoder chain
  * @bridge: bridge control structure
+ * @conn_state: atomic state of the connecter at the end of the bridges chain
  *
  * Calls &drm_bridge_funcs.pre_enable op for all the bridges in the encoder
  * chain, starting from the last bridge to the first. These are called
@@ -314,21 +319,23 @@ EXPORT_SYMBOL(drm_bridge_mode_set);
  *
  * Note: the bridge passed should be the one closest to the encoder
  */
-void drm_bridge_pre_enable(struct drm_bridge *bridge)
+void drm_bridge_pre_enable(struct drm_bridge *bridge,
+			   const struct drm_connector_state *conn_state)
 {
 	if (!bridge)
 		return;
 
-	drm_bridge_pre_enable(bridge->next);
+	drm_bridge_pre_enable(bridge->next, conn_state);
 
 	if (bridge->funcs->pre_enable)
-		bridge->funcs->pre_enable(bridge);
+		bridge->funcs->pre_enable(bridge, conn_state);
 }
 EXPORT_SYMBOL(drm_bridge_pre_enable);
 
 /**
  * drm_bridge_enable - enables all bridges in the encoder chain
  * @bridge: bridge control structure
+ * @conn_state: atomic state of the connecter at the end of the bridges chain
  *
  * Calls &drm_bridge_funcs.enable op for all the bridges in the encoder
  * chain, starting from the first bridge to the last. These are called
@@ -336,15 +343,16 @@ EXPORT_SYMBOL(drm_bridge_pre_enable);
  *
  * Note that the bridge passed should be the one closest to the encoder
  */
-void drm_bridge_enable(struct drm_bridge *bridge)
+void drm_bridge_enable(struct drm_bridge *bridge,
+		       const struct drm_connector_state *conn_state)
 {
 	if (!bridge)
 		return;
 
 	if (bridge->funcs->enable)
-		bridge->funcs->enable(bridge);
+		bridge->funcs->enable(bridge, conn_state);
 
-	drm_bridge_enable(bridge->next);
+	drm_bridge_enable(bridge->next, conn_state);
 }
 EXPORT_SYMBOL(drm_bridge_enable);
 
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 5a84c3bc915d..59d483766287 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -152,14 +152,14 @@ drm_encoder_disable(struct drm_encoder *encoder)
 	if (!encoder_funcs)
 		return;
 
-	drm_bridge_disable(encoder->bridge);
+	drm_bridge_disable(encoder->bridge, NULL);
 
 	if (encoder_funcs->disable)
 		(*encoder_funcs->disable)(encoder);
 	else if (encoder_funcs->dpms)
 		(*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
 
-	drm_bridge_post_disable(encoder->bridge);
+	drm_bridge_post_disable(encoder->bridge, NULL);
 }
 
 static void __drm_helper_disable_unused_functions(struct drm_device *dev)
@@ -356,13 +356,13 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
 		if (!encoder_funcs)
 			continue;
 
-		drm_bridge_disable(encoder->bridge);
+		drm_bridge_disable(encoder->bridge, NULL);
 
 		/* Disable the encoders as the first thing we do. */
 		if (encoder_funcs->prepare)
 			encoder_funcs->prepare(encoder);
 
-		drm_bridge_post_disable(encoder->bridge);
+		drm_bridge_post_disable(encoder->bridge, NULL);
 	}
 
 	drm_crtc_prepare_encoders(dev);
@@ -406,12 +406,12 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
 		if (!encoder_funcs)
 			continue;
 
-		drm_bridge_pre_enable(encoder->bridge);
+		drm_bridge_pre_enable(encoder->bridge, NULL);
 
 		if (encoder_funcs->commit)
 			encoder_funcs->commit(encoder);
 
-		drm_bridge_enable(encoder->bridge);
+		drm_bridge_enable(encoder->bridge, NULL);
 	}
 
 	/* Calculate and store various constants which
@@ -817,17 +817,17 @@ static void drm_helper_encoder_dpms(struct drm_encoder *encoder, int mode)
 		return;
 
 	if (mode == DRM_MODE_DPMS_ON)
-		drm_bridge_pre_enable(bridge);
+		drm_bridge_pre_enable(bridge, NULL);
 	else
-		drm_bridge_disable(bridge);
+		drm_bridge_disable(bridge, NULL);
 
 	if (encoder_funcs->dpms)
 		encoder_funcs->dpms(encoder, mode);
 
 	if (mode == DRM_MODE_DPMS_ON)
-		drm_bridge_enable(bridge);
+		drm_bridge_enable(bridge, NULL);
 	else
-		drm_bridge_post_disable(bridge);
+		drm_bridge_post_disable(bridge, NULL);
 }
 
 static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
index 2174814273e2..0615c38f634d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
@@ -226,9 +226,13 @@ static void mic_set_reg_on(struct exynos_mic *mic, bool enable)
 	writel(reg, mic->reg + MIC_OP);
 }
 
-static void mic_disable(struct drm_bridge *bridge) { }
+static void mic_disable(struct drm_bridge *bridge,
+			const struct drm_connector_state *conn_state)
+{
+}
 
-static void mic_post_disable(struct drm_bridge *bridge)
+static void mic_post_disable(struct drm_bridge *bridge,
+			     const struct drm_connector_state *conn_state)
 {
 	struct exynos_mic *mic = bridge->driver_private;
 
@@ -257,7 +261,8 @@ static void mic_mode_set(struct drm_bridge *bridge,
 	mutex_unlock(&mic_mutex);
 }
 
-static void mic_pre_enable(struct drm_bridge *bridge)
+static void mic_pre_enable(struct drm_bridge *bridge,
+			   const struct drm_connector_state *conn_state)
 {
 	struct exynos_mic *mic = bridge->driver_private;
 	int ret;
@@ -294,7 +299,10 @@ static void mic_pre_enable(struct drm_bridge *bridge)
 	mutex_unlock(&mic_mutex);
 }
 
-static void mic_enable(struct drm_bridge *bridge) { }
+static void mic_enable(struct drm_bridge *bridge,
+		       const struct drm_connector_state *conn_state)
+{
+}
 
 static const struct drm_bridge_funcs mic_bridge_funcs = {
 	.disable = mic_disable,
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 59a11026dceb..4f7db1a892ba 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -1336,7 +1336,8 @@ static bool mtk_hdmi_bridge_mode_fixup(struct drm_bridge *bridge,
 	return true;
 }
 
-static void mtk_hdmi_bridge_disable(struct drm_bridge *bridge)
+static void mtk_hdmi_bridge_disable(struct drm_bridge *bridge,
+				    const struct drm_connector_state *conn_state)
 {
 	struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
 
@@ -1350,7 +1351,8 @@ static void mtk_hdmi_bridge_disable(struct drm_bridge *bridge)
 	hdmi->enabled = false;
 }
 
-static void mtk_hdmi_bridge_post_disable(struct drm_bridge *bridge)
+static void mtk_hdmi_bridge_post_disable(struct drm_bridge *bridge,
+					 const struct drm_connector_state *conn_state)
 {
 	struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
 
@@ -1385,7 +1387,8 @@ static void mtk_hdmi_bridge_mode_set(struct drm_bridge *bridge,
 	drm_mode_copy(&hdmi->mode, adjusted_mode);
 }
 
-static void mtk_hdmi_bridge_pre_enable(struct drm_bridge *bridge)
+static void mtk_hdmi_bridge_pre_enable(struct drm_bridge *bridge,
+				       const struct drm_connector_state *conn_state)
 {
 	struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
 
@@ -1405,7 +1408,8 @@ static void mtk_hdmi_send_infoframe(struct mtk_hdmi *hdmi,
 		mtk_hdmi_setup_vendor_specific_infoframe(hdmi, mode);
 }
 
-static void mtk_hdmi_bridge_enable(struct drm_bridge *bridge)
+static void mtk_hdmi_bridge_enable(struct drm_bridge *bridge,
+				   const struct drm_connector_state *conn_state)
 {
 	struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
 
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index 4cb1cb68878b..0c7b91fb8766 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -435,7 +435,8 @@ dsi_mgr_connector_best_encoder(struct drm_connector *connector)
 	return msm_dsi_get_encoder(msm_dsi);
 }
 
-static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
+static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge,
+				      const struct drm_connector_state *conn_state)
 {
 	int id = dsi_mgr_bridge_get_id(bridge);
 	struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
@@ -530,17 +531,20 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge)
 	return;
 }
 
-static void dsi_mgr_bridge_enable(struct drm_bridge *bridge)
+static void dsi_mgr_bridge_enable(struct drm_bridge *bridge,
+				  const struct drm_connector_state *conn_state)
 {
 	DBG("");
 }
 
-static void dsi_mgr_bridge_disable(struct drm_bridge *bridge)
+static void dsi_mgr_bridge_disable(struct drm_bridge *bridge,
+				   const struct drm_connector_state *conn_state)
 {
 	DBG("");
 }
 
-static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge)
+static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge,
+					const struct drm_connector_state *conn_state)
 {
 	int id = dsi_mgr_bridge_get_id(bridge);
 	struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
diff --git a/drivers/gpu/drm/msm/edp/edp_bridge.c b/drivers/gpu/drm/msm/edp/edp_bridge.c
index 931a5c97cccf..c2a4db0803ce 100644
--- a/drivers/gpu/drm/msm/edp/edp_bridge.c
+++ b/drivers/gpu/drm/msm/edp/edp_bridge.c
@@ -23,7 +23,8 @@ void edp_bridge_destroy(struct drm_bridge *bridge)
 {
 }
 
-static void edp_bridge_pre_enable(struct drm_bridge *bridge)
+static void edp_bridge_pre_enable(struct drm_bridge *bridge,
+				  const struct drm_connector_state *conn_state)
 {
 	struct edp_bridge *edp_bridge = to_edp_bridge(bridge);
 	struct msm_edp *edp = edp_bridge->edp;
@@ -32,17 +33,20 @@ static void edp_bridge_pre_enable(struct drm_bridge *bridge)
 	msm_edp_ctrl_power(edp->ctrl, true);
 }
 
-static void edp_bridge_enable(struct drm_bridge *bridge)
+static void edp_bridge_enable(struct drm_bridge *bridge,
+			      const struct drm_connector_state *conn_state)
 {
 	DBG("");
 }
 
-static void edp_bridge_disable(struct drm_bridge *bridge)
+static void edp_bridge_disable(struct drm_bridge *bridge,
+			       const struct drm_connector_state *conn_state)
 {
 	DBG("");
 }
 
-static void edp_bridge_post_disable(struct drm_bridge *bridge)
+static void edp_bridge_post_disable(struct drm_bridge *bridge,
+				    const struct drm_connector_state *conn_state)
 {
 	struct edp_bridge *edp_bridge = to_edp_bridge(bridge);
 	struct msm_edp *edp = edp_bridge->edp;
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
index 7e357077ed26..338f1c2e7ef2 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
@@ -149,7 +149,8 @@ static void msm_hdmi_config_avi_infoframe(struct hdmi *hdmi)
 	hdmi_write(hdmi, REG_HDMI_INFOFRAME_CTRL1, val);
 }
 
-static void msm_hdmi_bridge_pre_enable(struct drm_bridge *bridge)
+static void msm_hdmi_bridge_pre_enable(struct drm_bridge *bridge,
+				       const struct drm_connector_state *conn_state)
 {
 	struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge);
 	struct hdmi *hdmi = hdmi_bridge->hdmi;
@@ -175,15 +176,18 @@ static void msm_hdmi_bridge_pre_enable(struct drm_bridge *bridge)
 		msm_hdmi_hdcp_on(hdmi->hdcp_ctrl);
 }
 
-static void msm_hdmi_bridge_enable(struct drm_bridge *bridge)
+static void msm_hdmi_bridge_enable(struct drm_bridge *bridge,
+				   const struct drm_connector_state *conn_state)
 {
 }
 
-static void msm_hdmi_bridge_disable(struct drm_bridge *bridge)
+static void msm_hdmi_bridge_disable(struct drm_bridge *bridge,
+				    const struct drm_connector_state *conn_state)
 {
 }
 
-static void msm_hdmi_bridge_post_disable(struct drm_bridge *bridge)
+static void msm_hdmi_bridge_post_disable(struct drm_bridge *bridge,
+					 const struct drm_connector_state *conn_state)
 {
 	struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge);
 	struct hdmi *hdmi = hdmi_bridge->hdmi;
diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index 3d2d3bbd1342..65f9a3659c62 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -152,7 +152,8 @@ static u32 rcar_lvds_lvdpllcr_gen3(unsigned int freq)
 		return LVDPLLCR_PLLDIVCNT_148M;
 }
 
-static void rcar_lvds_enable(struct drm_bridge *bridge)
+static void rcar_lvds_enable(struct drm_bridge *bridge,
+			     const struct drm_connector_state *conn_state)
 {
 	struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
 	const struct drm_display_mode *mode = &lvds->display_mode;
@@ -248,7 +249,8 @@ static void rcar_lvds_enable(struct drm_bridge *bridge)
 	lvds->enabled = true;
 }
 
-static void rcar_lvds_disable(struct drm_bridge *bridge)
+static void rcar_lvds_disable(struct drm_bridge *bridge,
+			      const struct drm_connector_state *conn_state)
 {
 	struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
 
diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index a5979cd25cc7..37c1b5a18ca3 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -206,7 +206,8 @@ static int dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor)
 					minor->debugfs_root, minor);
 }
 
-static void sti_dvo_disable(struct drm_bridge *bridge)
+static void sti_dvo_disable(struct drm_bridge *bridge,
+			    const struct drm_connector_state *conn_state)
 {
 	struct sti_dvo *dvo = bridge->driver_private;
 
@@ -230,7 +231,8 @@ static void sti_dvo_disable(struct drm_bridge *bridge)
 	dvo->enabled = false;
 }
 
-static void sti_dvo_pre_enable(struct drm_bridge *bridge)
+static void sti_dvo_pre_enable(struct drm_bridge *bridge,
+			       const struct drm_connector_state *conn_state)
 {
 	struct sti_dvo *dvo = bridge->driver_private;
 	struct dvo_config *config = dvo->config;
@@ -319,7 +321,8 @@ static void sti_dvo_set_mode(struct drm_bridge *bridge,
 	dvo->config = &rgb_24bit_de_cfg;
 }
 
-static void sti_dvo_bridge_nope(struct drm_bridge *bridge)
+static void sti_dvo_bridge_nope(struct drm_bridge *bridge,
+				const struct drm_connector_state *conn_state)
 {
 	/* do nothing */
 }
diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index 67bbdb49fffc..28940b586cfd 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -393,7 +393,8 @@ static void sti_hda_configure_awg(struct sti_hda *hda, u32 *awg_instr, int nb)
 		hda_write(hda, 0, HDA_SYNC_AWGI + i * 4);
 }
 
-static void sti_hda_disable(struct drm_bridge *bridge)
+static void sti_hda_disable(struct drm_bridge *bridge,
+			    const struct drm_connector_state *conn_state)
 {
 	struct sti_hda *hda = bridge->driver_private;
 	u32 val;
@@ -418,7 +419,8 @@ static void sti_hda_disable(struct drm_bridge *bridge)
 	hda->enabled = false;
 }
 
-static void sti_hda_pre_enable(struct drm_bridge *bridge)
+static void sti_hda_pre_enable(struct drm_bridge *bridge,
+			       const struct drm_connector_state *conn_state)
 {
 	struct sti_hda *hda = bridge->driver_private;
 	u32 val, i, mode_idx;
@@ -552,7 +554,8 @@ static void sti_hda_set_mode(struct drm_bridge *bridge,
 			  mode->clock * 1000);
 }
 
-static void sti_hda_bridge_nope(struct drm_bridge *bridge)
+static void sti_hda_bridge_nope(struct drm_bridge *bridge,
+				const struct drm_connector_state *conn_state)
 {
 	/* do nothing */
 }
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 58f431102512..2c08d242214b 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -734,7 +734,8 @@ static int hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor)
 					minor->debugfs_root, minor);
 }
 
-static void sti_hdmi_disable(struct drm_bridge *bridge)
+static void sti_hdmi_disable(struct drm_bridge *bridge,
+			     const struct drm_connector_state *conn_state)
 {
 	struct sti_hdmi *hdmi = bridge->driver_private;
 
@@ -863,7 +864,8 @@ static int hdmi_audio_configure(struct sti_hdmi *hdmi)
 	return hdmi_audio_infoframe_config(hdmi);
 }
 
-static void sti_hdmi_pre_enable(struct drm_bridge *bridge)
+static void sti_hdmi_pre_enable(struct drm_bridge *bridge,
+				const struct drm_connector_state *conn_state)
 {
 	struct sti_hdmi *hdmi = bridge->driver_private;
 
@@ -943,7 +945,8 @@ static void sti_hdmi_set_mode(struct drm_bridge *bridge,
 	}
 }
 
-static void sti_hdmi_bridge_nope(struct drm_bridge *bridge)
+static void sti_hdmi_bridge_nope(struct drm_bridge *bridge,
+				 const struct drm_connector_state *conn_state)
 {
 	/* do nothing */
 }
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index 3270fec46979..03653d1c0343 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -30,6 +30,7 @@
 
 struct drm_bridge;
 struct drm_bridge_timings;
+struct drm_connector_state;
 struct drm_panel;
 
 /**
@@ -148,7 +149,8 @@ struct drm_bridge_funcs {
 	 *
 	 * The disable callback is optional.
 	 */
-	void (*disable)(struct drm_bridge *bridge);
+	void (*disable)(struct drm_bridge *bridge,
+			const struct drm_connector_state *conn_state);
 
 	/**
 	 * @post_disable:
@@ -167,7 +169,8 @@ struct drm_bridge_funcs {
 	 *
 	 * The post_disable callback is optional.
 	 */
-	void (*post_disable)(struct drm_bridge *bridge);
+	void (*post_disable)(struct drm_bridge *bridge,
+			     const struct drm_connector_state *conn_state);
 
 	/**
 	 * @mode_set:
@@ -200,7 +203,8 @@ struct drm_bridge_funcs {
 	 *
 	 * The pre_enable callback is optional.
 	 */
-	void (*pre_enable)(struct drm_bridge *bridge);
+	void (*pre_enable)(struct drm_bridge *bridge,
+			   const struct drm_connector_state *conn_state);
 
 	/**
 	 * @enable:
@@ -220,7 +224,8 @@ struct drm_bridge_funcs {
 	 *
 	 * The enable callback is optional.
 	 */
-	void (*enable)(struct drm_bridge *bridge);
+	void (*enable)(struct drm_bridge *bridge,
+		       const struct drm_connector_state *conn_state);
 };
 
 /**
@@ -289,13 +294,17 @@ bool drm_bridge_mode_fixup(struct drm_bridge *bridge,
 			struct drm_display_mode *adjusted_mode);
 enum drm_mode_status drm_bridge_mode_valid(struct drm_bridge *bridge,
 					   const struct drm_display_mode *mode);
-void drm_bridge_disable(struct drm_bridge *bridge);
-void drm_bridge_post_disable(struct drm_bridge *bridge);
+void drm_bridge_disable(struct drm_bridge *bridge,
+			const struct drm_connector_state *conn_state);
+void drm_bridge_post_disable(struct drm_bridge *bridge,
+			     const struct drm_connector_state *conn_state);
 void drm_bridge_mode_set(struct drm_bridge *bridge,
 			struct drm_display_mode *mode,
 			struct drm_display_mode *adjusted_mode);
-void drm_bridge_pre_enable(struct drm_bridge *bridge);
-void drm_bridge_enable(struct drm_bridge *bridge);
+void drm_bridge_pre_enable(struct drm_bridge *bridge,
+			   const struct drm_connector_state *conn_state);
+void drm_bridge_enable(struct drm_bridge *bridge,
+		       const struct drm_connector_state *conn_state);
 
 #ifdef CONFIG_DRM_PANEL_BRIDGE
 struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel,
-- 
Regards,

Laurent Pinchart



More information about the dri-devel mailing list