diff options
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 13 |
1 files changed, 11 insertions, 2 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 924e90c072e5..f44d6737b65a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | |||
@@ -320,6 +320,7 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q) | |||
320 | { | 320 | { |
321 | int retval; | 321 | int retval; |
322 | struct mqd_manager *mqd; | 322 | struct mqd_manager *mqd; |
323 | bool prev_active = false; | ||
323 | 324 | ||
324 | BUG_ON(!dqm || !q || !q->mqd); | 325 | BUG_ON(!dqm || !q || !q->mqd); |
325 | 326 | ||
@@ -330,10 +331,18 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q) | |||
330 | return -ENOMEM; | 331 | return -ENOMEM; |
331 | } | 332 | } |
332 | 333 | ||
333 | retval = mqd->update_mqd(mqd, q->mqd, &q->properties); | ||
334 | if (q->properties.is_active == true) | 334 | if (q->properties.is_active == true) |
335 | prev_active = true; | ||
336 | |||
337 | /* | ||
338 | * | ||
339 | * check active state vs. the previous state | ||
340 | * and modify counter accordingly | ||
341 | */ | ||
342 | retval = mqd->update_mqd(mqd, q->mqd, &q->properties); | ||
343 | if ((q->properties.is_active == true) && (prev_active == false)) | ||
335 | dqm->queue_count++; | 344 | dqm->queue_count++; |
336 | else | 345 | else if ((q->properties.is_active == false) && (prev_active == true)) |
337 | dqm->queue_count--; | 346 | dqm->queue_count--; |
338 | 347 | ||
339 | if (sched_policy != KFD_SCHED_POLICY_NO_HWS) | 348 | if (sched_policy != KFD_SCHED_POLICY_NO_HWS) |