]> Git Repo - linux.git/commitdiff
drm/amdkfd: Call kfd2kgd.set_compute_idle
authorFelix Kuehling <[email protected]>
Mon, 16 Jul 2018 23:10:37 +0000 (19:10 -0400)
committerOded Gabbay <[email protected]>
Mon, 16 Jul 2018 23:10:37 +0000 (19:10 -0400)
User mode queue submissions don't go through KFD. Therefore we don't
know exactly when compute is idle or not idle. We use the existence
of user mode queues on a device as an approximation.

register_process is called when the first queue of a process is
created. Conversely unregister_process is called when the last queue
is destroyed. The first process that is registered takes compute
out of idle. The last process that is unregisters sets compute back
to idle.

Signed-off-by: Felix Kuehling <[email protected]>
Reviewed-by: Eric Huang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

index ace94d6e54cf2f9597a0b8747005f89915e02d7d..ec0d62a16e538c305f631b831432df0566b051c8 100644 (file)
@@ -782,7 +782,8 @@ static int register_process(struct device_queue_manager *dqm,
 
        retval = dqm->asic_ops.update_qpd(dqm, qpd);
 
-       dqm->processes_count++;
+       if (dqm->processes_count++ == 0)
+               dqm->dev->kfd2kgd->set_compute_idle(dqm->dev->kgd, false);
 
        dqm_unlock(dqm);
 
@@ -805,7 +806,9 @@ static int unregister_process(struct device_queue_manager *dqm,
                if (qpd == cur->qpd) {
                        list_del(&cur->list);
                        kfree(cur);
-                       dqm->processes_count--;
+                       if (--dqm->processes_count == 0)
+                               dqm->dev->kfd2kgd->set_compute_idle(
+                                       dqm->dev->kgd, true);
                        goto out;
                }
        }
This page took 0.063579 seconds and 4 git commands to generate.