summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2020-09-11 15:54:10 +0200
committerLucas Stach <l.stach@pengutronix.de>2021-07-21 22:27:09 +0200
commit1469745878351a130c1617f1cddcd2c17dd0d32b (patch)
tree8058f98d5d91b18bf2b8201b7bb6bd44775b290d
parent5070f11e8d7795f55990a45d351bc7c6cf90eafb (diff)
downloadlinux-1469745878351a130c1617f1cddcd2c17dd0d32b.tar.gz
linux-1469745878351a130c1617f1cddcd2c17dd0d32b.tar.xz
drm/exynos: get encoder from bridge whenever possible
The bridge will not necessarily use the encoder of struct exynos_dsi, but might use another encoder from another drm driver. Therefore, the driver has to use the encoder from the bridge instead of the one from exynos_dsi. In the future, the struct exynos_dsi will not have an encoder at all. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dsi.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index b28df6adf7d9..5fae3395e245 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -303,11 +303,6 @@ struct exynos_dsi {
#define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host)
#define connector_to_dsi(c) container_of(c, struct exynos_dsi, connector)
-static inline struct exynos_dsi *encoder_to_dsi(struct drm_encoder *e)
-{
- return container_of(e, struct exynos_dsi, encoder);
-}
-
enum reg_idx {
DSIM_STATUS_REG, /* Status register */
DSIM_SWRST_REG, /* Software reset register */
@@ -1569,11 +1564,10 @@ static const struct drm_connector_helper_funcs exynos_dsi_connector_helper_funcs
.get_modes = exynos_dsi_get_modes,
};
-static int exynos_dsi_create_connector(struct drm_encoder *encoder)
+static int exynos_dsi_create_connector(struct exynos_dsi *dsi)
{
- struct exynos_dsi *dsi = encoder_to_dsi(encoder);
struct drm_connector *connector = &dsi->connector;
- struct drm_device *drm = encoder->dev;
+ struct drm_device *drm = dsi->bridge.dev;
int ret;
connector->polled = DRM_CONNECTOR_POLL_HPD;
@@ -1588,7 +1582,7 @@ static int exynos_dsi_create_connector(struct drm_encoder *encoder)
connector->status = connector_status_disconnected;
drm_connector_helper_add(connector, &exynos_dsi_connector_helper_funcs);
- drm_connector_attach_encoder(connector, encoder);
+ drm_connector_attach_encoder(connector, dsi->bridge.encoder);
if (!drm->registered)
return 0;
@@ -1614,7 +1608,7 @@ static int exynos_dsi_bridge_attach(struct drm_bridge *bridge,
return ret;
list_splice_init(&encoder->bridge_chain, &dsi->bridge_chain);
} else {
- ret = exynos_dsi_create_connector(encoder);
+ ret = exynos_dsi_create_connector(dsi);
if (ret)
return ret;