Commit a9d9fea7 authored by Enric Balletbo i Serra's avatar Enric Balletbo i Serra Committed by Chun-Kuang Hu

drm/mediatek: mtk_dsi: Create connector for bridges

Use the drm_bridge_connector helper to create a connector for pipelines
that use drm_bridge. This allows splitting connector operations across
multiple bridges when necessary, instead of having the last bridge in
the chain creating the connector and handling all connector operations
internally.
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
parent 2dd8075d
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h> #include <drm/drm_bridge.h>
#include <drm/drm_bridge_connector.h>
#include <drm/drm_mipi_dsi.h> #include <drm/drm_mipi_dsi.h>
#include <drm/drm_of.h> #include <drm/drm_of.h>
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
...@@ -183,6 +184,7 @@ struct mtk_dsi { ...@@ -183,6 +184,7 @@ struct mtk_dsi {
struct drm_encoder encoder; struct drm_encoder encoder;
struct drm_bridge bridge; struct drm_bridge bridge;
struct drm_bridge *next_bridge; struct drm_bridge *next_bridge;
struct drm_connector *connector;
struct phy *phy; struct phy *phy;
void __iomem *regs; void __iomem *regs;
...@@ -974,10 +976,19 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi) ...@@ -974,10 +976,19 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
*/ */
dsi->encoder.possible_crtcs = 1; dsi->encoder.possible_crtcs = 1;
ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL, 0); ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL,
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret) if (ret)
goto err_cleanup_encoder; goto err_cleanup_encoder;
dsi->connector = drm_bridge_connector_init(drm, &dsi->encoder);
if (IS_ERR(dsi->connector)) {
DRM_ERROR("Unable to create bridge connector\n");
ret = PTR_ERR(dsi->connector);
goto err_cleanup_encoder;
}
drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
return 0; return 0;
err_cleanup_encoder: err_cleanup_encoder:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment