drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder
authorBoris Brezillon <boris.brezillon@collabora.com>
Mon, 26 Aug 2019 15:26:36 +0000 (17:26 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Wed, 28 Aug 2019 20:22:49 +0000 (22:22 +0200)
This is part of our attempt to make the bridge chain a double-linked
list based on the generic list helpers. In order to do that, we must
patch all drivers manipulating the encoder->bridge field directly.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sean Paul <sean@poorly.run>
Link: https://patchwork.freedesktop.org/patch/msgid/20190826152649.13820-9-boris.brezillon@collabora.com
drivers/gpu/drm/msm/edp/edp.c
drivers/gpu/drm/msm/hdmi/hdmi.c

index 0f312ac5b6240930a67c400517c08d798fda2e19..ad4e963ccd9b04aa324485e77adcf86d07e8e6d2 100644 (file)
@@ -178,7 +178,9 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
                goto fail;
        }
 
-       encoder->bridge = edp->bridge;
+       ret = drm_bridge_attach(encoder, edp->bridge, NULL);
+       if (ret)
+               goto fail;
 
        priv->bridges[priv->num_bridges++]       = edp->bridge;
        priv->connectors[priv->num_connectors++] = edp->connector;
index 0e4217be3f00f14f9f3133d1bce72a344da2f39c..55b9a8c8312b6bb0b13491e155446d73a5fb163c 100644 (file)
@@ -327,7 +327,9 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
                goto fail;
        }
 
-       encoder->bridge = hdmi->bridge;
+       ret = drm_bridge_attach(encoder, hdmi->bridge, NULL);
+       if (ret)
+               goto fail;
 
        priv->bridges[priv->num_bridges++]       = hdmi->bridge;
        priv->connectors[priv->num_connectors++] = hdmi->connector;