1 From 2d4f38abdc2a919d8002fbec7bc0be7c1312786a 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 582/806] drm/v3d: HACK: gut runtime pm for now.
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
12 Signed-off-by: Eric Anholt <eric@anholt.net>
14 drivers/gpu/drm/v3d/v3d_debugfs.c | 16 +---------------
15 drivers/gpu/drm/v3d/v3d_drv.c | 7 -------
16 drivers/gpu/drm/v3d/v3d_gem.c | 20 --------------------
17 3 files changed, 1 insertion(+), 42 deletions(-)
19 --- a/drivers/gpu/drm/v3d/v3d_debugfs.c
20 +++ b/drivers/gpu/drm/v3d/v3d_debugfs.c
22 #include <linux/circ_buf.h>
23 #include <linux/ctype.h>
24 #include <linux/debugfs.h>
25 -#include <linux/pm_runtime.h>
26 #include <linux/seq_file.h>
29 @@ -100,11 +99,8 @@ static int v3d_v3d_debugfs_ident(struct
30 struct drm_device *dev = node->minor->dev;
31 struct v3d_dev *v3d = to_v3d_dev(dev);
32 u32 ident0, ident1, ident2, ident3, cores;
36 - ret = pm_runtime_get_sync(v3d->dev);
40 ident0 = V3D_READ(V3D_HUB_IDENT0);
41 ident1 = V3D_READ(V3D_HUB_IDENT1);
42 @@ -157,9 +153,6 @@ static int v3d_v3d_debugfs_ident(struct
43 (misccfg & V3D_MISCCFG_OVRTMUOUT) != 0);
46 - pm_runtime_mark_last_busy(v3d->dev);
47 - pm_runtime_put_autosuspend(v3d->dev);
52 @@ -187,11 +180,6 @@ static int v3d_measure_clock(struct seq_
55 int measure_ms = 1000;
58 - ret = pm_runtime_get_sync(v3d->dev);
63 V3D_CORE_WRITE(core, V3D_V4_PCTR_0_SRC_0_3,
64 @@ -215,8 +203,6 @@ static int v3d_measure_clock(struct seq_
65 cycles / (measure_ms * 1000),
66 (cycles / (measure_ms * 100)) % 10);
68 - pm_runtime_mark_last_busy(v3d->dev);
69 - pm_runtime_put_autosuspend(v3d->dev);
73 --- a/drivers/gpu/drm/v3d/v3d_drv.c
74 +++ b/drivers/gpu/drm/v3d/v3d_drv.c
75 @@ -75,7 +75,6 @@ static int v3d_get_param_ioctl(struct dr
77 struct v3d_dev *v3d = to_v3d_dev(dev);
78 struct drm_v3d_get_param *args = data;
80 static const u32 reg_map[] = {
81 [DRM_V3D_PARAM_V3D_UIFCFG] = V3D_HUB_UIFCFG,
82 [DRM_V3D_PARAM_V3D_HUB_IDENT1] = V3D_HUB_IDENT1,
83 @@ -101,15 +100,12 @@ static int v3d_get_param_ioctl(struct dr
87 - ret = pm_runtime_get_sync(v3d->dev);
88 if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
89 args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) {
90 args->value = V3D_CORE_READ(0, offset);
92 args->value = V3D_READ(offset);
94 - pm_runtime_mark_last_busy(v3d->dev);
95 - pm_runtime_put_autosuspend(v3d->dev);
99 @@ -311,9 +307,6 @@ static int v3d_platform_drm_probe(struct
103 - pm_runtime_use_autosuspend(dev);
104 - pm_runtime_set_autosuspend_delay(dev, 50);
105 - pm_runtime_enable(dev);
107 ret = drm_dev_init(&v3d->drm, &v3d_drm_driver, dev);
109 --- a/drivers/gpu/drm/v3d/v3d_gem.c
110 +++ b/drivers/gpu/drm/v3d/v3d_gem.c
111 @@ -375,7 +375,6 @@ v3d_exec_cleanup(struct kref *ref)
113 struct v3d_exec_info *exec = container_of(ref, struct v3d_exec_info,
115 - struct v3d_dev *v3d = exec->v3d;
117 struct v3d_bo *bo, *save;
119 @@ -396,9 +395,6 @@ v3d_exec_cleanup(struct kref *ref)
120 drm_gem_object_put_unlocked(&bo->base);
123 - pm_runtime_mark_last_busy(v3d->dev);
124 - pm_runtime_put_autosuspend(v3d->dev);
129 @@ -412,7 +408,6 @@ v3d_tfu_job_cleanup(struct kref *ref)
131 struct v3d_tfu_job *job = container_of(ref, struct v3d_tfu_job,
133 - struct v3d_dev *v3d = job->v3d;
136 dma_fence_put(job->in_fence);
137 @@ -423,9 +418,6 @@ v3d_tfu_job_cleanup(struct kref *ref)
138 drm_gem_object_put_unlocked(&job->bo[i]->base);
141 - pm_runtime_mark_last_busy(v3d->dev);
142 - pm_runtime_put_autosuspend(v3d->dev);
147 @@ -519,12 +511,6 @@ v3d_submit_cl_ioctl(struct drm_device *d
151 - ret = pm_runtime_get_sync(v3d->dev);
157 kref_init(&exec->refcount);
159 ret = drm_syncobj_find_fence(file_priv, args->in_sync_bcl,
160 @@ -643,12 +629,6 @@ v3d_submit_tfu_ioctl(struct drm_device *
164 - ret = pm_runtime_get_sync(v3d->dev);
170 kref_init(&job->refcount);
172 ret = drm_syncobj_find_fence(file_priv, args->in_sync,