drm/vc4: txp: Initialise the CRTC before the encoder and connector
authorMaxime Ripard <maxime@cerno.tech>
Wed, 23 Nov 2022 15:25:58 +0000 (16:25 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Mon, 28 Nov 2022 10:51:07 +0000 (11:51 +0100)
It makes more sense to register the CRTC before the encoder and
connectors, so let's move our call around.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20221123-rpi-kunit-tests-v1-16-051a0bb60a16@cerno.tech
drivers/gpu/drm/vc4/vc4_txp.c

index 0bb8e97d7891aed2f7a262da34d3886e113af7eb..c2a6bea6fd966176bfbb700bc92d82334d046ecf 100644 (file)
@@ -516,6 +516,11 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data)
        vc4_crtc->regset.regs = txp_regs;
        vc4_crtc->regset.nregs = ARRAY_SIZE(txp_regs);
 
+       ret = vc4_crtc_init(drm, vc4_crtc,
+                           &vc4_txp_crtc_funcs, &vc4_txp_crtc_helper_funcs);
+       if (ret)
+               return ret;
+
        vc4_encoder = &txp->encoder;
        txp->encoder.type = VC4_ENCODER_TYPE_TXP;
 
@@ -537,11 +542,6 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data)
        if (ret)
                return ret;
 
-       ret = vc4_crtc_init(drm, vc4_crtc,
-                           &vc4_txp_crtc_funcs, &vc4_txp_crtc_helper_funcs);
-       if (ret)
-               return ret;
-
        ret = devm_request_irq(dev, irq, vc4_txp_interrupt, 0,
                               dev_name(dev), txp);
        if (ret)