1 From cc948130d3e1c70ef21ae9963b56e0d500cef70b Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 5 Dec 2023 18:29:34 +0000
4 Subject: [PATCH] drm/vc4: Mop and moplet have different register offsets for
7 MOP uses register offset 0x24 for the high bits of the address,
8 whilst Moplet uses 0x1c.
10 Handle this difference between the block types.
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
14 drivers/gpu/drm/vc4/vc4_drv.h | 1 +
15 drivers/gpu/drm/vc4/vc4_txp.c | 8 ++++++--
16 2 files changed, 7 insertions(+), 2 deletions(-)
18 --- a/drivers/gpu/drm/vc4/vc4_drv.h
19 +++ b/drivers/gpu/drm/vc4/vc4_drv.h
20 @@ -564,6 +564,7 @@ struct vc4_crtc_data {
22 struct vc4_crtc_data base;
23 enum vc4_encoder_type encoder_type;
24 + unsigned int high_addr_ptr_reg;
25 unsigned int has_byte_enable:1;
26 unsigned int size_minus_one:1;
27 unsigned int supports_40bit_addresses:1;
28 --- a/drivers/gpu/drm/vc4/vc4_txp.c
29 +++ b/drivers/gpu/drm/vc4/vc4_txp.c
31 /* Number of lines received and committed to memory. */
32 #define TXP_PROGRESS 0x10
34 -#define TXP_DST_PTR_HIGH 0x1c
35 +#define TXP_DST_PTR_HIGH_MOPLET 0x1c
36 +#define TXP_DST_PTR_HIGH_MOP 0x24
38 #define TXP_READ(offset) \
40 @@ -338,10 +339,11 @@ static void vc4_txp_connector_atomic_com
42 gem = drm_fb_dma_get_gem_obj(fb, 0);
43 addr = gem->dma_addr + fb->offsets[0];
45 TXP_WRITE(TXP_DST_PTR, lower_32_bits(addr));
47 if (txp_data->supports_40bit_addresses)
48 - TXP_WRITE(TXP_DST_PTR_HIGH, upper_32_bits(addr) & 0xff);
49 + TXP_WRITE(txp_data->high_addr_ptr_reg, upper_32_bits(addr) & 0xff);
51 TXP_WRITE(TXP_DST_PITCH, fb->pitches[0]);
53 @@ -520,6 +522,7 @@ const struct vc4_txp_data bcm2712_mop_da
56 .encoder_type = VC4_ENCODER_TYPE_TXP0,
57 + .high_addr_ptr_reg = TXP_DST_PTR_HIGH_MOP,
58 .has_byte_enable = true,
59 .size_minus_one = true,
60 .supports_40bit_addresses = true,
61 @@ -533,6 +536,7 @@ const struct vc4_txp_data bcm2712_moplet
64 .encoder_type = VC4_ENCODER_TYPE_TXP1,
65 + .high_addr_ptr_reg = TXP_DST_PTR_HIGH_MOPLET,
66 .size_minus_one = true,
67 .supports_40bit_addresses = true,