d986de4dd3ec13f126ef56d5b09e15707a6fa082
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.10 / 950-0148-drm-v3d-HACK-gut-runtime-pm-for-now.patch
1 From 1480a99bfef66b0c0f07c90436a873937b656ce7 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Mon, 14 Jan 2019 15:13:17 -0800
4 Subject: [PATCH] drm/v3d: HACK: gut runtime pm for now.
5
6 Something is still unstable -- on starting a new glxgears from an idle
7 X11, I get an MMU violation in high addresses. The CTS also failed
8 quite quickly. With this, CTS progresses for an hour before OOMing
9 (allocating some big buffers when my board only has 600MB available to
10 Linux)
11
12 Signed-off-by: Eric Anholt <eric@anholt.net>
13 ---
14 drivers/gpu/drm/v3d/v3d_debugfs.c | 16 +---------------
15 drivers/gpu/drm/v3d/v3d_drv.c | 9 ---------
16 2 files changed, 1 insertion(+), 24 deletions(-)
17
18 --- a/drivers/gpu/drm/v3d/v3d_debugfs.c
19 +++ b/drivers/gpu/drm/v3d/v3d_debugfs.c
20 @@ -4,7 +4,6 @@
21 #include <linux/circ_buf.h>
22 #include <linux/ctype.h>
23 #include <linux/debugfs.h>
24 -#include <linux/pm_runtime.h>
25 #include <linux/seq_file.h>
26
27 #include <drm/drm_debugfs.h>
28 @@ -130,11 +129,8 @@ static int v3d_v3d_debugfs_ident(struct
29 struct drm_device *dev = node->minor->dev;
30 struct v3d_dev *v3d = to_v3d_dev(dev);
31 u32 ident0, ident1, ident2, ident3, cores;
32 - int ret, core;
33 + int core;
34
35 - ret = pm_runtime_get_sync(v3d->drm.dev);
36 - if (ret < 0)
37 - return ret;
38
39 ident0 = V3D_READ(V3D_HUB_IDENT0);
40 ident1 = V3D_READ(V3D_HUB_IDENT1);
41 @@ -187,9 +183,6 @@ static int v3d_v3d_debugfs_ident(struct
42 (misccfg & V3D_MISCCFG_OVRTMUOUT) != 0);
43 }
44
45 - pm_runtime_mark_last_busy(v3d->drm.dev);
46 - pm_runtime_put_autosuspend(v3d->drm.dev);
47 -
48 return 0;
49 }
50
51 @@ -217,11 +210,6 @@ static int v3d_measure_clock(struct seq_
52 uint32_t cycles;
53 int core = 0;
54 int measure_ms = 1000;
55 - int ret;
56 -
57 - ret = pm_runtime_get_sync(v3d->drm.dev);
58 - if (ret < 0)
59 - return ret;
60
61 if (v3d->ver >= 40) {
62 V3D_CORE_WRITE(core, V3D_V4_PCTR_0_SRC_0_3,
63 @@ -245,8 +233,6 @@ static int v3d_measure_clock(struct seq_
64 cycles / (measure_ms * 1000),
65 (cycles / (measure_ms * 100)) % 10);
66
67 - pm_runtime_mark_last_busy(v3d->drm.dev);
68 - pm_runtime_put_autosuspend(v3d->drm.dev);
69
70 return 0;
71 }
72 --- a/drivers/gpu/drm/v3d/v3d_drv.c
73 +++ b/drivers/gpu/drm/v3d/v3d_drv.c
74 @@ -79,7 +79,6 @@ static int v3d_get_param_ioctl(struct dr
75 {
76 struct v3d_dev *v3d = to_v3d_dev(dev);
77 struct drm_v3d_get_param *args = data;
78 - int ret;
79 static const u32 reg_map[] = {
80 [DRM_V3D_PARAM_V3D_UIFCFG] = V3D_HUB_UIFCFG,
81 [DRM_V3D_PARAM_V3D_HUB_IDENT1] = V3D_HUB_IDENT1,
82 @@ -105,17 +104,12 @@ static int v3d_get_param_ioctl(struct dr
83 if (args->value != 0)
84 return -EINVAL;
85
86 - ret = pm_runtime_get_sync(v3d->drm.dev);
87 - if (ret < 0)
88 - return ret;
89 if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
90 args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) {
91 args->value = V3D_CORE_READ(0, offset);
92 } else {
93 args->value = V3D_READ(offset);
94 }
95 - pm_runtime_mark_last_busy(v3d->drm.dev);
96 - pm_runtime_put_autosuspend(v3d->drm.dev);
97 return 0;
98 }
99
100 @@ -308,9 +302,6 @@ static int v3d_platform_drm_probe(struct
101 return -ENOMEM;
102 }
103
104 - pm_runtime_use_autosuspend(dev);
105 - pm_runtime_set_autosuspend_delay(dev, 50);
106 - pm_runtime_enable(dev);
107
108 ret = v3d_gem_init(drm);
109 if (ret)