-
Notifications
You must be signed in to change notification settings - Fork 2
/
0017-drm-panfrost-scheduler-fix.patch
113 lines (103 loc) · 4.5 KB
/
0017-drm-panfrost-scheduler-fix.patch
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
From: Dragan Simic <[email protected]>
Subject: [PATCH] panfrost: Fix scheduler priority and do various cleanups
Date: Fri, 17 Sep 2021 17:47:38 +0200
diff -pruN -X linux-5.15-rc1-ORIG/Documentation/dontdiff linux-5.15-rc1-ORIG/drivers/gpu/drm/panfrost/panfrost_job.c linux-5.15-rc1-panfrost/drivers/gpu/drm/panfrost/panfrost_job.c
--- linux-5.15-rc1-ORIG/drivers/gpu/drm/panfrost/panfrost_job.c 2021-09-13 01:28:37.000000000 +0200
+++ linux-5.15-rc1-panfrost/drivers/gpu/drm/panfrost/panfrost_job.c 2021-09-17 17:47:38.287735915 +0200
@@ -234,7 +234,7 @@ static void panfrost_job_hw_submit(struc
if (!atomic_read(&pfdev->reset.pending)) {
job_write(pfdev, JS_COMMAND_NEXT(js), JS_COMMAND_START);
dev_dbg(pfdev->dev,
- "JS: Submitting atom %p to js[%d][%d] with head=0x%llx AS %d",
+ "Job slot: submitting atom %p to js[%d][%d] with head=0x%llx, as=%d\n",
job, js, subslot, jc_head, cfg & 0xf);
}
spin_unlock(&pfdev->js->job_lock);
@@ -425,12 +425,12 @@ static void panfrost_job_handle_err(stru
bool signal_fence = true;
if (!panfrost_exception_is_fault(js_status)) {
- dev_dbg(pfdev->dev, "js event, js=%d, status=%s, head=0x%x, tail=0x%x",
+ dev_dbg(pfdev->dev, "Job slot event: js=%d, status=%s, head=0x%x, tail=0x%x\n",
js, exception_name,
job_read(pfdev, JS_HEAD_LO(js)),
job_read(pfdev, JS_TAIL_LO(js)));
} else {
- dev_err(pfdev->dev, "js fault, js=%d, status=%s, head=0x%x, tail=0x%x",
+ dev_err(pfdev->dev, "Job slot fault: js=%d, status=%s, head=0x%x, tail=0x%x\n",
js, exception_name,
job_read(pfdev, JS_HEAD_LO(js)),
job_read(pfdev, JS_TAIL_LO(js)));
@@ -671,7 +671,7 @@ panfrost_reset(struct panfrost_device *p
10, 10000);
if (ret)
- dev_err(pfdev->dev, "Soft-stop failed\n");
+ dev_err(pfdev->dev, "Failed to complete soft-stop: %d\n", ret);
/* Handle the remaining interrupts before we reset. */
panfrost_job_handle_irqs(pfdev);
@@ -740,7 +740,7 @@ static enum drm_gpu_sched_stat panfrost_
if (dma_fence_is_signaled(job->done_fence))
return DRM_GPU_SCHED_STAT_NOMINAL;
- dev_err(pfdev->dev, "gpu sched timeout, js=%d, config=0x%x, status=0x%x, head=0x%x, tail=0x%x, sched_job=%p",
+ dev_err(pfdev->dev, "GPU scheduler timeout: js=%d, config=0x%x, status=0x%x, head=0x%x, tail=0x%x, sched_job=%p\n",
js,
job_read(pfdev, JS_CONFIG(js)),
job_read(pfdev, JS_STATUS(js)),
@@ -822,7 +822,7 @@ int panfrost_job_init(struct panfrost_de
IRQF_SHARED, KBUILD_MODNAME "-job",
pfdev);
if (ret) {
- dev_err(pfdev->dev, "failed to request job irq");
+ dev_err(pfdev->dev, "Failed to request job IRQ: %d\n", ret);
return ret;
}
@@ -840,7 +840,7 @@ int panfrost_job_init(struct panfrost_de
pfdev->reset.wq,
NULL, "pan_js");
if (ret) {
- dev_err(pfdev->dev, "Failed to create scheduler: %d.", ret);
+ dev_err(pfdev->dev, "Failed to create scheduler: %d\n", ret);
goto err_sched;
}
}
diff -pruN -X linux-5.15-rc1-ORIG/Documentation/dontdiff linux-5.15-rc1-ORIG/drivers/gpu/drm/scheduler/sched_main.c linux-5.15-rc1-panfrost/drivers/gpu/drm/scheduler/sched_main.c
--- linux-5.15-rc1-ORIG/drivers/gpu/drm/scheduler/sched_main.c 2021-09-13 01:28:37.000000000 +0200
+++ linux-5.15-rc1-panfrost/drivers/gpu/drm/scheduler/sched_main.c 2021-09-17 17:50:54.947121296 +0200
@@ -489,8 +489,7 @@ void drm_sched_start(struct drm_gpu_sche
if (r == -ENOENT)
drm_sched_job_done(s_job);
else if (r)
- DRM_ERROR("fence add callback failed (%d)\n",
- r);
+ DRM_ERROR("Failed to add fence callback: %d\n", r);
} else
drm_sched_job_done(s_job);
}
@@ -776,7 +775,7 @@ static int drm_sched_main(void *param)
struct drm_gpu_scheduler *sched = (struct drm_gpu_scheduler *)param;
int r;
- sched_set_fifo_low(current);
+ sched_set_fifo(current);
while (!kthread_should_stop()) {
struct drm_sched_entity *entity = NULL;
@@ -824,13 +823,11 @@ static int drm_sched_main(void *param)
if (r == -ENOENT)
drm_sched_job_done(sched_job);
else if (r)
- DRM_ERROR("fence add callback failed (%d)\n",
- r);
+ DRM_ERROR("Failed to add fence callback: %d\n", r);
dma_fence_put(fence);
} else {
if (IS_ERR(fence))
dma_fence_set_error(&s_fence->finished, PTR_ERR(fence));
-
drm_sched_job_done(sched_job);
}
@@ -885,7 +882,7 @@ int drm_sched_init(struct drm_gpu_schedu
if (IS_ERR(sched->thread)) {
ret = PTR_ERR(sched->thread);
sched->thread = NULL;
- DRM_ERROR("Failed to create scheduler for %s.\n", name);
+ DRM_ERROR("Failed to create scheduler for %s: %d\n", name, ret);
return ret;
}