1 From ebf11a4cfd9f1236fb9eeb7e32e87b18f5f56f16 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Fri, 1 Sep 2023 13:45:08 +0100
4 Subject: [PATCH] drm: vc4: Remove incorrect limit from hvs_dlist debugfs
7 The debugfs function to dump dlists aborted at 256 bytes,
8 when actually the dlist memory is generally significantly
9 larger but varies based on SoC.
11 We already have the correct limit in __vc4_hvs_alloc, so
12 store it for use in the debugfs dlist function.
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
16 drivers/gpu/drm/vc4/vc4_drv.h | 1 +
17 drivers/gpu/drm/vc4/vc4_hvs.c | 5 ++++-
18 2 files changed, 5 insertions(+), 1 deletion(-)
20 --- a/drivers/gpu/drm/vc4/vc4_drv.h
21 +++ b/drivers/gpu/drm/vc4/vc4_drv.h
22 @@ -341,6 +341,7 @@ struct vc4_hvs {
23 struct platform_device *pdev;
26 + unsigned int dlist_mem_size;
30 --- a/drivers/gpu/drm/vc4/vc4_hvs.c
31 +++ b/drivers/gpu/drm/vc4/vc4_hvs.c
32 @@ -110,6 +110,7 @@ static int vc4_hvs_debugfs_dlist(struct
33 struct vc4_dev *vc4 = to_vc4_dev(dev);
34 struct vc4_hvs *hvs = vc4->hvs;
35 struct drm_printer p = drm_seq_file_printer(m);
36 + unsigned int dlist_mem_size = hvs->dlist_mem_size;
37 unsigned int next_entry_start;
39 u32 dlist_word, dispstat;
40 @@ -126,7 +127,7 @@ static int vc4_hvs_debugfs_dlist(struct
41 drm_printf(&p, "HVS chan %u:\n", i);
44 - for (j = HVS_READ(SCALER_DISPLISTX(i)); j < 256; j++) {
45 + for (j = HVS_READ(SCALER_DISPLISTX(i)); j < dlist_mem_size; j++) {
46 dlist_word = readl((u32 __iomem *)vc4->hvs->dlist + j);
47 drm_printf(&p, "dlist: %02d: 0x%08x\n", j,
49 @@ -1278,6 +1279,8 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v
50 HVS_BOOTLOADER_DLIST_END,
51 (SCALER_DLIST_SIZE >> 2) - HVS_BOOTLOADER_DLIST_END);
53 + hvs->dlist_mem_size = dlist_size;
55 /* Set up the HVS LBM memory manager. We could have some more
56 * complicated data structure that allowed reuse of LBM areas
57 * between planes when they don't overlap on the screen, but