diff options
author | Felix Kuehling <Felix.Kuehling@amd.com> | 2017-11-01 19:21:32 -0400 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2017-11-01 19:21:32 -0400 |
commit | 096d1a3efc8b0914a4cfb1203c147ed597907191 (patch) | |
tree | c8b3a9e1d11df7546cecddbc39e851e30ee210fb /drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | |
parent | bfd5e378a98d0387b45a4864528a11b65d038f0c (diff) | |
download | linux-096d1a3efc8b0914a4cfb1203c147ed597907191.tar.bz2 |
drm/amdkfd: Update queue_count before mapping queues
map_queues_cpsch uses the queue_count to decide whether to upload
a new runlist. So update the counter before calling it.
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 45b98dd5b785..e2fc4c5d42cd 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -408,6 +408,17 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q) retval = mqd->update_mqd(mqd, q->mqd, &q->properties); + /* + * check active state vs. the previous state and modify + * counter accordingly. map_queues_cpsch uses the + * dqm->queue_count to determine whether a new runlist must be + * uploaded. + */ + if (q->properties.is_active && !prev_active) + dqm->queue_count++; + else if (!q->properties.is_active && prev_active) + dqm->queue_count--; + if (sched_policy != KFD_SCHED_POLICY_NO_HWS) retval = map_queues_cpsch(dqm); else if (sched_policy == KFD_SCHED_POLICY_NO_HWS && @@ -417,15 +428,6 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q) retval = mqd->load_mqd(mqd, q->mqd, q->pipe, q->queue, &q->properties, q->process->mm); - /* - * check active state vs. the previous state - * and modify counter accordingly - */ - if (q->properties.is_active && !prev_active) - dqm->queue_count++; - else if (!q->properties.is_active && prev_active) - dqm->queue_count--; - out_unlock: mutex_unlock(&dqm->lock); return retval; |