OSDN Git Service

drm/vc4: dsi: Remove splitting the bridge chain from the driver
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Wed, 7 Dec 2022 10:22:46 +0000 (11:22 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 15 Dec 2022 07:57:17 +0000 (08:57 +0100)
Splitting the bridge chain fails for atomic bridges as the
framework can't add the relevant state in
drm_atomic_add_encoder_bridges.
The chain was split because we needed to power up before
calling pre_enable, but that is now done in mode_set, and will
move into the framework.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20221207-rpi-dsi-bridge-v1-3-8f68ee0b0adb@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_dsi.c

index 51c164c..31b1b12 100644 (file)
@@ -557,7 +557,6 @@ struct vc4_dsi {
        struct platform_device *pdev;
 
        struct drm_bridge *out_bridge;
-       struct list_head bridge_chain;
 
        void __iomem *regs;
 
@@ -801,23 +800,9 @@ static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)
 {
        struct vc4_dsi *dsi = to_vc4_dsi(encoder);
        struct device *dev = &dsi->pdev->dev;
-       struct drm_bridge *iter;
-
-       list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) {
-               if (iter->funcs->disable)
-                       iter->funcs->disable(iter);
-
-               if (iter == dsi->out_bridge)
-                       break;
-       }
 
        vc4_dsi_ulps(dsi, true);
 
-       list_for_each_entry_from(iter, &dsi->bridge_chain, chain_node) {
-               if (iter->funcs->post_disable)
-                       iter->funcs->post_disable(iter);
-       }
-
        clk_disable_unprepare(dsi->pll_phy_clock);
        clk_disable_unprepare(dsi->escape_clock);
        clk_disable_unprepare(dsi->pixel_clock);
@@ -1118,12 +1103,6 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
 {
        struct vc4_dsi *dsi = to_vc4_dsi(encoder);
        bool debug_dump_regs = false;
-       struct drm_bridge *iter;
-
-       list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) {
-               if (iter->funcs->pre_enable)
-                       iter->funcs->pre_enable(iter);
-       }
 
        if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) {
                DSI_PORT_WRITE(DISP0_CTRL,
@@ -1140,11 +1119,6 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
                               DSI_DISP0_ENABLE);
        }
 
-       list_for_each_entry(iter, &dsi->bridge_chain, chain_node) {
-               if (iter->funcs->enable)
-                       iter->funcs->enable(iter);
-       }
-
        if (debug_dump_regs) {
                struct drm_printer p = drm_info_printer(&dsi->pdev->dev);
                dev_info(&dsi->pdev->dev, "DSI regs after:\n");
@@ -1632,7 +1606,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
 
        dsi->variant = of_device_get_match_data(dev);
 
-       INIT_LIST_HEAD(&dsi->bridge_chain);
        dsi->encoder.type = dsi->variant->port ?
                VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0;
 
@@ -1769,32 +1742,12 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
        ret = drm_bridge_attach(encoder, dsi->out_bridge, NULL, 0);
        if (ret)
                return ret;
-       /* Disable the atomic helper calls into the bridge.  We
-        * manually call the bridge pre_enable / enable / etc. calls
-        * from our driver, since we need to sequence them within the
-        * encoder's enable/disable paths.
-        */
-       list_splice_init(&encoder->bridge_chain, &dsi->bridge_chain);
 
        return 0;
 }
 
-static void vc4_dsi_unbind(struct device *dev, struct device *master,
-                          void *data)
-{
-       struct vc4_dsi *dsi = dev_get_drvdata(dev);
-       struct drm_encoder *encoder = &dsi->encoder.base;
-
-       /*
-        * Restore the bridge_chain so the bridge detach procedure can happen
-        * normally.
-        */
-       list_splice_init(&dsi->bridge_chain, &encoder->bridge_chain);
-}
-
 static const struct component_ops vc4_dsi_ops = {
        .bind   = vc4_dsi_bind,
-       .unbind = vc4_dsi_unbind,
 };
 
 static int vc4_dsi_dev_probe(struct platform_device *pdev)