@@ -10,6 +10,7 @@ config DRM_MXSFB
depends on COMMON_CLK
depends on ARCH_MXS || ARCH_MXC || COMPILE_TEST
select DRM_CLIENT_SELECTION
+ select DRM_DISPLAY_HELPER
select DRM_MXS
select DRM_KMS_HELPER
select DRM_BRIDGE_CONNECTOR
@@ -32,6 +33,7 @@ config DRM_IMX_LCDIF
select DRM_DISPLAY_HELPER
select DRM_MXS
select DRM_KMS_HELPER
+ select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER
select DRM_PANEL
select DRM_PANEL_BRIDGE
@@ -20,6 +20,7 @@
#include <drm/clients/drm_client_setup.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/drm_connector.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_dma.h>
@@ -119,9 +120,9 @@ static const struct drm_mode_config_helper_funcs mxsfb_mode_config_helpers = {
static int mxsfb_attach_bridge(struct mxsfb_drm_private *mxsfb)
{
struct drm_device *drm = mxsfb->drm;
- struct drm_connector_list_iter iter;
- struct drm_panel *panel;
+ struct drm_connector *connector;
struct drm_bridge *bridge;
+ struct drm_panel *panel;
int ret;
ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel,
@@ -139,19 +140,27 @@ static int mxsfb_attach_bridge(struct mxsfb_drm_private *mxsfb)
if (!bridge)
return -ENODEV;
- ret = drm_bridge_attach(&mxsfb->encoder, bridge, NULL, 0);
+ ret = drm_bridge_attach(&mxsfb->encoder, bridge, NULL,
+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret)
return dev_err_probe(drm->dev, ret, "Failed to attach bridge\n");
- mxsfb->bridge = bridge;
+ connector = drm_bridge_connector_init(drm, &mxsfb->encoder);
+ if (IS_ERR(connector)) {
+ return dev_err_probe(drm->dev, PTR_ERR(connector),
+ "Failed to initialize bridge connector: %pe\n",
+ connector);
+ }
- /*
- * Get hold of the connector. This is a bit of a hack, until the bridge
- * API gives us bus flags and formats.
- */
- drm_connector_list_iter_begin(drm, &iter);
- mxsfb->connector = drm_connector_list_iter_next(&iter);
- drm_connector_list_iter_end(&iter);
+ ret = drm_connector_attach_encoder(connector, &mxsfb->encoder);
+ if (ret < 0) {
+ drm_connector_cleanup(connector);
+ return dev_err_probe(drm->dev, ret,
+ "Failed to attach encoder.\n");
+ }
+
+ mxsfb->bridge = bridge;
+ mxsfb->connector = connector;
return 0;
}