0445c4f5097018b66e395ca9ec597041b33cdac8
[openwrt/staging/xback.git] /
1 From 2e8f4fa23af4bb794e9b2284a53aa40bbfdd3cbb Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Thu, 27 Apr 2023 11:26:10 +0200
4 Subject: [PATCH] drm/vc4: txp: Move the encoder type in the variant structure
5
6 We'll have multiple TXP instances in the BCM2712, so we can't use a
7 single encoder type anymore. Let's tie the encoder type to the
8 compatible.
9
10 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
11 ---
12 drivers/gpu/drm/vc4/vc4_drv.h | 1 +
13 drivers/gpu/drm/vc4/vc4_txp.c | 3 ++-
14 2 files changed, 3 insertions(+), 1 deletion(-)
15
16 --- a/drivers/gpu/drm/vc4/vc4_drv.h
17 +++ b/drivers/gpu/drm/vc4/vc4_drv.h
18 @@ -563,6 +563,7 @@ struct vc4_crtc_data {
19
20 struct vc4_txp_data {
21 struct vc4_crtc_data base;
22 + enum vc4_encoder_type encoder_type;
23 unsigned int has_byte_enable:1;
24 unsigned int size_minus_one:1;
25 unsigned int supports_40bit_addresses:1;
26 --- a/drivers/gpu/drm/vc4/vc4_txp.c
27 +++ b/drivers/gpu/drm/vc4/vc4_txp.c
28 @@ -517,6 +517,7 @@ const struct vc4_txp_data bcm2835_txp_da
29 .hvs_available_channels = BIT(2),
30 .hvs_output = 2,
31 },
32 + .encoder_type = VC4_ENCODER_TYPE_TXP,
33 .has_byte_enable = true,
34 };
35
36 @@ -560,7 +561,7 @@ static int vc4_txp_bind(struct device *d
37 return ret;
38
39 vc4_encoder = &txp->encoder;
40 - txp->encoder.type = VC4_ENCODER_TYPE_TXP;
41 + txp->encoder.type = txp_data->encoder_type;
42
43 encoder = &vc4_encoder->base;
44 encoder->possible_crtcs = drm_crtc_mask(&vc4_crtc->base);