drm/vc4: txp: Move the encoder type in the variant structure
authorMaxime Ripard <maxime@cerno.tech>
Thu, 27 Apr 2023 09:26:10 +0000 (11:26 +0200)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:34:59 +0000 (11:34 +0000)
We'll have multiple TXP instances in the BCM2712, so we can't use a
single encoder type anymore. Let's tie the encoder type to the
compatible.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_txp.c

index 3596c01..afc452d 100644 (file)
@@ -548,6 +548,7 @@ struct vc4_crtc_data {
 
 struct vc4_txp_data {
        struct vc4_crtc_data    base;
+       enum vc4_encoder_type encoder_type;
        unsigned int has_byte_enable:1;
        unsigned int size_minus_one:1;
        unsigned int supports_40bit_addresses:1;
index 1858947..f181f7e 100644 (file)
@@ -513,6 +513,7 @@ const struct vc4_txp_data bcm2835_txp_data = {
                .hvs_available_channels = BIT(2),
                .hvs_output = 2,
        },
+       .encoder_type = VC4_ENCODER_TYPE_TXP,
        .has_byte_enable = true,
 };
 
@@ -556,7 +557,7 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data)
                return ret;
 
        vc4_encoder = &txp->encoder;
-       txp->encoder.type = VC4_ENCODER_TYPE_TXP;
+       txp->encoder.type = txp_data->encoder_type;
 
        encoder = &vc4_encoder->base;
        encoder->possible_crtcs = drm_crtc_mask(&vc4_crtc->base);