1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
From f5ba2c027e3f21bafcbff13ec513d6a10c8dc585 Mon Sep 17 00:00:00 2001
From: Eric Anholt <eric@anholt.net>
Date: Mon, 14 Jan 2019 15:13:17 -0800
Subject: [PATCH 589/703] drm/v3d: HACK: gut runtime pm for now.
Something is still unstable -- on starting a new glxgears from an idle
X11, I get an MMU violation in high addresses. The CTS also failed
quite quickly. With this, CTS progresses for an hour before OOMing
(allocating some big buffers when my board only has 600MB available to
Linux)
Signed-off-by: Eric Anholt <eric@anholt.net>
---
drivers/gpu/drm/v3d/v3d_debugfs.c | 16 +---------------
drivers/gpu/drm/v3d/v3d_drv.c | 7 -------
drivers/gpu/drm/v3d/v3d_gem.c | 20 --------------------
3 files changed, 1 insertion(+), 42 deletions(-)
--- a/drivers/gpu/drm/v3d/v3d_debugfs.c
+++ b/drivers/gpu/drm/v3d/v3d_debugfs.c
@@ -4,7 +4,6 @@
#include <linux/circ_buf.h>
#include <linux/ctype.h>
#include <linux/debugfs.h>
-#include <linux/pm_runtime.h>
#include <linux/seq_file.h>
#include <drm/drmP.h>
@@ -100,11 +99,8 @@ static int v3d_v3d_debugfs_ident(struct
struct drm_device *dev = node->minor->dev;
struct v3d_dev *v3d = to_v3d_dev(dev);
u32 ident0, ident1, ident2, ident3, cores;
- int ret, core;
+ int core;
- ret = pm_runtime_get_sync(v3d->dev);
- if (ret < 0)
- return ret;
ident0 = V3D_READ(V3D_HUB_IDENT0);
ident1 = V3D_READ(V3D_HUB_IDENT1);
@@ -157,9 +153,6 @@ static int v3d_v3d_debugfs_ident(struct
(misccfg & V3D_MISCCFG_OVRTMUOUT) != 0);
}
- pm_runtime_mark_last_busy(v3d->dev);
- pm_runtime_put_autosuspend(v3d->dev);
-
return 0;
}
@@ -187,11 +180,6 @@ static int v3d_measure_clock(struct seq_
uint32_t cycles;
int core = 0;
int measure_ms = 1000;
- int ret;
-
- ret = pm_runtime_get_sync(v3d->dev);
- if (ret < 0)
- return ret;
if (v3d->ver >= 40) {
V3D_CORE_WRITE(core, V3D_V4_PCTR_0_SRC_0_3,
@@ -215,8 +203,6 @@ static int v3d_measure_clock(struct seq_
cycles / (measure_ms * 1000),
(cycles / (measure_ms * 100)) % 10);
- pm_runtime_mark_last_busy(v3d->dev);
- pm_runtime_put_autosuspend(v3d->dev);
return 0;
}
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -75,7 +75,6 @@ static int v3d_get_param_ioctl(struct dr
{
struct v3d_dev *v3d = to_v3d_dev(dev);
struct drm_v3d_get_param *args = data;
- int ret;
static const u32 reg_map[] = {
[DRM_V3D_PARAM_V3D_UIFCFG] = V3D_HUB_UIFCFG,
[DRM_V3D_PARAM_V3D_HUB_IDENT1] = V3D_HUB_IDENT1,
@@ -101,15 +100,12 @@ static int v3d_get_param_ioctl(struct dr
if (args->value != 0)
return -EINVAL;
- ret = pm_runtime_get_sync(v3d->dev);
if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) {
args->value = V3D_CORE_READ(0, offset);
} else {
args->value = V3D_READ(offset);
}
- pm_runtime_mark_last_busy(v3d->dev);
- pm_runtime_put_autosuspend(v3d->dev);
return 0;
}
@@ -311,9 +307,6 @@ static int v3d_platform_drm_probe(struct
goto dev_free;
}
- pm_runtime_use_autosuspend(dev);
- pm_runtime_set_autosuspend_delay(dev, 50);
- pm_runtime_enable(dev);
ret = drm_dev_init(&v3d->drm, &v3d_drm_driver, dev);
if (ret)
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -375,7 +375,6 @@ v3d_exec_cleanup(struct kref *ref)
{
struct v3d_exec_info *exec = container_of(ref, struct v3d_exec_info,
refcount);
- struct v3d_dev *v3d = exec->v3d;
unsigned int i;
struct v3d_bo *bo, *save;
@@ -396,9 +395,6 @@ v3d_exec_cleanup(struct kref *ref)
drm_gem_object_put_unlocked(&bo->base);
}
- pm_runtime_mark_last_busy(v3d->dev);
- pm_runtime_put_autosuspend(v3d->dev);
-
kfree(exec);
}
@@ -412,7 +408,6 @@ v3d_tfu_job_cleanup(struct kref *ref)
{
struct v3d_tfu_job *job = container_of(ref, struct v3d_tfu_job,
refcount);
- struct v3d_dev *v3d = job->v3d;
unsigned int i;
dma_fence_put(job->in_fence);
@@ -423,9 +418,6 @@ v3d_tfu_job_cleanup(struct kref *ref)
drm_gem_object_put_unlocked(&job->bo[i]->base);
}
- pm_runtime_mark_last_busy(v3d->dev);
- pm_runtime_put_autosuspend(v3d->dev);
-
kfree(job);
}
@@ -519,12 +511,6 @@ v3d_submit_cl_ioctl(struct drm_device *d
if (!exec)
return -ENOMEM;
- ret = pm_runtime_get_sync(v3d->dev);
- if (ret < 0) {
- kfree(exec);
- return ret;
- }
-
kref_init(&exec->refcount);
ret = drm_syncobj_find_fence(file_priv, args->in_sync_bcl,
@@ -643,12 +629,6 @@ v3d_submit_tfu_ioctl(struct drm_device *
if (!job)
return -ENOMEM;
- ret = pm_runtime_get_sync(v3d->dev);
- if (ret < 0) {
- kfree(job);
- return ret;
- }
-
kref_init(&job->refcount);
ret = drm_syncobj_find_fence(file_priv, args->in_sync,
|