blob: 80a699e4bb6eff7f41c379fd214886539e25186e (
plain)
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
|
From 75ef41d30bf019e1c823c35b6eec189c17adb59f Mon Sep 17 00:00:00 2001
From: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Date: Wed, 1 Aug 2018 13:49:59 +0530
Subject: [PATCH 0695/2940] drm/scheduler: add a list of run queues to the
entity
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
These are the potential run queues on which the jobs from this
entity can be scheduled. We will use this to do load balancing.
Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/scheduler/gpu_scheduler.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c
index a3e704486f7f..d3d8ab454780 100644
--- a/drivers/gpu/drm/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c
@@ -179,6 +179,8 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
unsigned int num_rq_list,
atomic_t *guilty)
{
+ int i;
+
if (!(entity && rq_list && num_rq_list > 0 && rq_list[0]))
return -EINVAL;
@@ -186,6 +188,11 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
INIT_LIST_HEAD(&entity->list);
entity->rq = rq_list[0];
entity->guilty = guilty;
+ entity->num_rq_list = num_rq_list;
+ entity->rq_list = kcalloc(num_rq_list, sizeof(struct drm_sched_rq *),
+ GFP_KERNEL);
+ for (i = 0; i < num_rq_list; ++i)
+ entity->rq_list[i] = rq_list[i];
entity->last_scheduled = NULL;
spin_lock_init(&entity->rq_lock);
@@ -348,6 +355,7 @@ void drm_sched_entity_fini(struct drm_sched_entity *entity)
dma_fence_put(entity->last_scheduled);
entity->last_scheduled = NULL;
+ kfree(entity->rq_list);
}
EXPORT_SYMBOL(drm_sched_entity_fini);
--
2.17.1
|