diff options
Diffstat (limited to 'drivers/gpu/drm/amd')
-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) | |||
408 | 408 | ||
409 | retval = mqd->update_mqd(mqd, q->mqd, &q->properties); | 409 | retval = mqd->update_mqd(mqd, q->mqd, &q->properties); |
410 | 410 | ||
411 | /* | ||
412 | * check active state vs. the previous state and modify | ||
413 | * counter accordingly. map_queues_cpsch uses the | ||
414 | * dqm->queue_count to determine whether a new runlist must be | ||
415 | * uploaded. | ||
416 | */ | ||
417 | if (q->properties.is_active && !prev_active) | ||
418 | dqm->queue_count++; | ||
419 | else if (!q->properties.is_active && prev_active) | ||
420 | dqm->queue_count--; | ||
421 | |||
411 | if (sched_policy != KFD_SCHED_POLICY_NO_HWS) | 422 | if (sched_policy != KFD_SCHED_POLICY_NO_HWS) |
412 | retval = map_queues_cpsch(dqm); | 423 | retval = map_queues_cpsch(dqm); |
413 | else if (sched_policy == KFD_SCHED_POLICY_NO_HWS && | 424 | 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) | |||
417 | retval = mqd->load_mqd(mqd, q->mqd, q->pipe, q->queue, | 428 | retval = mqd->load_mqd(mqd, q->mqd, q->pipe, q->queue, |
418 | &q->properties, q->process->mm); | 429 | &q->properties, q->process->mm); |
419 | 430 | ||
420 | /* | ||
421 | * check active state vs. the previous state | ||
422 | * and modify counter accordingly | ||
423 | */ | ||
424 | if (q->properties.is_active && !prev_active) | ||
425 | dqm->queue_count++; | ||
426 | else if (!q->properties.is_active && prev_active) | ||
427 | dqm->queue_count--; | ||
428 | |||
429 | out_unlock: | 431 | out_unlock: |
430 | mutex_unlock(&dqm->lock); | 432 | mutex_unlock(&dqm->lock); |
431 | return retval; | 433 | return retval; |