diff options
Diffstat (limited to 'drivers/gpu/drm/msm/dp/dp_drm.c')
-rw-r--r-- | drivers/gpu/drm/msm/dp/dp_drm.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index 785d766394..e3bdd7dd4c 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -272,7 +272,7 @@ static const struct drm_bridge_funcs edp_bridge_ops = { .atomic_check = edp_bridge_atomic_check, }; -struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, +int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, struct drm_encoder *encoder) { int rc; @@ -281,7 +281,7 @@ struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device * dp_bridge = devm_kzalloc(dev->dev, sizeof(*dp_bridge), GFP_KERNEL); if (!dp_bridge) - return ERR_PTR(-ENOMEM); + return -ENOMEM; dp_bridge->dp_display = dp_display; @@ -307,14 +307,18 @@ struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device * DRM_BRIDGE_OP_MODES; } - drm_bridge_add(bridge); + rc = devm_drm_bridge_add(dev->dev, bridge); + if (rc) { + DRM_ERROR("failed to add bridge, rc=%d\n", rc); + + return rc; + } rc = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (rc) { DRM_ERROR("failed to attach bridge, rc=%d\n", rc); - drm_bridge_remove(bridge); - return ERR_PTR(rc); + return rc; } if (dp_display->next_bridge) { @@ -323,12 +327,13 @@ struct drm_bridge *dp_bridge_init(struct msm_dp *dp_display, struct drm_device * DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (rc < 0) { DRM_ERROR("failed to attach panel bridge: %d\n", rc); - drm_bridge_remove(bridge); - return ERR_PTR(rc); + return rc; } } - return bridge; + dp_display->bridge = bridge; + + return 0; } /* connector initialization */ @@ -340,6 +345,9 @@ struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display, struct dr if (IS_ERR(connector)) return connector; + if (!dp_display->is_edp) + drm_connector_attach_dp_subconnector_property(connector); + drm_connector_attach_encoder(connector, encoder); return connector; |