d41d53ecbed70715b993bfeed77582e4621875a1
[openwrt/staging/pepe2k.git] /
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
5 function
6
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.
10
11 We already have the correct limit in __vc4_hvs_alloc, so
12 store it for use in the debugfs dlist function.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 ---
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(-)
19
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;
24 void __iomem *regs;
25 u32 __iomem *dlist;
26 + unsigned int dlist_mem_size;
27
28 struct clk *core_clk;
29
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;
38 unsigned int i, j;
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);
42 next_entry_start = 0;
43
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,
48 dlist_word);
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);
52
53 + hvs->dlist_mem_size = dlist_size;
54 +
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